lerner
Posts: 510
Joined: Sun Mar 29, 2015 12:12 am

Need help with "updating" and what command does what.

Fri Oct 20, 2017 8:56 pm

I'm gonna ask now because it seems I had/have it wrong.

The story is going to be a bit weak, as it happened a long time ago and I don't really remember the specifics.
Though it could be said they are important - and I agree in some cases - but for the sake of explaining, they aren't.

Originally I started with Wheezy. It was an early RPI and it did.

Then I got the newer version and installed ....... (what ever was before Jessie)

I didn't want to update/upgrade to Jessie, but things as they are/were I was forced to.

No big. It all works.

But it has since raised some questions about HOW you get to the latest version and what the commands mean.

The 4 causing me the most grief are:

Code: Select all

sudo apt-get update
sudo apt-get upgrade
sudo rpi update
sudo apt-get dist-upgrade
Now, I may have even got the commands "wrong" but when I enter them, things happen.

I've tried to research what each does, but it seems "typical of linux" that there are loops in references and they point back to one another and so to me this creates a loop.

So my take:
apt-get update: This updates a "list" (somewhere on the computer) to what is available and what is installed.
apt-get upgrade: This brings things "up to date" with what is available and what is shown as installed. But it only does SOME of the system.
apt-get dist-upgrade: To me that is the same as the previous one....... But it has to be different, as either with this or the one still not mentioned, the machine goes through a BIG update of stuff I just don't get.
rpi-update: This is a big one which updates the O/S to the latest - right? Probably not.

But I'm not having any luck getting clear definitions of what command does what.

I was sure I updated from Jessie to Strech, but as recent events have shown: I'm still on Jessie.

That's weird in that when I did afore mentioned commands, a few settings were changed, and options changed in the O/S.
I had to reset my picture - big deal, but worth mentioning - and some of the "desktop"(?) menus have changed.

I didn't sweat on it too much. There isn't any point. If the O/S has changed, that's that.

Would someone mind helping me get a clearer picture of what each command does?

Thanks in advance.

User avatar
davidcoton
Posts: 4898
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK
Contact: Website

Re: Need help with "updating" and what command does what.

Fri Oct 20, 2017 9:14 pm

  • apt update -- updates the catalogues of available software to determiine what needs upgrading
  • apt upgrade -- downloads and installs software that update marked for upgrade
  • apt dist-upgrade -- as upgrade, but does a more thorough job of checking and updating dependencies.
  • rpi-update -- Installs the latest EXPERIMENTAL updates specifically for the Pi. May break your system, badly. Use only if you believe it will solve a specific problem, and can clean up if it doesn't.
None of the above will do version upgrades (Wheezy -> Jessie -> Stretch). It is recommended to re-install to achieve this. There is an UNSUPPORTED way to upgrade across versions by editing the source lists used by apt.
Note apt has superceded apt-get (and some other apt- commands) for command line use. apt-get is retained to avoid breaking scripts, but apt functionality is tuned for interactive use.
Signature retired

User avatar
HawaiianPi
Posts: 5702
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Need help with "updating" and what command does what.

Fri Oct 20, 2017 9:29 pm

lerner wrote:
Fri Oct 20, 2017 8:56 pm
...
The 4 causing me the most grief are:

Code: Select all

sudo apt-get update
sudo apt-get upgrade
sudo rpi update
sudo apt-get dist-upgrade
So my take:
apt-get update: This updates a "list" (somewhere on the computer) to what is available and what is installed.
Sort of. It reads the most current list of packages available in the repositories so that the OS will know if there are any newer versions available.
lerner wrote:
Fri Oct 20, 2017 8:56 pm
apt-get upgrade: This brings things "up to date" with what is available and what is shown as installed. But it only does SOME of the system.
It upgrades only packages that are currently installed to their latest versions.
lerner wrote:
Fri Oct 20, 2017 8:56 pm
apt-get dist-upgrade: To me that is the same as the previous one....... But it has to be different, as either with this or the one still not mentioned, the machine goes through a BIG update of stuff I just don't get.
This will upgrade the OS in a similar fashion to above, but it will also replace packages with something else if the devs have decided to use something different. 90% of the time upgrade and dist-upgrade do exactly the same thing, but if you want the most complete upgrade, use dist-upgrade.
lerner wrote:
Fri Oct 20, 2017 8:56 pm
rpi-update: This is a big one which updates the O/S to the latest - right? Probably not.
Nope. This loads experimental firmware that is currently in testing. Most people should NEVER use rpi-update unless specifically instructed to do so by the Raspbian developers or support team. If you want the latest bleeding-edge features (like high quality audio, which is currently in testing), then rpi-update will give you that, HOWEVER, the firmware installed by rpi-update may be buggy and unstable, so use with caution (and make backups first).
lerner wrote:
Fri Oct 20, 2017 8:56 pm
I was sure I updated from Jessie to Strech, but as recent events have shown: I'm still on Jessie.
None of the above will upgrade from one version (Jessie) to another (Stretch). To do that you have to change the repositories the OS is using, and upgrades from one version to another are not recommended. If you want to go to a newer version, the recommended way is to start fresh with a clean install. Of course you are free to follow that recommendation or not, and there are people who do switch repositories and upgrade (with varying success).
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

lerner
Posts: 510
Joined: Sun Mar 29, 2015 12:12 am

Re: Need help with "updating" and what command does what.

Fri Oct 20, 2017 9:37 pm

David: Thanks very much.

So now another "dumb question":

I have my machine running - happily - and is on Jessie.

Strech comes along and I need to update.

How do I do that without having to re-build the machine? As I am getting it, I need to download the new image and install it.

Obviously that won't include all the stuff I have installed since.

So I must be missing something.

(Shall try to remember to use apt in the future. Just I guess when I was told it was apt-get. Actually aptitude was also mentioned, but we won't go there! <smile> )


HawaiianPi,

Thanks too.

So you seem to have confirmed that if I start on Jessie and get a machine "just so" as I like it and Strech comes along. To go to Strech, I need to start with a clean install and install all the stuff again.

Sounds like fun.

And I guess I should therefore NOT use rpi-update in the future. It could break things.
Which is probably why I have so many yaks to shave at this point.

User avatar
HawaiianPi
Posts: 5702
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Need help with "updating" and what command does what.

Fri Oct 20, 2017 9:47 pm

lerner wrote:
Fri Oct 20, 2017 9:37 pm
... Strech comes along and I need to update.
Why?

Jessie will still be supported for several years, so unless you have a compelling reason to upgrade, it's not absolutely necessary. Jessie has full Debian support until June of 2018, and then long term support until June in 2020.
Last edited by HawaiianPi on Fri Oct 20, 2017 9:58 pm, edited 2 times in total.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

lerner
Posts: 510
Joined: Sun Mar 29, 2015 12:12 am

Re: Need help with "updating" and what command does what.

Fri Oct 20, 2017 9:57 pm

Then it was Jessie's predecessor which was at "end of life" and so I needed to update to Jessie. But then - to me - as soon as I blinked, Strech came along.....

So I just reflected that what just happened - updating to Jessie - will happen again with updating to Strech.

My bad.

gkaiseril
Posts: 679
Joined: Mon Aug 08, 2016 9:27 pm
Location: Chicago, IL

Re: Need help with "updating" and what command does what.

Fri Oct 20, 2017 10:01 pm

Have you read the documentation Updating Raspbian?

You can change the repositories used for the upgrade and dist-upgrade and then run the "apt-get dist-upgrade" command but you would only be updating the current packages that are part of Jessie but you would not get the newer packages of stretch like the sense hat extensions and the new python development environment.

You would be better off starting with a new SD card and burning the new OS and then adding the packages that you installed, add the users that you added and copying their directories from the old SD card to the new SD card. You can see the packages that you installed using aptitude or synaptic.
f u cn rd ths, u cn gt a gd jb n cmptr prgrmmng.

User avatar
HawaiianPi
Posts: 5702
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Need help with "updating" and what command does what.

Fri Oct 20, 2017 10:07 pm

Wheezy is end of life with long term support officially ending in May of 2018, so if you have any Wheezy systems you should be thinking about upgrading them soon. With Jessie you still have plenty of time.
lerner wrote:
Fri Oct 20, 2017 9:37 pm
And I guess I should therefore NOT use rpi-update in the future. It could break things.
Which is probably why I have so many yaks to shave at this point.
I have often run with the testing branch of various Linux distros, and problems are usually few and far between, so the warnings are often more dire than the reality. If you are not comfortable with testing and adept at troubleshooting then staying with the release firmware is always the safe bet. Once new features have been thoroughly tested they become available through the normal update process. For example, USB booting with the Pi3 used to only be available with the testing firmware, but now it's part of the standard release.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

lerner
Posts: 510
Joined: Sun Mar 29, 2015 12:12 am

Re: Need help with "updating" and what command does what.

Fri Oct 20, 2017 10:29 pm

HawaiianPi,

Seems I have shot myself in the foot then with two machines. :(

1 - WAP not working now.
2 - NFS not working.

However, the NFS is working on the one which can't get the WAP working.
I haven't tried the WAP on the one which NFS isn't working, but there is no need at this time.
Only to say that that one has these mysterious /var/run/wpa_supplicant....... file/directory.

BUT! (don't you just love them)

on the TimePi, it has both NFS and WAP running, but doesn't have the /var/run/wpa_supplicant..... stuff.

Same level OS.

So I think I need to do more study.
(Or rebuild them..... But that is going to be painful. I shall have to weigh the costs.)

gkaiseril:
Honestly: I'm not sure. Probably not - I'm guessing.

I may have looked at it but I am so ....... (dunno the word) It is just confusing for me.
You may see I have a few questions going on just now, and all because of something which probably shouldn't have happened.

It gets a bit much to remember it all.

lerner
Posts: 510
Joined: Sun Mar 29, 2015 12:12 am

Re: Need help with "updating" and what command does what.

Fri Oct 20, 2017 10:41 pm

Sorry, more thinking:


From the first reply:
apt dist-upgrade -- as upgrade, but does a more thorough job of checking and updating dependencies.
Ok, here's another thing that has me stumped:
(Given alias sysinfo='cat /sys/firmware/devicetree/base/model;echo "";echo"";cat /etc/os-release;echo "";cat /etc/rpi-issue' )

This machine:

Code: Select all

pi@PIFACE:~ $ sysinfo
Raspberry Pi 2 Model B Rev 1.1

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"

Raspberry Pi reference [b][u]2015-11-21[/u][/b]
Generated using Pi-gen, https://github.com/RPi-Distro/Pi-gen, jessie-stage4
pi@PIFACE:~ $ 
Time Machine:

Code: Select all

pi@TimePi:~ $ sysinfo
Raspberry Pi Model B Rev 2

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"

Raspberry Pi reference [b][u]2017-01-11[/u][/b]
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 21a681692ac70e77d3ebe1dd2a76b31de1a72d89, stage4
pi@TimePi:~ $ 
Music Machine:

Code: Select all

pi@MusicPi:~ $ sysinfo
Raspberry Pi 3 Model B Rev 1.2

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"

Raspberry Pi reference [b][u]2017-01-11[/u][/b]
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 21a681692ac70e77d3ebe1dd2a76b31de1a72d89, stage4
pi@MusicPi:~ $
Portable:

Code: Select all

pi@PortaPi:~ $ sysinfo
Raspberry Pi 3 Model B Rev 1.2

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"

Raspberry Pi reference [b][u]2017-01-11[/u][/b]
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 21a681692ac70e77d3ebe1dd2a76b31de1a72d89, stage4
pi@PortaPi:~ $ 




If I have done dist-upgrades on ALL of them RECENTLY, why the big difference in dates (look at PIFACE date)?

They are all running Jessie.

steveb4pi
Posts: 62
Joined: Sun Aug 11, 2013 6:12 pm

Re: Need help with "updating" and what command does what.

Sat Oct 21, 2017 9:01 am

I've been in the computer industry long enough to have learnt one (or maybe two) vital lessons ..

IF IT AIN'T BROKE DON'T FIX IT

This really should be obvious == once you have your system working, make a back-up so you can get back to that exact same working system (when something hardware fails) and then LEAVE IT ALONE.

STICK WITH KNOWN WORKING SYSTEM SOFTWARE

When starting a new project, start at the begginging -- i.e. go download the latest and greatest distro, 'burn' a new SD card ..... and work with that, and not some combination of original plus 'todays' updates that will be impossible to replicate 'tomorrow' (or the day after) as the contents of the update/upgrade 'repositories' are changing all the time ...

Return to “Beginners”