0

Previously I had visited this discussion and I am still not getting a full answer. As was mentioned in the accepted answer of the above link:

apt-get update downloads the package lists from the repositories and "updates" them to get information on the newest versions of packages and their dependencies. It will do this for all repositories and PPAs.

What actually is meant by "downloads the package lists"?. If I'm not wrong, the package lists are already stored in my local computer. I mean, the packages (maybe old versions of them) are already in my computer and of source there is also the list in /var/apt/lists.

Even if it needs to download the package lists, then that must be a .txt or similar file. Then why is this indicated?

fetching 17.6 mb from https://..mirror...

I mean, how can the package list be so large, if there are few hundreds packages in total only, including all modules and libs?

Can someone make it more clear for me?

  • 5
    Ubuntu main repo contains not "a few hundred" of packages, bun about 50 thousand. Is it more clear now? – Pilot6 Jul 08 '20 at 14:18
  • "the package lists are already stored in my local computer. I mean, the packages (maybe old versions of them) are already in my computer" ... by what method do you think they came there in the first place? – muru Jul 08 '20 at 15:31

3 Answers3

3

I maintain a local mirror of Ubuntu Bionic so I can show you the size of the files.

This is the baseline 18.04 release from 4/2018. As you can see, the zipped 'Contents' files are ~37 MiB each.

enter image description here

the security and updates contents list are roughly twice as large (this is bionic-updates).

enter image description here

The unzipped Contents-amd64.gz from the baseline is nearly 600 MiB and contains 6,552,333 lines. It starts like this:

bin/afio                            multiverse/utils/afio
bin/archdetect                          utils/archdetect-deb
bin/ash                             universe/shells/ash
bin/autopartition                       admin/ubiquity
bin/autopartition-crypto                    admin/ubiquity
bin/autopartition-loop                      admin/ubiquity
bin/autopartition-lvm                       admin/ubiquity
bin/bash                            shells/bash
bin/bash-static                         universe/shells/bash-static
bin/block-attr                          admin/ubiquity
Organic Marble
  • 23,641
  • 15
  • 70
  • 122
2

If I am not wrong packages list are already stored in my local computer,

Yes they are. However packages get updated on a daily based. So you have to update them to make your package manager aware of new changes and to be able and use apt ... to get the latest version of packages.

I mean how can the package lit be so large there may be around few hundreds only including all modules and libs.

Here is the number of packages:

$ apt list 2>/dev/null | wc -l
59913

See the lists for yourself:

ls -lh /var/lib/apt/lists

And remember if you don't update these lists for a while, they'll get obsolete. And next time when you try to update them, it fetches all of them.

Ravexina
  • 55,668
  • 25
  • 164
  • 183
2

What actually it mean by downloading packages list. If i am not wrong packages list are already stored in my local computer

Yes, but the package lists stored locally refer to old versions of software. The packages lists is like checking for updates: it downloads the latest list of Ubuntu software versions, and then if you do apt-get upgrade it checks your installed software versions with the newly-downloaded package lists to see if there are any updates.

I mean how can the package lit be so large there may be around few hundreds only including all modules and libs.

There are some ~50,000 packages as of Ubuntu 20.04.

As for the file size, you might want to check out this question: the size of apt-get update lists is too big.