How to update Ubuntu, Linux Mint by command-line

In this beginner's tutorial, we shall see how to install the system updates by using the command-line method via the Terminal instead of the GUI way. It's your first baby step towards the command-line approach of doing things.

If you have been using Ubuntu and Linux Mint for a while, you might be aware of how to keep your system up to date by graphical user interface method (GUI) using the corresponding Package Manager. Ubuntu users need to use the Ubuntu Software Center, and Linux Mint users can use the Update Manager to keep the system updated with official security fixes and updated apps.

Update Manager in Linux Mint
Update Manager in Linux Mint

In this beginner’s tutorial, we shall see how to install the same updates by using the command-line method via the Terminal instead of the GUI way. This is typically the first step to go command-line on the approach to learning Linux.

Install Updates on Ubuntu, Linux Mint, and elementary OS from the Terminal

Launch the Terminal App. On Ubuntu, you can do this by going to the “Activities” menu and looking for “terminal” in the search box. You can also use the Ctrl+Alt+T keyboard combination.

Step 1: Update your system’s repository using the apt-get update command. You must enter the admin password when prompted.

sudo apt-get update
Update command Linux Mint
Update command Linux Mint

Step 2: Once the repo is updated, it’s time to now fetch the updates from the official server and also apply the updates. The apt-get upgrade command will never remove the currently installed packages. New versions of currently installed packages that cannot be upgraded will be left at their current version. Use the apt upgrade command:

sudo apt-get upgrade
Upgrade command Linux Mint
Upgrade command Linux Mint

That’s it; your system should be updated by now!

[Tip] Using Distribution Upgrade

There is yet another command that you can use instead of apt-get upgrade command. It’s the apt-get dist-upgrade. This command intelligently handles changing dependencies with new versions of packages.

It will attempt to upgrade the most important packages at the expense of less important ones if necessary, to prevent broken installations. The dist-upgrade command may, therefore, remove some outdated and broken packages. You can use it when “Step 2” ends up with an error.

sudo apt-get dist-upgrade

Installing only the security updates

Some times to save time while administrating the remote machines, you may want to launch Terminal and only install the security updates.

You can use the unattended upgrade command, which will silently install updates without user interaction.

sudo apt-get install unattended-upgrades

Instead, if you want to have an interactive installation, use the display parameter:

sudo apt-get install unattended-upgrades -d
AD

Related Articles

12 COMMENTS

  1. I am still running Mint 13. I want to upgrade to 14, run all updates, then upgrade to 15, run all updates, then 16, 17.3 and 18.3 with updates for each. I have all the Mint versions burned from ISO files to DVDs. I have copied all of them to a hard drive, each in a different folder, Mint 14-64, Mint 15-64, Mint 16-64, Mint 17.3-64, and Mint 18.3-64.
    Will this work? If so, what commands should I use? I assume they would be similar to what you show, but would specify the source drive and folder name for each.
    How would I do that?
    Thanks.

  2. hi im new to Linux Mint. My update manager is not responding. It indicates that there is/are updates available using the “x” icon but whenever I click it it said that the public key is not available. I used to be working ok, but after an update recently, it went kaput…. any suggestion?

  3. Thank you, but having followed your instructions, I do not see any evidence that anything ran at all. Should I expect to see a record of something having run? I am not seeing any statement of having executed.

Leave a Reply to Ed Cancel reply

Please enter your comment!
Please enter your name here

SPONSOR AD
22,858FansLike
453FollowersFollow
16SubscribersSubscribe

More Articles Like This