How to Safely Update and Fully Upgrade Debian from the Terminal


 To fully update and upgrade a Debian system, use the following commands in the terminal to refresh the package list and install all available updates: 


bash


sudo apt update && sudo apt upgrade -y


For a more thorough upgrade that handles changing dependencies or removing obsolete packages, 

use:



bash


sudo apt update && sudo apt full-upgrade -y



Key Commands Explained


sudo apt update


: Updates the local index of available packages from the repositories.


sudo apt upgrade


: Installs newer versions of installed packages.


sudo apt full-upgrade


: Installs updates and intelligently handles changing dependencies, including removing packages if necessary for the upgrade.


-y


 : Automatically answers 'yes' to prompts, allowing the process to run without manual confirmation.


&&


: Chains commands, ensuring upgrade only runs if update completes successfully. 


Unix & Linux Stack Exchange


 

Recommended Workflow


Update Repository List:


 sudo apt update


Upgrade Packages:


 sudo apt upgrade 


or 


sudo apt full-upgrade


Clean Up (Optional):


 sudo apt autoremove 


to remove unnecessary dependency packages.


Reboot:


 sudo reboot


 if kernel updates were installed. 

Comments

Popular Posts