Page 1 of 2

How do you update your Raspbian ?

Posted: Wed Apr 26, 2017 12:53 pm
by gets.chomp
Hi everyone !

When I was checking the documentation of the Raspberry Pi, I found that they recommend updating the kernel using "rpi-update".

However on Stack Exchange I also read that doing "sudo apt-get update" followed by "sudo apt-get upgrade" also updated the whole Raspbian installation, kernel and everything ?
After using this second method I indeed saw my Splash Screen indicating a more recent version at boot.

So what's the best and the difference between "rpi-update" and "sudo apt-get update" followed by "sudo apt-get upgrade" ? I also saw "sudo apt-get dist-upgrade" in the documentation but don't understand the difference with "upgrade" :/.
Thanks !

Re: How do you update your Raspbian ?

Posted: Wed Apr 26, 2017 12:57 pm
by RaTTuS
sudo apt-get update && sudo apt-get dist-upgrade

only do rpi-update if you have been told to in reference to a particular problem

Re: How do you update your Raspbian ?

Posted: Wed Apr 26, 2017 1:01 pm
by fruitoftheloom
gets.chomp wrote:Hi everyone !

When I was checking the documentation of the Raspberry Pi, I found that they recommend updating the kernel using "rpi-update".

However on Stack Exchange I also read that doing "sudo apt-get update" followed by "sudo apt-get upgrade" also updated the whole Raspbian installation, kernel and everything ?
After using this second method I indeed saw my Splash Screen indicating a more recent version at boot.

So what's the best and the difference between "rpi-update" and "sudo apt-get update" followed by "sudo apt-get upgrade" ? I also saw "sudo apt-get dist-upgrade" in the documentation but don't understand the difference with "upgrade" :/.
Thanks !
Nowadays rpi-update installs a Testing Kernel / Firmware and has not been recommended, unless under advisement, since Raspbian Jessie WS released in Sept 2015.

To update Raspbian Jessie with Pixel weekly, which includes any Kernel / Firmware, I undertake:

Code: Select all

sudo apt-get update
sudo apt-get dist-upgrade
https://linux.die.net/man/8/apt

Re: How do you update your Raspbian ?

Posted: Wed Apr 26, 2017 1:04 pm
by gets.chomp
Thanks guys !
What's the difference between "sudo apt-get upgrade" and "sudo apt-get dist-upgrade" though ?

Re: How do you update your Raspbian ?

Posted: Wed Apr 26, 2017 1:21 pm
by ShiftPlusOne
gets.chomp wrote: When I was checking the documentation of the Raspberry Pi, I found that they recommend updating the kernel using "rpi-update".
Where is that?

Re: How do you update your Raspbian ?

Posted: Wed Apr 26, 2017 1:30 pm
by fruitoftheloom
gets.chomp wrote:Thanks guys !
What's the difference between "sudo apt-get upgrade" and "sudo apt-get dist-upgrade" though ?
https://linux.die.net/man/8/apt-get

Re: How do you update your Raspbian ?

Posted: Wed Apr 26, 2017 2:15 pm
by gets.chomp
fruitoftheloom wrote:
gets.chomp wrote:Thanks guys !
What's the difference between "sudo apt-get upgrade" and "sudo apt-get dist-upgrade" though ?
https://linux.die.net/man/8/apt-get
Thanks.
Ok now I get it, cool site as well. However if I "mistakenly" used "upgrade" instead of "dist-upgrade" to make the first update of my Pi after a fresh install of Raspbian, is that a liability that could cause problems down the line ? Thanks !
ShiftPlusOne wrote:
gets.chomp wrote: When I was checking the documentation of the Raspberry Pi, I found that they recommend updating the kernel using "rpi-update".
Where is that?
https://www.raspberrypi.org/documentati ... pdating.md

Re: How do you update your Raspbian ?

Posted: Wed Apr 26, 2017 2:19 pm
by fruitoftheloom
You can also manually update the Rasperry Pi stock kernel, but this is not recommended.

So it is NOT recommended........

Re: How do you update your Raspbian ?

Posted: Wed Apr 26, 2017 2:45 pm
by jamesh
That page should really have a link back to the normal update procedure.

I'll fix that.

Re: How do you update your Raspbian ?

Posted: Wed Apr 26, 2017 2:49 pm
by gets.chomp
jamesh wrote:That page should really have a link back to the normal update procedure.

I'll fix that.
Thanks for taking feedback into account ! indeed for noobs it could clarify.

Re: How do you update your Raspbian ?

Posted: Wed Apr 26, 2017 2:52 pm
by W. H. Heydt
These days, I usually follow the update/(dist-)upgrade with "sudo apt-get clean" to remove any lingering, but unneded files.

Re: How do you update your Raspbian ?

Posted: Wed Apr 26, 2017 3:07 pm
by gets.chomp
If I "mistakenly" used "upgrade" instead of "dist-upgrade" to make the first update of my Pi after a fresh install of Raspbian, is that a liability that could cause problems down the line ? Thanks !

Re: How do you update your Raspbian ?

Posted: Wed Apr 26, 2017 3:51 pm
by fruitoftheloom
gets.chomp wrote:If I "mistakenly" used "upgrade" instead of "dist-upgrade" to make the first update of my Pi after a fresh install of Raspbian, is that a liability that could cause problems down the line ? Thanks !
Not at all....

Re: How do you update your Raspbian ?

Posted: Wed Apr 26, 2017 4:20 pm
by jamesh
gets.chomp wrote:
jamesh wrote:That page should really have a link back to the normal update procedure.

I'll fix that.
Thanks for taking feedback into account ! indeed for noobs it could clarify.
Draft version of change.

https://github.com/raspberrypi/document ... pdating.md

Re: How do you update your Raspbian ?

Posted: Wed Apr 26, 2017 4:27 pm
by PeterO
I would have opened with something that said there is no need to manually update the kernel as it happens automatically with the regular raspbian updates.

PeterO

Re: How do you update your Raspbian ?

Posted: Wed Apr 26, 2017 6:17 pm
by gets.chomp
Sorry guys but I come with a new question about something that puzzles me a bit.
Earlier today I did a sudo apt-get upgrade and it did download and install stuff.
Tonight, I ran sudo apt-get dist-upgrade following our previous discussion here, and it's also downloading and installing stuff, it seems even more than before.

Is that normal ?

Re: How do you update your Raspbian ?

Posted: Wed Apr 26, 2017 6:29 pm
by fruitoftheloom
gets.chomp wrote:Sorry guys but I come with a new question about something that puzzles me a bit.
Earlier today I did a sudo apt-get upgrade and it did download and install stuff.
Tonight, I ran sudo apt-get dist-upgrade following our previous discussion here, and it's also downloading and installing stuff, it seems even more than before.

Is that normal ?
Yes definitely as per: https://linux.die.net/man/8/apt-get

Re: How do you update your Raspbian ?

Posted: Wed Apr 26, 2017 7:10 pm
by rpdom
I'd add some warning about third-party kernels, like some of the special LCD drivers.

Re: How do you update your Raspbian ?

Posted: Wed Apr 26, 2017 7:38 pm
by The Monkey
sudo apt-get update also sudo apt-get upgrade OR sudo apt-get update && sudo apt-get upgrade.

Re: How do you update your Raspbian ?

Posted: Wed Apr 26, 2017 7:56 pm
by fruitoftheloom
The Monkey wrote:sudo apt-get update also sudo apt-get upgrade OR sudo apt-get update && sudo apt-get upgrade.
What is this in response to ? and who is it aimed at ? and the options have been discussed !!

Re: How do you update your Raspbian ?

Posted: Wed Apr 26, 2017 8:25 pm
by jamesh
PeterO wrote:I would have opened with something that said there is no need to manually update the kernel as it happens automatically with the regular raspbian updates.

PeterO
Good idea. Will put that in tomorrow. If I remember. Or you can send a PR based on the draft, I think.....

Re: How do you update your Raspbian ?

Posted: Wed Apr 26, 2017 9:42 pm
by DougieLawson
jamesh wrote:
PeterO wrote:I would have opened with something that said there is no need to manually update the kernel as it happens automatically with the regular raspbian updates.

PeterO
Good idea. Will put that in tomorrow. If I remember. Or you can send a PR based on the draft, I think.....
I thought you needed both raspberrypi-kernel and raspberrypi-bootloader packages to revert from an rpi-update.

Re: How do you update your Raspbian ?

Posted: Wed Apr 26, 2017 10:38 pm
by Rascas
W. H. Heydt wrote:These days, I usually follow the update/(dist-)upgrade with "sudo apt-get clean" to remove any lingering, but unneded files.
apt-get clean cleans all the apt packages cache, all the packages that were download since the OS installation. This is only normally done if there is the need to free up some space, because in production systems it might be usefull to get old packages versions available, mainly if a new one installed doesnt work well with some software, specially if the internet connection gets broken. Just my 2 cents ;)

Re: How do you update your Raspbian ?

Posted: Thu Apr 27, 2017 5:34 am
by rpdom
Rascas wrote:
W. H. Heydt wrote:These days, I usually follow the update/(dist-)upgrade with "sudo apt-get clean" to remove any lingering, but unneded files.
apt-get clean cleans all the apt packages cache, all the packages that were download since the OS installation. This is only normally done if there is the need to free up some space, because in production systems it might be usefull to get old packages versions available, mainly if a new one installed doesnt work well with some software, specially if the internet connection gets broken. Just my 2 cents ;)
That's what backups are for.

If running Debian the old versions will be available on the servers for year. Raspbian doesn't keep old versions as they can't justify the extra space that keeping all the old packages would need.

For 99.99% of users that package cache is just taking up space which could be needed for something else.

Re: How do you update your Raspbian ?

Posted: Thu Apr 27, 2017 6:22 am
by bensimmo
Here is the official one I know of
https://www.raspberrypi.org/documentati ... pdating.md

It should be noted that I now just use apt instead of apt-get because it's slightly easier to follow what's happening on screen. (Much nicer for beginners and teachers as you see progress)
Also it's used in places around RaspberryPi documentation iirc, perhaps have these link to the update procedure now?

However it doesn't matter as long as it's consistent.

As a side, you should mention 'autoclean' as it will be mentioned to the user while updating at some point.

Maybe also an ipv6 error note for when ipv6 connections are blocked at some point and it borks the update procedure as it doesn't rollover to another IP address. I know is its regular under our school setup (probably the nanny) and i know others that have seen it.
(Just ctrl-c and repeat until they all come from good old ipv4)