Whats the Difference Between upgrade and dist-upgrade? What should I use? Whats the best? Is there a risk if I use dist-upgrade? Is it only used to upgrade the distribution? Whats the recommended command to update the system? Like this, there are many questions regarding these two commands. I think its time to clear out the myths and learn the truth…
One of our readers asked this question after reading one of our earlier posts… When updating the packages in Ubuntu, we have two commands, apt-get upgrade and apt-get dist-upgrade. Many people only use apt-get upgrade. Some are afraid to use the dist-upgrade saying that it’s used to upgrade the distributions and it’s not safe! This is a myth! First, I also had doubts about this command but I used it a lot. Recently, I did some research and also asked it in the Ubuntu Forum and in AskUbuntu. Here’s what I learnt :
apt-get update :
If we need to update the packages of our Ubuntu system, we mostly use this command. This command will update the currently installed packages to their latest versions. But, some packages have dependencies. If the new updated version need to add or remove any of these dependencies, then apt-get update won’t handle it. Simply, it won’t handle any upgrades if that new package need to remove or add any other packages.
apt-get dist-upgrade :
If a new updated package need to remove or add any other packages, it might affect some other packages which are already installed. They might also be depending on those removing packages. What if we remove them? The updated package will work but the others might break. That’s why apt-get upgrade won’t handle these updates. The person who can handle them is apt-get dist-upgrade. dist-upgrade is smart. It can check for these kinds of conflicts and avoid breaking the system while upgrading. But some say that its not 100% perfect!
What will the graphical update manager do?
Normally, it does the work of apt-get upgrade and it can also add packages. But it won’t remove. If it need to remove packages, it calls the partial upgrade tool which will do the removing.
Whats the recommended command?
What I think is,
First, do an apt-get upgrade and see whether it keeps back any packages
If it keeps any packages, run apt-get dist-upgrade
Be careful when using this on critical situations like in a web server
Always read what it say before hitting ‘Y’! That’s the key to keep the system from breaking!
– Image : Gomez Hyuuga