fjr
Posts: 102
Joined: Thu Aug 15, 2013 8:18 pm

difference between sudo apt-get update and upgrade?

Sat Jan 21, 2017 3:44 pm

raspbian pixel
What is the difference between sudo apt-get update and sudo apt-get upgrade?

User avatar
DougieLawson
Posts: 38883
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: difference between sudo apt-get update and upgrade?

Sat Jan 21, 2017 3:50 pm

Update updates the apt-get meta data. Upgrade uses that meta data to update packages on the system.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

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

Re: difference between sudo apt-get update and upgrade?

Sat Jan 21, 2017 6:04 pm

fjr wrote:raspbian pixel
What is the difference between sudo apt-get update and sudo apt-get upgrade?
https://linux.die.net/man/8/apt-get
Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot)..
Asus ChromeBox 3 Celeron is my other computer...

KMyers
Posts: 35
Joined: Fri Nov 09, 2012 9:46 pm

Re: difference between sudo apt-get update and upgrade?

Sat Jan 21, 2017 6:48 pm

Sorry dont want to hijack this thread, :roll:

How often should one do this?

Thanks!
Ken

Sam Miracle
Posts: 16
Joined: Tue Jul 26, 2016 12:56 am
Location: Somewhere

Re: difference between sudo apt-get update and upgrade?

Sat Jan 21, 2017 7:52 pm

sudo apt-get update downloads the update, sudo apt-get upgrade installs the update. It is a good idea to do a sudo-reboot after updating too.
I am a programmer from (insert city here) who likes Raspberry Pi, Minecraft, Relient K, and biking.

User avatar
DougieLawson
Posts: 38883
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: difference between sudo apt-get update and upgrade?

Sat Jan 21, 2017 8:21 pm

KMyers wrote:Sorry dont want to hijack this thread, :roll:

How often should one do this?

Thanks!
Ken
If it's running as an internet server you MUST do it at least once a week possibly more frequently.

If it's just a client machine do it once a month.

All of my Raspberries have

Code: Select all

root@eagle /etc/apt/apt.conf.d # cat 02periodic
APT::Periodic::Enable "1";
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "7";
APT::Periodic::MaxAge "5";
APT::Periodic::MinAge "2";
APT::Periodic::Verbose "0";
root@eagle /etc/apt/apt.conf.d #
That /etc/apt/apt.conf.d/02periodic file means every day any new packages get downloaded, so there's no delay when I run my weekly dist-updates.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

mattmiller
Posts: 2236
Joined: Thu Feb 05, 2015 11:25 pm

Re: difference between sudo apt-get update and upgrade?

Sat Jan 21, 2017 11:43 pm

sudo apt-get update downloads the update, sudo apt-get upgrade installs the update
No - not really - its not quite as straightforward as that
read link that fruitofloom posted

linxuser8671
Posts: 30
Joined: Thu Oct 13, 2016 6:22 pm

Re: difference between sudo apt-get update and upgrade?

Sun Jan 22, 2017 7:14 am

sudo apt-get update downloads the update, sudo apt-get upgrade installs the update
sudo apt-get update -------------- updates the OS ( i do this whenever i am missing packages [and/or once a week or so, its good habit])

sudo apt-get upgrade ----------- upgrades the OS ( i rarely do this but should probably more)

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

Re: difference between sudo apt-get update and upgrade?

Sun Jan 22, 2017 7:36 am

linxuser8671 wrote:
sudo apt-get update downloads the update, sudo apt-get upgrade installs the update
sudo apt-get update -------------- updates the OS ( i do this whenever i am missing packages [and/or once a week or so, its good habit])

sudo apt-get upgrade ----------- upgrades the OS ( i rarely do this but should probably more)
The first two replies to this query answered it concisely and accurately. A recursive reply that says that update updates adds nothing to the discussion.

mfa298
Posts: 1387
Joined: Tue Apr 22, 2014 11:18 am

Re: difference between sudo apt-get update and upgrade?

Sun Jan 22, 2017 7:52 am

linxuser8671 wrote:
sudo apt-get update downloads the update, sudo apt-get upgrade installs the update
sudo apt-get update -------------- updates the OS ( i do this whenever i am missing packages [and/or once a week or so, its good habit])

sudo apt-get upgrade ----------- upgrades the OS ( i rarely do this but should probably more)
It doesn't work like that, Read the first response from Dougie.

apt-get update only updates the list of packages your system knows about, i.e. means it knows that the updates exist. It makes no changes to the installed packages i.e. nothing gets installed directly from that command.

apt-get upgrade will download those updated packages and install them (additionally dist-upgrade will do the same but will also install updates where new packages are required for dependencies - Most of the time there's no difference between upgrade and dist-upgrade)

User avatar
DougieLawson
Posts: 38883
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: difference between sudo apt-get update and upgrade?

Sun Jan 22, 2017 9:57 am

linxuser8671 wrote: sudo apt-get update -------------- updates the OS [sic] ( i do this whenever i am missing packages [and/or once a week or so, its good habit])
No it does not. It updates the packages meta data used by apt-get for other operations.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

jahboater
Posts: 5680
Joined: Wed Feb 04, 2015 6:38 pm
Location: West Dorset

Re: difference between sudo apt-get update and upgrade?

Sun Jan 22, 2017 11:09 am

Try "apt" instead of "apt-get".
Apart from being less to type, you get notified if anything needs an upgrade:-

Code: Select all

pi@raspberrypi:~ $ sudo apt update
................      
Fetched 9264 kB in 18s (509 kB/s)                                                                  
Reading package lists... Done
Building dependency tree       
Reading state information... Done
2 packages can be upgraded. Run 'apt list --upgradable' to see them.
pi@raspberrypi:~ $ sudo apt upgrade -y

KMyers
Posts: 35
Joined: Fri Nov 09, 2012 9:46 pm

Re: difference between sudo apt-get update and upgrade?

Sun Jan 22, 2017 5:28 pm

Thanks for info Dougie, I have been running this every couple days, Do have VNC and trying to get MQTT running,

Back to regularly scheduled conversation, sorry for interruption. :D

User avatar
DougieLawson
Posts: 38883
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: difference between sudo apt-get update and upgrade?

Sun Jan 22, 2017 5:33 pm

To get Mosquitto running you have to jump through some apt-get hoops (that gets you v1.4.10).
http://mosquitto.org/2013/01/mosquitto- ... epository/

If you just go with the plain Raspbian version you get a buggy ancient version of it.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

KMyers
Posts: 35
Joined: Fri Nov 09, 2012 9:46 pm

Re: difference between sudo apt-get update and upgrade?

Sun Jan 22, 2017 5:42 pm

Yes I have a printout of your instructions here on my ext drive. I would like to get it to display graphs of my sensor network like Adafruit does. Any suggestions or shou;d I start a new thread on this?

Ken

User avatar
DougieLawson
Posts: 38883
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: difference between sudo apt-get update and upgrade?

Sun Jan 22, 2017 5:46 pm

KMyers wrote:Yes I have a printout of your instructions here on my ext drive. I would like to get it to display graphs of my sensor network like Adafruit does. Any suggestions or shou;d I start a new thread on this?

Ken
Start a new thread.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “Beginners”