Updating Linux is a fairly straight forward process that can easily be performed by running a few simple commands from an open terminal. These commands will vary slightly depending on the exact Linux distribution you are using. Here are some examples using Ubuntu or Debian.
How to Update Ubuntu Linux from a Terminal
To update Ubuntu and other Debian based distributions such as Linux Mint, Kali etc.
- Open a terminal window by pressing Ctrl+Alt+T
- Before upgrading, you'll need to update the list of available packages. To fetch the latest list of packages, type the following command and press Enter.
sudo apt update
Then provide your password and press Enter again:
- Once the packages list is up to date, you can upgrade those packages by typing:
sudo apt upgrade
Then press Y when prompted to upgrade the packages:
- After the upgrade is complete, perform a cleanup and remove any remaining unnecessary files with the following commands:
sudo apt autoremove && sudo apt clean
Note: You'll probably need to enter your password again, and then press Y to proceed to clean.
The autoremove command removes packages that were previously installed as dependencies for other packages but are no longer needed, and clean attempts to clean the packages and install scripts found in /var/cache/apt/archives
How to Perform an Ubuntu Distribution Upgrade
To perform an Ubuntu or Debain based distribution upgrade, simply type the following command and then pressing Enter:
sudo apt dist-upgrade