4

Let's say I open the Update Manager, and my package list is a couple of days old, or I do apt-get upgrade without doing an apt-get update first, what is the result of this?

If there have been updates since I last did a 'check' in the Update Manager, do I not get the latest version? Or do I simply not get updates on packages which had not updates at the time of my last check?

2 Answers 2

5

apt-get update updates your local copy of the software catalog, and apt-get upgrade installs the new updates. So if you didn't update your local software catalog, you may not get latest updates (you will get updates from the previous update check).

1
  • Does that mean the server keeps a history of versions on there? Not just the latest version?
    – Alex
    Apr 4, 2012 at 1:41
1

Ubuntu has a good community-sourced HOWTO on this.

The repository keeps track of what the latest version of a package is, but your host has to get that information so it can pull the latest version. When you apt-get update you're pulling a fresh copy of the list of all available packages, not just the ones you installed. Running apt-get upgrade uses your local copy of the list, compared against the list of what you have installed, to decide what packages to download from the repository.

Whenever you run apt-get upgrade, it uses the current (i.e. last downloaded) local copy of the package list to make decisions against. To make sure your local copy is fresh, you should run apt-get update before upgrading, and after adding any new repository location.

In most cases (see the link), it's a good idea to use apt-get dist-upgrade instead of apt-get upgrade.

2
  • what does apt-get dist-upgrade do?
    – speedox
    Apr 8, 2012 at 11:17
  • 1
    dist-upgrade do the same of upgrade (install newer version of packages). But, also, can changing dependecies and remove packages. For this reson you can think about upgrade as a "safe-upgrade" and dist-upgrade as a full-upgrade.
    – peppe84
    Apr 8, 2012 at 14:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .