LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 10-07-2005, 04:01 PM   #1
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,902

Rep: Reputation: 73
Update -vs Upgrade


My normal procedure for using apt everyday is to just run the "update" command before I do anything but I really would like to know how this command differs from the #apt-get upgrade command.

Can someone please explain for me?

Thanks!
 
Old 10-07-2005, 04:27 PM   #2
Moloko
Member
 
Registered: Mar 2004
Location: Netherlands
Distribution: Debian
Posts: 729

Rep: Reputation: 30
"update" updates the package list with any newly available packages from the mirrors and "upgrade" executes the actual upgrading of packages. That's it.
 
Old 10-27-2011, 12:28 PM   #3
LinusStallman
Member
 
Registered: Mar 2010
Location: Ireland
Distribution: Linux Mint 17 MATE
Posts: 275

Rep: Reputation: 14
Taken from http://www.linuxnix.com/2011/02/diff...-commands.html

#apt-get update

Is the command to update the source list, if you modify the source list or you want to make a sync refresh or added new ppa source then you should execute above command.

Where as

#apt-get upgrade

Command will try to download all the packages which are having updates at apt server and then try to install them if you press y. This something like System upgrade to new packages.
 
Old 10-27-2011, 09:07 PM   #4
frankbell
Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Mageia, Mint
Posts: 7,932

Rep: Reputation: 1495Reputation: 1495Reputation: 1495Reputation: 1495Reputation: 1495Reputation: 1495Reputation: 1495Reputation: 1495Reputation: 1495Reputation: 1495
I commonly run
  1. apt-get upgrade
  2. apt-get autoclean
  3. apt-get update

I don't have a good reason except that it seems to follow what Synaptic does: install the updates, clean up afterwards, and refresh the package list.

The command for a version upgrade is apt-get dist-upgrade.
 
Old 10-27-2011, 10:02 PM   #5
62chevy
Member
 
Registered: Mar 2002
Location: West (By God) Virginia
Distribution: Debian Squeeze - Sid
Posts: 281

Rep: Reputation: 44
Quote:
Originally Posted by frankbell View Post
I commonly run
  1. apt-get upgrade
  2. apt-get autoclean
  3. apt-get update

I don't have a good reason except that it seems to follow what Synaptic does: install the updates, clean up afterwards, and refresh the package list.

The command for a version upgrade is apt-get dist-upgrade.

It should be:

update
upgrade
autoclean

Other wise you install the updates from yesterday or the last time you ran update. Of course your way will work you will just be a day behind.
 
Old 10-28-2011, 01:32 AM   #6
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1949Reputation: 1949Reputation: 1949Reputation: 1949Reputation: 1949Reputation: 1949Reputation: 1949Reputation: 1949Reputation: 1949Reputation: 1949Reputation: 1949
update just installs new versions of the packages on your system, taking dependencies into account of course.

upgrade moves your base system up to the most recent version of the distribution, doing whatever it takes to make it compliant. Unlike update, it will remove packages if necessary (including even "important" things like kde, gnome or xorg ).

Since upgrade can lead to radical changes in your system, you should only use it when you need to bring your entire system up-to-date, generally after a major version release. For regular use, use update.

Last edited by David the H.; 10-28-2011 at 01:34 AM.
 
1 members found this post helpful.
Old 10-28-2011, 02:51 AM   #7
evo2
Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,434

Rep: Reputation: 1192Reputation: 1192Reputation: 1192Reputation: 1192Reputation: 1192Reputation: 1192Reputation: 1192Reputation: 1192Reputation: 1192
Hi,

I think you may be confusing the difference between upgrade and dist-upgrade not update and upgrade.
Quote:
Originally Posted by David the H. View Post
update just installs new versions of the packages on your system, taking dependencies into account of course.
From the apt-get man page:
Quote:
update is used to resynchronize the package index files from their sources.
Quote:
Originally Posted by David the H. View Post
upgrade moves your base system up to the most recent version of the distribution, doing whatever it takes to make it compliant. Unlike update, it will remove packages if necessary (including even "important" things like kde, gnome or xorg ).
Sounds like a description of dist-upgrade or full-upgrade.

Cheers,

Evo2.
 
Old 10-28-2011, 03:14 AM   #8
k3lt01
Senior Member
 
Registered: Feb 2011
Location: Australia
Distribution: Debian Wheezy, Jessie, Sid/Experimental, playing with LFS.
Posts: 2,759

Rep: Reputation: 576Reputation: 576Reputation: 576Reputation: 576Reputation: 576Reputation: 576
Has anyone noticed that there is slightly over 6 years between the first 2 posts and then everything else?
 
Old 10-28-2011, 06:18 AM   #9
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,592
Blog Entries: 2

Rep: Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047
Quote:
Originally Posted by David the H. View Post
update just installs new versions of the packages on your system, taking dependencies into account of course.

upgrade moves your base system up to the most recent version of the distribution, doing whatever it takes to make it compliant. Unlike update, it will remove packages if necessary (including even "important" things like kde, gnome or xorg ).

Since upgrade can lead to radical changes in your system, you should only use it when you need to bring your entire system up-to-date, generally after a major version release. For regular use, use update.
Sorry, but this is wrong. update will only update the package database. upgrade will show the behavior that you described for update, dist-upgrade will do the things you mentioned for upgrade.
So for regular use do as 62chevy suggested.
 
Old 10-28-2011, 09:17 AM   #10
62chevy
Member
 
Registered: Mar 2002
Location: West (By God) Virginia
Distribution: Debian Squeeze - Sid
Posts: 281

Rep: Reputation: 44
Quote:
Originally Posted by k3lt01 View Post
Has anyone noticed that there is slightly over 6 years between the first 2 posts and then everything else?

I missed that but bring up a good point about being accurate in your posts. Same newbie could have read this and been misinformed.
 
Old 10-29-2011, 01:36 PM   #11
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid
Posts: 4,733
Blog Entries: 12

Rep: Reputation: 457Reputation: 457Reputation: 457Reputation: 457Reputation: 457
From man apt-get
Quote:
update
update is used to resynchronize the package index files from their sources. The indexes of available packages
are fetched from the location(s) specified in /etc/apt/sources.list. For example, when using a Debian archive,
this command retrieves and scans the Packages.gz files, so that information about new and updated packages is
available. An update should always be performed before an upgrade or dist-upgrade. Please be aware that the
overall progress meter will be incorrect as the size of the package files cannot be known in advance.
Quote:
upgrade
upgrade is used to install the newest versions of all packages currently installed on the system from the
sources enumerated in /etc/apt/sources.list. Packages currently installed with new versions available are
retrieved and upgraded; under no circumstances are currently installed packages removed, or packages not
already installed retrieved and installed. New versions of currently installed packages that cannot be
upgraded without changing the install status of another package will be left at their current version. An
update must be performed first so that apt-get knows that new versions of packages are available.
Quote:
dist-upgrade
dist-upgrade in addition to performing the function of upgrade, also intelligently handles changing
dependencies with new versions of packages; apt-get has a "smart" conflict resolution system, and it will
attempt to upgrade the most important packages at the expense of less important ones if necessary. So,
dist-upgrade command may remove some packages. The /etc/apt/sources.list file contains a list of locations
from which to retrieve desired package files. See also apt_preferences(5) for a mechanism for overriding the
general settings for individual packages.
Quote:
clean
clean clears out the local repository of retrieved package files. It removes everything but the lock file from
/var/cache/apt/archives/ and /var/cache/apt/archives/partial/. When APT is used as a dselect(1) method, clean
is run automatically. Those who do not use dselect will likely want to run apt-get clean from time to time to
free up disk space.

autoclean
Like clean, autoclean clears out the local repository of retrieved package files. The difference is that it
only removes package files that can no longer be downloaded, and are largely useless. This allows a cache to
be maintained over a long period without it growing out of control. The configuration option
APT::Clean-Installed will prevent installed packages from being erased if it is set to off.
 
Old 10-29-2011, 01:43 PM   #12
62chevy
Member
 
Registered: Mar 2002
Location: West (By God) Virginia
Distribution: Debian Squeeze - Sid
Posts: 281

Rep: Reputation: 44
Craigevil settled it once and for all, thanks craigevil.
 
Old 10-30-2011, 04:14 AM   #13
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1949Reputation: 1949Reputation: 1949Reputation: 1949Reputation: 1949Reputation: 1949Reputation: 1949Reputation: 1949Reputation: 1949Reputation: 1949Reputation: 1949
Sorry. My mistake. Just a mental short-circuit there. I was thinking about how many people confuse the two upgrade options. Must've been tired.

update the repository list, then upgrade the packages.
 
Old 10-30-2011, 12:56 PM   #14
k3lt01
Senior Member
 
Registered: Feb 2011
Location: Australia
Distribution: Debian Wheezy, Jessie, Sid/Experimental, playing with LFS.
Posts: 2,759

Rep: Reputation: 576Reputation: 576Reputation: 576Reputation: 576Reputation: 576Reputation: 576
Quote:
Originally Posted by David the H. View Post
update the repository list, then upgrade the packages.
Which is what Moloko said back on 8.10.2005 lol.
 
Old 10-30-2011, 01:06 PM   #15
62chevy
Member
 
Registered: Mar 2002
Location: West (By God) Virginia
Distribution: Debian Squeeze - Sid
Posts: 281

Rep: Reputation: 44
Quote:
Originally Posted by k3lt01 View Post
Which is what Moloko said back on 8.10.2005 lol.

Yup and had it been left there all would have been fine. Some forums lock threads older than 6 months probable for this reason.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LILO Update After Upgrade-How? jam5173 Linux - Newbie 3 12-03-2005 01:43 AM
Update/upgrade apache medjugorjesi Debian 4 03-04-2005 02:47 PM
Update and Upgrade DebianNew Linux - Newbie 4 01-19-2005 07:02 AM
yet another upgrade/update question, which is best winchester169 Linux - Software 4 09-17-2004 07:40 PM
upgrade/update syl20 Linux - Software 2 06-14-2004 10:45 AM


All times are GMT -5. The time now is 12:03 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration