10

When I uninstall some software and then reinstall it through Ubuntu Software Centre after a short period of time, the notification says that it is only being installed and not downloaded. However if this is done after a long period of time, it has to be both downloaded and installed. This leads me to two related questions.

(1) Is recently uninstalled software hidden in some form in some place so that it is not downloaded again?

(2) After how long is this cleared so that it has to be downloaded again?

1 Answer 1

15

1) Yes, downloaded packages are stored in /var/cache/apt/archives/. You can remove them by running sudo apt-get clean.

From man apt-get:

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.

2) Packages gets updated over time. When you're notified of new updates, packages have not been downloaded yet (or you must have configured otherwise, and packages are downloaded, but not installed).
If you make your packages information up to date by running sudo apt-get update or pressing Refresh in your package manager, the latest versions of packages will be known to the package manager. When proceeding with the upgrade, either by running sudo apt-get upgrade or by pressing Apply at Synaptic, the latest version of a package will be used. If this file was previously downloaded, that one will be used. If that file was outdated, a new one will be retrieved.

If you look in your cache directory at /var/cache/apt/archives, you'll notice that packages are identified by name and version. For example, I've three different files (versions) of chromium-browser in that directory:

chromium-browser_11.0.696.57~r82915-0ubuntu0.11.04.1_amd64.deb
chromium-browser_11.0.696.65~r84435-0ubuntu0.11.04.1_amd64.deb
chromium-browser_11.0.696.68~r84545-0ubuntu0.11.04.1_amd64.deb

The purpose of this cache is to speed up re-installing applications if needed. You can compare it to your Internet browsers cache, images are only downloaded the first time. In the future, the browser checks at the server whether the image is up-to-date. If so, the cached one will be used. Otherwise, a new one is downloaded rendering the old one useless.

You must log in to answer this question.