What is the difference between apt-get update
and apt-get upgrade
?
Which should I run first?
Do any of them automatically run the other?
What is the difference between apt-get update
and apt-get upgrade
?
Which should I run first?
Do any of them automatically run the other?
You should first run update
, then upgrade
. Neither of them automatically runs the other.
apt-get update
updates the list of available packages and their versions, but it does not install or upgrade any packages.apt-get upgrade
actually installs newer versions of the packages you have. After updating the lists, the package manager knows about available updates for the software you have installed. This is why you first want to update
.Additionally, you can use apt-get update && apt-get upgrade
to do both steps one after the other.
Here is the order for apt
users:
sudo apt update
sudo apt upgrade
sudo apt autoremove
.Don't fall for dist-upgrade
or full-upgrade
unless you know what you want to do exactly! Use the time tested steps as shown above!
apt-get upgrade
what you want to do isapt-get dist-upgrade
– fdierre Jan 09 '12 at 23:41dist-upgrade
won't upgrade to a new OS, but will upgrade to a new kernel (common enough) or a different set of dependencies (common enough) or remove dependencies that don't matter after an upgrade (also common). If you're on a home or office system, most of the time you wantdist-upgrade
, notupgrade
. It's if you are upgrading several systems, or one that you need kept in a well-defined state that you'd wantupgrade
. For "regular" users (their own machine),dist-upgrade
is the one to go for. – Jon Hanna Apr 25 '14 at 22:08apt-get autoremove
! – austin Nov 18 '14 at 18:17apt-get upgrade
andapt-get install
? – Nam G VU Nov 13 '17 at 09:44apt-get upgrade
will not install all kernel security patches, butapt-get install
will. Note thatapt install
does the same thing these days – Warren P Jan 13 '18 at 20:35update
withCheck for updates
andupgrade
withinstall the new update
in my smartphone?? – AATHITH RAJENDRAN Apr 23 '20 at 04:51