If I run the command apt-get update
are any packages downloaded? My understanding is that it only updates the repositories. Based on that understanding does, that also mean that it updates the source.list file or does it simply update the apt cache?
3 Answers
It updates the lists of available packages, which are cached as the per-repository list
files; it doesn't modify the sources.list
file, or download any deb packages.
-
What do you mean by
per-repository list files
? Also is there any advantage is running the command 'apt-get -s update`? Commented Mar 9, 2012 at 0:20 -
-
The full list of packages in each repository are downloaded and stored in
/var/lib/apt/lists
, so that apt knows what is available. I can't imagine any benefit to performance a simulated update. Commented Mar 9, 2012 at 0:58 -
I take it that the file at /var/lib/apt/lists is updated each time I run the command
apt-get update
. Is that right? Is this the same location it is cached? Commented Mar 9, 2012 at 6:40
From the Ubuntu help page: To update the local package index with the latest changes made in repositories, type the following:
sudo apt-get update
So, no, it does not download any packages. It does not update sources.list.
-
What is it updating then? Is it a file or is it cached somewhere? If so where is the cache? Is the cache cleared each time I run the command? Commented Mar 9, 2012 at 0:36
Conversely, if you wanted to get all the new packages you would do 'sudo apt-get upgrade' after updating the lists.