Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

up vote 2 down vote accepted

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.

share|improve this answer
    
What do you mean by per-repository list files? Also is there any advantage is running the command 'apt-get -s update`? –  PeanutsMonkey Mar 9 '12 at 0:20
    
Where is it cached? –  PeanutsMonkey Mar 9 '12 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. –  Daniel Pittman Mar 9 '12 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? –  PeanutsMonkey Mar 9 '12 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.

share|improve this answer
    
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? –  PeanutsMonkey Mar 9 '12 at 0:36

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.