Page 1 of 1

apt-get dist-upgrade v. apt-get upgrade

Posted: Wed Oct 24, 2012 10:19 am
by JollyRoger
In all the documentation and posts I've read for the RasPi the recommended way to upgrade a distribution and its packages is to use sudo apt-get update followed by sudo apt-get upgrade. But elsewhere it's recommended that you use sudo apt-get dist-upgrade rather than sudo apt-get upgrade. See, for example, http://askubuntu.com/questions/194651/w ... st-upgrade :-

"The upgrade option only installs new version of the packages that are already installed on the system (and yes, kernel updates belong to them).

However, sometimes the updates change dependencies: for example, a new version of a package will no longer depend on a library that you have installed, or will require installation of additional libraries. The upgrade option will never remove installed packages that you no longer actually need.

However, the dist-upgrade option can "intelligently" handle changes in the dependencies system. This includes removing packages that are no longer necessary or resolve conflicts between packages that arose because of changes in the dependencies."


Because of this I've started to use apt-get update && apt-get dist-upgrade with my Pi (running Raspbian) rather than apt-get update && apt-get upgrade. I gather from other Google searches that the only disadvantage of doing this is that by using apt-get upgrade "you keep the old kernel versions around so that in case there is a problem with booting the new kernel, you can choose the old one from the boot menu and recover."

Has anyone any comments/advice regarding this?

Re: apt-get dist-upgrade v. apt-get upgrade

Posted: Wed Oct 24, 2012 10:33 am
by mongrol
Use apt-get upgrade, reboot, test. If all good then apt-get autoremove to uninstall any redundant packages. Or use dist-upgrade and live life on the edge. Well, its debian so it's a good bit back from the edge.

Re: apt-get dist-upgrade v. apt-get upgrade

Posted: Wed Oct 24, 2012 10:40 am
by plugwash
The main difference between upgrade and dist-upgrade is that dist-upgrade will add or remove packages to update others while upgrade won't. Dist-upgrade can be a useful tool but you MUST check what it is planning to do before saying yes because sometimes it's idea of what should be removed to make way for upgrades will disagree with yours ;).

Re: apt-get dist-upgrade v. apt-get upgrade

Posted: Wed Oct 24, 2012 10:46 am
by JollyRoger
Thanks! I'll take your advice and stick to apt-get upgrade followed by apt-get autoremove.

Re: apt-get dist-upgrade v. apt-get upgrade

Posted: Sat Oct 27, 2012 11:12 am
by mmcmonster
Just adding a single data point here:

I've been using Ubuntu since '05 and just starting with Rasbian.

I've always used dist-upgrade and don't recall a single issue with it.

Re: apt-get dist-upgrade v. apt-get upgrade

Posted: Sat Oct 27, 2012 8:04 pm
by smonkey
mmcmonster wrote:Just adding a single data point here:

I've been using Ubuntu since '05 and just starting with Rasbian.

I've always used dist-upgrade and don't recall a single issue with it.
Same here, I've adminned dozens of Ubuntu/Debian boxes over the last 10 years and always use dist-upgrade and haven't ever had a problem :)

Re: apt-get dist-upgrade v. apt-get upgrade

Posted: Wed Aug 27, 2014 7:46 pm
by Cancelor
What is the current recommendation for getting everything to the latest level?

I've just seen this posted on another thread

Code: Select all

sudo apt-get update
sudo apt-get dist-upgrade
reboot
sudo rpi-update
reboot
but where does apt-get upgrade and apt-get rpi-update fit into the grand scheme of things?

Re: apt-get dist-upgrade v. apt-get upgrade

Posted: Wed Aug 27, 2014 7:51 pm
by AndrewS
That's a bit of an FAQ, and a quick google finds http://www.raspberrypi.org/forums/viewt ... 26&t=14074

Re: apt-get dist-upgrade v. apt-get upgrade

Posted: Wed Aug 27, 2014 7:52 pm
by fruitoftheloom
Cancelor wrote:What is the current recommendation for getting everything to the latest level?

I've just seen this posted on another thread

Code: Select all

sudo apt-get update
sudo apt-get dist-upgrade
reboot
sudo rpi-update
reboot
but where does apt-get upgrade and apt-get rpi-update fit into the grand scheme of things?
rpi-update is the firmware / kernel updates

apt-get see the MAN http://linux.die.net/man/8/apt-get

Re: apt-get dist-upgrade v. apt-get upgrade

Posted: Sat Feb 07, 2015 10:45 am
by luipez
In RaspBian you can set that at the end of the boot, before starting the graphical screen may be asked the following:

"Do you want to start the update (S / N)?"

where S is start typing the commands:

sudo apt-get update
sudo apt-get upgrade
sudo rpi-update

and typing instead N to start the graphical screen.

This is to remember to do the update in a while.

Re: apt-get dist-upgrade v. apt-get upgrade

Posted: Sat Feb 07, 2015 11:02 am
by DirkS
luipez wrote:sudo apt-get update
sudo apt-get upgrade
sudo rpi-update
You're responding to topic that's about 6 months old.

More importantly: generally I would advise against using rpi-update, unless there is a good reason.
In the last couple of weeks several users got a bit of a surprise when kernel 3.18 was installed when they used rpi-update, and all kinds of peripherals stopped working... (http://www.raspberrypi.org/forums/viewt ... 28&t=97314)

Re: apt-get dist-upgrade v. apt-get upgrade

Posted: Sat Feb 07, 2015 11:10 am
by luipez
I joined recently and in my research came out this thread.
Putting aside about sudo rpi-update, you can do as requested?

How?

Thank You

Re: apt-get dist-upgrade v. apt-get upgrade

Posted: Sat Feb 07, 2015 11:48 am
by mahjongg
luipez wrote:I joined recently and in my research came out this thread.
Putting aside about sudo rpi-update, you can do as requested?

How?

Thank You
enter in commanline (terminal). Linux base knowledge.

Re: apt-get dist-upgrade v. apt-get upgrade

Posted: Sat Feb 07, 2015 1:45 pm
by luipez
mahjongg wrote: enter in commanline (terminal). Linux base knowledge.
I would like to make a script that does this:

at the end of the boot, before starting the graphical screen may be asked the following:

"Do you want to start the update (S / N)?"

where S is start typing the commands:

sudo apt-get update
sudo apt-get upgrade
sudo rpi-update

and typing instead N to start the graphical screen.