sudo apt update vs upgrade: What’s the Difference?

If you want to keep your Ubuntu or Debian system updated, you use the combination of sudo apt update and sudo apt upgrade commands.

Some older tutorial also mention sudo apt-get update and sudo apt-get upgrade.

Both apt and apt-get commands work pretty much the same except for some minor differences that I’ll discuss later in this later.

Let’s first discuss the difference between update and upgrade. Are not the two the same thing?

Difference between apt update and upgrade

Though it sounds like running the apt update will give you the latest version of the package, it’s not true. The update command only gets the information about the latest version of packages available for your system. It doesn’t download or install any package. It is the apt upgrade command that actually downloads and upgrades the package to the new version.

Still confused? Let me explain a bit more. I advise reading up on the concept of package manager. It will help you understand things even better.

Linux Package Manager Explanation

Basically your system works on a database (cache) of available packages. Note that this cache or database doesn’t contain the packages themselves, just the metadata (version, repository, dependency etc) on the package.

If you don’t update this database, the system won’t know if there are newer packages available or not.

When you run the apt update or apt-get update command, it will fetch the updated metadata (package version etc) on the packages.

sudo apt update vs upgrade: What’s the Difference?
sudo apt update vs upgrade: What’s the Difference?read this article to learn on the differences of apt and apt-get commands. Let me focus on difference between the update and upgrade options of these commands.

apt update vs apt-get update

Both apt-get update and apt update do the same task of updating the local package cache so that your system is aware of the available package versions.

Technically, there is no difference. However, apt update does one thing better than apt-get update. It tells you the number of packages that can be upgraded.

Hit:15 https://ppa.launchpadcontent.net/slimbook/slimbook/ubuntu jammy InRelease
Fetched 213 kB in 4s (55.8 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
6 packages can be upgraded. Run 'apt list --upgradable' to see them.

apt-get update doesn’t even tell you if any package can be upgraded.

apt get updateapt update output
apt-get update vs apt update

You can see the list of upgradable packages with apt but apt-get doesn’t have this option.

[email protected]:~$ apt list --upgradable 
Listing... Done
fprintd/jammy-updates 1.94.2-1ubuntu0.22.04.1 amd64 [upgradable from: 1.94.2-1]
gnome-control-center-data/jammy-updates,jammy-updates 1:41.7-0ubuntu0.22.04.4 all [upgradable from: 1:41.7-0ubuntu0.22.04.1]
gnome-control-center-faces/jammy-updates,jammy-updates 1:41.7-0ubuntu0.22.04.4 all [upgradable from: 1:41.7-0ubuntu0.22.04.1]
gnome-control-center/jammy-updates 1:41.7-0ubuntu0.22.04.4 amd64 [upgradable from: 1:41.7-0ubuntu0.22.04.1]
libpam-fprintd/jammy-updates 1.94.2-1ubuntu0.22.04.1 amd64 [upgradable from: 1.94.2-1]
vivaldi-stable/stable 5.4.2753.40-1 amd64 [upgradable from: 5.4.2753.37-1]

Let’s talk compare the upgrade option of both commands.

apt upgrade vs apt-get upgrade

Both apt-get upgrade and apt upgrade commands install the newer version of the upgradable packages based on the data in the local package cache (refreshed by the update command).

However, the apt upgrade command does couple of things differently than its apt-get counterpart.

The apt upgrade command can upgrade the Linux kernel version, apt-get upgrade cannot do that. You need to use apt-get dist-upgrade for upgrading the kernel version with apt-get command.

Print Friendly, PDF & Email

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Server Status

Aradippou Chat 1 Chat 2 Larnaca Limassol Nicosia

Chat Links

Official Links.

1. Chat 1.
2. Chat 2.

Alternative Mirror Links.

1. KiwiIRC 1.
2. KiwiIRC 2.

Other Web Clients.

1. IrcCloud.

Recent Posts

Related Posts:

Advertisement

Archives

Super Club Radio

Mighty Deals

CyIRC

CyIRC Tweets

Scroll Up
Fatal error: Uncaught WMAC\JSMin_UnterminatedStringException: WMAC\JSMin: Unterminated String at byte 1181: "+o.accessToken}}).then(e=>{if(!e.ok)throw e;return e});return a.catch(e=>{console.error(`Failed to logout chatrix session. deviceId: ${o.deviceId}`)}),a}})(); in /home/bszucbfe/public_html/wp-content/plugins/clearfy/components/minify-and-combine/includes/classes/ext/php/jsmin.php:215 Stack trace: #0 /home/bszucbfe/public_html/wp-content/plugins/clearfy/components/minify-and-combine/includes/classes/ext/php/jsmin.php(157): WMAC\JSMin->action(2) #1 /home/bszucbfe/public_html/wp-content/plugins/clearfy/components/minify-and-combine/includes/classes/ext/php/jsmin.php(96): WMAC\JSMin->min() #2 /home/bszucbfe/public_html/wp-content/plugins/clearfy/components/minify-and-combine/includes/classes/class-main.php(375): WMAC\JSMin::minify('(function(){"us...') #3 /home/bszucbfe/public_html/wp-includes/class-wp-hook.php(324): WMAC_PluginMain->jsSnippetcacher('(function(){"us...', '/home/bszucbfe/...') #4 /home/bszucbfe/public_h in /home/bszucbfe/public_html/wp-content/plugins/clearfy/components/minify-and-combine/includes/classes/ext/php/jsmin.php on line 215