Is apt dist-upgrade not necessary anymore
Solution 1
apt-get upgrade
vs apt upgrade
vs apt full-upgrade
apt-get upgrade
only upgrades the apps, tools, and utilities. It does not install new Linux kernel of the OS.
apt upgrade
upgrades the apps, tools, and utilities and installs new Linux kernel of the OS. However, it never removes old packages.
apt full-upgrade
upgrades the apps, tools, and utilities and installs new Linux kernel of the OS. It also removes old packages if needed for the upgrade.
It looks to me apt full-upgrade
does the same thing as apt-get dist-upgrade
. That is to say the full-upgrade
will check for and install a new kernel if available and removes old packages if the removal is necessary for the upgrade.
kernels are the fundamental part of the OS. For this reason the the old version of the kernel is never replaced by the new version when you run apt upgrade
or apt full-upgrade
. The new version of kernel is installed and the existing version is kept as is. The configuration in the grub is changed to boot from the new version by default during the upgrade process. If the new kernel does not work for some reason one can boot from the old kernel from the advanced grub menu.
Note, apt full-upgrade
does not remove older versions of kernels as it installs the newest version. To remove these one must use apt autoremove
.
Why change the name from dist-upgrade
to full-upgrade
?
- If you use
apt-get
then you need to usedist-upgrade
- If you use
apt
then you need to usefull-upgrade
I think the dist-upgrade
was a bit confusing. For example, this does not upgrade from Ubuntu 16.04 to Ubuntu 18.04. It only upgrade the kernel, and other stuff, within Ubuntu 16.04.
I think full-upgrade
is more intuitive than dist-upgrade
.
See What is "dist-upgrade" and why does it upgrade more than "upgrade"? for more details.
Full disclosure: I am just an user of Ubuntu I didn't make the decision to change it. These are my personal views.
Hope this helps
Solution 2
dist-upgrade
has been superseded in Ubuntu by full-upgrade
.
Older users of Ubuntu remember when dist-upgrade
was indeed used regularly to install kernel packages. Kernel package names change with the version, making them ineligible for normal upgrade
. full-upgrade
was added to safely meet this need of the Ubuntu package flow.
The original purpose of dist-upgrade
is to migrate between releases of Debian (roughly equivalent to Ubuntu's do-release-upgrade
.) So there is a bit less protection from unanticipated consequences. Read the proposed changes carefully before agreeing.
Using dist-upgrade
instead of full-upgrade
probably won't hurt a healthy system. Millions of users over a decade have worked a lot of the bugs out of the apt workflow. However, dist-upgrade
may have unexpected results on a system with held broken packages or other unresolved problems.
Related videos on Youtube
singrium
A recently graduated Telecommunications engineer. A Python and Linux lover
Updated on September 18, 2022Comments
-
singrium over 1 year
Before Ubuntu 18.04 was available, I was using Ubuntu 16.04. And I was using
sudo apt-get update
,sudo apt-get upgrade
andsudo apt-get dist-upgrade
to do the update and upgrade stuff. With Ubuntu 18.04, I changed to to useapt
instead ofapt-get
. What was weird for me is thatsudo apt dist-upgrade
has no effect anymore: I do the update and upgrade usingsudo apt update
andsudo apt upgade
, but when I runsudo apt dist-upgrade
, nothing happens contrary to when I was usingsudo apt-get dist-upgrade
.
When I usedsudo apt-get dist-upgrade
some packages were removed and others were installed. However when I runsudo apt dist-upgrade
, nothing happened at all.. All what I get is:sudo apt dist-upgrade Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
And this happens every time since I started using
apt
instead ofapt-get
.
Is it something related toapt
(i.esudo apt upgrade
replaces bothupgrade
anddist-upgrade
) or what is the issue exactly?-
rm-vanda over 5 yearsI'll be curious to see the full answer, but this seems to indicate that you are correct: askubuntu.com/questions/81585/…
-
-
Daniele Santi over 5 years+1, but to be pedant, from the manpage of
apt
itself:upgrade
never removes existing packages, whilefull-upgrade
will remove currently installed packages if this is needed to upgrade the system as a whole. Also,apt dist-upgrade
looks like to work ok on my systems (probably for backwards compatibility). -
user68186 over 5 years@MrShunz I know this is what the man page says. It is also mentioned in the other answer I will add as reference.
-
mook765 over 5 years
apt upgrade
andapt-get upgrade
handle the thing different, see hiroom2.com/2016/05/20/ubuntu-16-04-debian-8-apt-command/… -
user68186 over 5 years+1 for the original purpose of
dist-upgrade
. One would have to fiddle with thesources.list
to use it this way I guess. -
user68186 over 5 years@mook765 Thanks! I will edit my answer based on your reference.
-
Daniele Santi over 5 years@user68186 Well, there was no other answer when I commented ;)
-
user541686 over 5 years"I think the dist-upgrade was a bit confusing." I swear this is the understatement of the century regarding apt. Is there anything about apt that is not confusing?! Like what does the name "apt" or "aptitude" have to do with package management in the first place? Why are there 3 variations of apt? Why does apt-get modify my system? Why does "update" not update my system? Why does "upgrade" not upgrade my system? Why shouldn't it just update its internal cache before upgrading automatically like a sane OS? Why does purge uninstall a package instead of purging it from the cache? etc....
-
Ray Woodcock over 2 years@user541686: good rant. I'm there.