LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Update -vs Upgrade (https://www.linuxquestions.org/questions/debian-26/update-vs-upgrade-370735/)

carlosinfl 10-07-2005 04:01 PM

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!

Moloko 10-07-2005 04:27 PM

"update" updates the package list with any newly available packages from the mirrors and "upgrade" executes the actual upgrading of packages. That's it.

linustalman 10-27-2011 12:28 PM

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.

frankbell 10-27-2011 09:07 PM

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.

62chevy 10-27-2011 10:02 PM

Quote:

Originally Posted by frankbell (Post 4510251)
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.

David the H. 10-28-2011 01:32 AM

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.

evo2 10-28-2011 02:51 AM

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. (Post 4510389)
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. (Post 4510389)
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.

k3lt01 10-28-2011 03:14 AM

Has anyone noticed that there is slightly over 6 years between the first 2 posts and then everything else?

TobiSGD 10-28-2011 06:18 AM

Quote:

Originally Posted by David the H. (Post 4510389)
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.

62chevy 10-28-2011 09:17 AM

Quote:

Originally Posted by k3lt01 (Post 4510439)
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.

craigevil 10-29-2011 01:36 PM

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.

62chevy 10-29-2011 01:43 PM

Craigevil settled it once and for all, thanks craigevil.

David the H. 10-30-2011 04:14 AM

Sorry. My mistake. :doh: 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.

k3lt01 10-30-2011 12:56 PM

Quote:

Originally Posted by David the H. (Post 4511672)
update the repository list, then upgrade the packages.

Which is what Moloko said back on 8.10.2005 lol.

62chevy 10-30-2011 01:06 PM

Quote:

Originally Posted by k3lt01 (Post 4511934)
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.


All times are GMT -5. The time now is 07:53 AM.