0

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 3

2

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.

4
  • What do you mean by per-repository list files? Also is there any advantage is running the command 'apt-get -s update`? Mar 9, 2012 at 0:20
  • Where is it cached? Mar 9, 2012 at 0:35
  • 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. 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? Mar 9, 2012 at 6:40
1

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.

1
  • 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? Mar 9, 2012 at 0:36
0

Conversely, if you wanted to get all the new packages you would do 'sudo apt-get upgrade' after updating the lists.

You must log in to answer this question.

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