0

Here: apt-get update updates all the packages? was a good question that IMO was neither a duplicate question nor sufficiently clearly answered... So let me guess the answer & perhaps someone can confirm or not. I suspect apt/apt-get update (a) reads (eg with dpkg --get-selections or --list) the list of installed items on the user's system, & then (b) conducts a search of the repo(s) the user has nominated in the 'sources' file(s) - looking for, & downloading the details of, just those items corresponding to list (a) where the repo has a more recent version. Of course, it would not be able to find items that were not on the repo eg where the user has installed from somewhere else.

ozwi
  • 1

1 Answers1

2

apt-get update only updates your software lists, ie. packages that should be available and can be downloaded, are the latest etc. It does NO upgrades of packages at all; as upgrade, full-upgrade & dist-upgrade do that role.

Yes apt-get update is limited to sources found in /etc/apt/sources.list & files within /etc/apt/sources.list.d/ but it does not upgrade any packages. apt-get update also does not look at whatever packages you have installed; it's only touching software lists of what's available.

If you're using a badly outdated mirror; which can lead to package problems, it won't know or check for that (the output from the apt-get update can be useful to check https://launchpad.net/ubuntu/+archivemirrors yourself for those problems).

From man apt-get

   update
       update is used to resynchronize the package index files from their sources. The indexes of available packages
       are fetched from the location(s) specified in /etc/apt/sources.list. For example, when using a Debian archive,
       this command retrieves and scans the Packages.gz files, so that information about new and updated packages is
       available. An update should always be performed before an upgrade or dist-upgrade. Please be aware that the
       overall progress meter will be incorrect as the size of the package files cannot be known in advance.

Note: This was copied from my 20.04 system, if you use man apt-get on your own box you'll see the reference manual page that perfectly matches your release.

guiverc
  • 33,561