Diggory
Posts: 3
Joined: Wed Jul 18, 2018 4:42 pm

apt-get dist-upgrade vs flash with new version of OS

Wed Jul 18, 2018 4:54 pm

Hi, sorry - newbie Linux question here... (I'm used to MacOS).

If one had a fresh install of Raspian Jessie and ran

Code: Select all

apt-get dist-upgrade
is that roughly equivalent to wiping the SD card and flashing a recent image of Raspian Stretch?

On a Mac, you can upgrade the OS to the latest version by installing over the existing version and you get to keep your files. I get the feeling that isn't the case with Raspian - is that true?

e.g. I recently

Code: Select all

dist-upgraded
an install of Jessie, and the kernel was updated to the same version as Stretch:

Code: Select all

uname -a
Linux piLowProfile 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux
But the OS still seems to think that it's Jessie:

Code: Select all

cat /etc/*-release
PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
So - does dist-upgrade not do what I think it does? In order to get the full benefit, does one need to wipe the install and start from a fresh install of the new version of the OS?

Thanks.

User avatar
B.Goode
Posts: 8021
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: apt-get dist-upgrade vs flash with new version of OS

Wed Jul 18, 2018 5:46 pm

Welcome to the Raspberry Pi forums.
If one had a fresh install of Raspian Jessie and ran

apt-get dist-upgrade
is that roughly equivalent to wiping the SD card and flashing a recent image of Raspian Stretch?
No.

Not even 'roughly'.

The former leaves you with a Raspbian Jessie Operating System, clearly the latter installs the more recent Raspbian Stretch version of the Operating System.

So - does dist-upgrade not do what I think it does?

To be certain, you will need to spell out what you think it does....

(But it seems likely that your expectation is incorrect, as your experience indicates.)


Edit: added - although they advise against doing it, the process for converting a Raspbian Jessie Operating System into one based on Raspbian Stretch was documented by the Raspberry Pi Foundation in the blog post on their own website in the Announcement of the release of Raspbian Stretch in mid-August 2017.
Last edited by B.Goode on Wed Jul 18, 2018 5:55 pm, edited 1 time in total.

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

Re: apt-get dist-upgrade vs flash with new version of OS

Wed Jul 18, 2018 5:53 pm

Diggory wrote:
Wed Jul 18, 2018 4:54 pm
Hi, sorry - newbie Linux question here... (I'm used to MacOS).

If one had a fresh install of Raspian Jessie and ran

Code: Select all

apt-get dist-upgrade
is that roughly equivalent to wiping the SD card and flashing a recent image of Raspian Stretch?

On a Mac, you can upgrade the OS to the latest version by installing over the existing version and you get to keep your files. I get the feeling that isn't the case with Raspian - is that true?

e.g. I recently

Code: Select all

dist-upgraded
an install of Jessie, and the kernel was updated to the same version as Stretch:

Code: Select all

uname -a
Linux piLowProfile 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux
But the OS still seems to think that it's Jessie:

Code: Select all

cat /etc/*-release
PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
So - does dist-upgrade not do what I think it does? In order to get the full benefit, does one need to wipe the install and start from a fresh install of the new version of the OS?

Thanks.

Raspbian Jessie

Code: Select all

sudo apt-get update
sudo apt-get dist-upgrade

Will still be Jessie

https://linux.die.net/man/8/apt-get


If you wish to go from Jessie to Stretch it is more complicated and not recommended:

https://www.raspberrypi.org/blog/raspbian-stretch/
adieu

Asus CS10 Chromebit / HP Envy 4500 Wireless Printer / Raspberry Pi Model 2B v1.1 / RealVNC Software...

il_diavolo
Posts: 134
Joined: Mon Dec 02, 2013 7:56 pm

Re: apt-get dist-upgrade vs flash with new version of OS

Wed Jul 18, 2018 9:51 pm

If you wish to go from Jessie to Stretch it is more complicated and not recommended:
I did this quite successfully (even the "two fingers" mod for the Florence virtual keyboard was carried over without problems) so it's well worth a try on a backed-up copy of your Jessie installation.

Diggory
Posts: 3
Joined: Wed Jul 18, 2018 4:42 pm

Re: apt-get dist-upgrade vs flash with new version of OS

Wed Jul 18, 2018 11:25 pm

Thanks very much for your informative replies.

One last question: so, what tends to be the ongoing strategy for keeping one's OS up to date on release of a new binary distribution of Raspian: (roughly every three months)?

1) - Nuke the old instance and install afresh, re-instating custom software and user data from a backup/scripts.

2) - Don't bother with every new OS version as it's not necessary - keeping the packages up to date via 'apt' should be OK for security - only update the whole distribution infrequently - say every two years with a new LTS release. (like option 1, but less frequent.)

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

Re: apt-get dist-upgrade vs flash with new version of OS

Wed Jul 18, 2018 11:32 pm

New Raspbian versions arrive about every two years. There's usually a direct upgrade path (by editing files in /etc/apt to change from Wheezy to Jessie, Jessie to Stretch (and next time from Stretch to Buster)).

In between times there's regular modification levels of the existing Raspbian version, that includes software fixes, changes to the RPF software pieces and security fixes. You should look at picking those up on a monthly basis (or weekly if your RPi is serving things out to the public internet (with port forwarding)).

There's a level of juggling/cat herding needed to decide how often that stuff needs to be done depending what you're using your RPi to run (and how critical that is). 13 out of 15 of my Raspberries get a new kernel every week when it's released by the RPF folks. All of them get an apt-get update as soon as I spot something that's changed. But, that's not a recommendation, I can rebuild a broken system in twenty minutes and I'm willing to work on the leading edge with software that may not work.
Note: Having anything remotely humorous in your signature is completely banned on this forum. Wear a tinfoil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Diggory
Posts: 3
Joined: Wed Jul 18, 2018 4:42 pm

Re: apt-get dist-upgrade vs flash with new version of OS

Wed Jul 18, 2018 11:41 pm

Thanks Dougie - I clearly need to learn much more about the layered nature of Linux s/w updates. I tend to think of OS updates as monolithic.

Lots of learning to do....

Return to “Raspbian”