gets.chomp
Posts: 67
Joined: Thu Feb 16, 2017 10:25 am

How do you update your Raspbian ?

Wed Apr 26, 2017 12:53 pm

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 !

User avatar
RaTTuS
Posts: 10498
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: How do you update your Raspbian ?

Wed Apr 26, 2017 12:57 pm

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
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

fruitoftheloom
Posts: 21067
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: How do you update your Raspbian ?

Wed Apr 26, 2017 1:01 pm

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
Retired disgracefully.....
This at present is my daily "computer" https://www.asus.com/us/Chrome-Devices/Chromebit-CS10/

gets.chomp
Posts: 67
Joined: Thu Feb 16, 2017 10:25 am

Re: How do you update your Raspbian ?

Wed Apr 26, 2017 1:04 pm

Thanks guys !
What's the difference between "sudo apt-get upgrade" and "sudo apt-get dist-upgrade" though ?

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6074
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: How do you update your Raspbian ?

Wed Apr 26, 2017 1:21 pm

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?

fruitoftheloom
Posts: 21067
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: How do you update your Raspbian ?

Wed Apr 26, 2017 1:30 pm

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
Retired disgracefully.....
This at present is my daily "computer" https://www.asus.com/us/Chrome-Devices/Chromebit-CS10/

gets.chomp
Posts: 67
Joined: Thu Feb 16, 2017 10:25 am

Re: How do you update your Raspbian ?

Wed Apr 26, 2017 2:15 pm

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

fruitoftheloom
Posts: 21067
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: How do you update your Raspbian ?

Wed Apr 26, 2017 2:19 pm

You can also manually update the Rasperry Pi stock kernel, but this is not recommended.

So it is NOT recommended........
Retired disgracefully.....
This at present is my daily "computer" https://www.asus.com/us/Chrome-Devices/Chromebit-CS10/

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24133
Joined: Sat Jul 30, 2011 7:41 pm

Re: How do you update your Raspbian ?

Wed Apr 26, 2017 2:45 pm

That page should really have a link back to the normal update procedure.

I'll fix that.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

gets.chomp
Posts: 67
Joined: Thu Feb 16, 2017 10:25 am

Re: How do you update your Raspbian ?

Wed Apr 26, 2017 2:49 pm

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.

W. H. Heydt
Posts: 11070
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: How do you update your Raspbian ?

Wed Apr 26, 2017 2:52 pm

These days, I usually follow the update/(dist-)upgrade with "sudo apt-get clean" to remove any lingering, but unneded files.

gets.chomp
Posts: 67
Joined: Thu Feb 16, 2017 10:25 am

Re: How do you update your Raspbian ?

Wed Apr 26, 2017 3:07 pm

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 !

fruitoftheloom
Posts: 21067
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: How do you update your Raspbian ?

Wed Apr 26, 2017 3:51 pm

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....
Retired disgracefully.....
This at present is my daily "computer" https://www.asus.com/us/Chrome-Devices/Chromebit-CS10/

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24133
Joined: Sat Jul 30, 2011 7:41 pm

Re: How do you update your Raspbian ?

Wed Apr 26, 2017 4:20 pm

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
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

User avatar
PeterO
Posts: 5134
Joined: Sun Jul 22, 2012 4:14 pm

Re: How do you update your Raspbian ?

Wed Apr 26, 2017 4:27 pm

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
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

gets.chomp
Posts: 67
Joined: Thu Feb 16, 2017 10:25 am

Re: How do you update your Raspbian ?

Wed Apr 26, 2017 6:17 pm

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 ?

fruitoftheloom
Posts: 21067
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: How do you update your Raspbian ?

Wed Apr 26, 2017 6:29 pm

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
Retired disgracefully.....
This at present is my daily "computer" https://www.asus.com/us/Chrome-Devices/Chromebit-CS10/

User avatar
rpdom
Posts: 15577
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: How do you update your Raspbian ?

Wed Apr 26, 2017 7:10 pm

I'd add some warning about third-party kernels, like some of the special LCD drivers.

User avatar
The Monkey
Posts: 25
Joined: Sun Mar 26, 2017 9:55 pm
Contact: Website

Re: How do you update your Raspbian ?

Wed Apr 26, 2017 7:38 pm

sudo apt-get update also sudo apt-get upgrade OR sudo apt-get update && sudo apt-get upgrade.

fruitoftheloom
Posts: 21067
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: How do you update your Raspbian ?

Wed Apr 26, 2017 7:56 pm

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 !!
Retired disgracefully.....
This at present is my daily "computer" https://www.asus.com/us/Chrome-Devices/Chromebit-CS10/

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24133
Joined: Sat Jul 30, 2011 7:41 pm

Re: How do you update your Raspbian ?

Wed Apr 26, 2017 8:25 pm

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.....
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

User avatar
DougieLawson
Posts: 36544
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: How do you update your Raspbian ?

Wed Apr 26, 2017 9:42 pm

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.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Rascas
Posts: 563
Joined: Tue Mar 11, 2014 6:18 pm
Location: Porto, Portugal
Contact: Website

Re: How do you update your Raspbian ?

Wed Apr 26, 2017 10:38 pm

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 ;)

User avatar
rpdom
Posts: 15577
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: How do you update your Raspbian ?

Thu Apr 27, 2017 5:34 am

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.

User avatar
bensimmo
Posts: 4187
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: How do you update your Raspbian ?

Thu Apr 27, 2017 6:22 am

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)

Return to “Beginners”