zalion0
Posts: 18
Joined: Tue Jan 15, 2013 11:41 pm

upgrade vs update

Thu Jan 17, 2013 11:16 am

Just a quick question, whats the difference between apt-get upgrade and apt-get update? :lol:

User avatar
RaTTuS
Posts: 10406
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: upgrade vs update

Thu Jan 17, 2013 11:25 am

update updates the list of servers that can be used
upgrade upgrades the packages
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

thsBavR10
Posts: 233
Joined: Sat Jul 21, 2012 3:11 pm

Re: upgrade vs update

Thu Jan 17, 2013 11:26 am

there's no difference, just one after another:
- update does synchronice sources (/etc/apt/sources.list) to local package index
- upgrade fetches the new version of installed packages
- dist-upgrade adds inteligent handling od dependencies
(see man apt-get)

Code: Select all

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

-rst-
Posts: 1316
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland

Re: upgrade vs update

Tue Jan 29, 2013 4:05 pm

Afaik, if you will run dist-upgrade, there is no need to run upgrade first:

"In addition to performing the function of upgrade, this option also intelligently handles changing dependencies..." (http://linux.die.net/man/8/apt-get)

So there are two options:

Code: Select all

sudo apt get update && sudo apt-get upgrade
and

Code: Select all

sudo apt get update && sudo apt-get dist-upgrade
(that '&&' means 'run the first command until end and if succesful, run the second)

The update is required to be run always: "An update must be performed first so that apt-get knows that new versions of packages are available." (same)
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'

Return to “Beginners”