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


14 posts
by JollyRoger » Wed Oct 24, 2012 10:19 am
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?
Posts: 154
Joined: Wed Feb 01, 2012 9:48 am
by mongrol » Wed Oct 24, 2012 10:33 am
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.
Posts: 76
Joined: Wed Aug 01, 2012 2:43 am
by plugwash » Wed Oct 24, 2012 10:40 am
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 ;).
Forum Moderator
Forum Moderator
Posts: 3137
Joined: Wed Dec 28, 2011 11:45 pm
by JollyRoger » Wed Oct 24, 2012 10:46 am
Thanks! I'll take your advice and stick to apt-get upgrade followed by apt-get autoremove.
Posts: 154
Joined: Wed Feb 01, 2012 9:48 am
by mmcmonster » Sat Oct 27, 2012 11:12 am
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.
Posts: 4
Joined: Sat Oct 27, 2012 11:09 am
by smonkey » Sat Oct 27, 2012 8:04 pm
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 :)
Posts: 37
Joined: Wed Aug 15, 2012 8:44 pm
by Cancelor » Wed Aug 27, 2014 7:46 pm
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?
Can't find the thread you want? Try googling : YourSearchHere site:raspberrypi.org
User avatar
Posts: 712
Joined: Wed Aug 28, 2013 4:09 pm
Location: UK
by AndrewS » Wed Aug 27, 2014 7:51 pm
That's a bit of an FAQ, and a quick google finds viewtopic.php?f=26&t=14074
User avatar
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
by fruitoftheloom » Wed Aug 27, 2014 7:52 pm
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
Posts: 11034
Joined: Tue Mar 25, 2014 12:40 pm
Location: Bognor Regis UK
by luipez » Sat Feb 07, 2015 10:45 am
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.
Posts: 12
Joined: Fri Feb 06, 2015 6:20 pm
by DirkS » Sat Feb 07, 2015 11:02 am
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... (viewtopic.php?f=28&t=97314)
Posts: 6401
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK
by luipez » Sat Feb 07, 2015 11:10 am
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
Posts: 12
Joined: Fri Feb 06, 2015 6:20 pm
by mahjongg » Sat Feb 07, 2015 11:48 am
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.
User avatar
Forum Moderator
Forum Moderator
Posts: 8362
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands
by luipez » Sat Feb 07, 2015 1:45 pm
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.
Posts: 12
Joined: Fri Feb 06, 2015 6:20 pm