Updating Linux Packages | Upgrading Linux

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.

  1. Open a terminal window by pressing Ctrl+Alt+T
  2. 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:
    sudo apt update

  3. Once the packages list is up to date, you can upgrade those packages by typing:
    sudo apt upgrade

    sudo apt upgrade
    Then press Y when prompted to upgrade the packages:
    Press Y to continue apt upgrade

  4. After the upgrade is complete, perform a cleanup and remove any remaining unnecessary files with the following commands:
    sudo apt autoremove && sudo apt clean

    sudo apt autoremove && sudo apt clean
    Note: You'll probably need to enter your password again, and then press Y to proceed to clean.
    Press Y 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

sudo apt dist-upgrade