Re: problems in a net upgrade to Debian 8.1

On Sat, 20 Jun 2015 10:45:16 Chris Samuel said,
On Sat, 20 Jun 2015 10:25:15 AM zlinw@mcmedia.com.au wrote:
I am NOT dreamming this up, I did an apt-get update followed by an apt dist-upgrade to check this out,and the val/lib/dpkg/availibilty file was not touched
My wild guess is that you're looking at the atime of the file, and if your kernel has relatime set (which has been the default for a while) then that won't get updated if the file hasn't been modified since the last time anything accessed it (unless it's a day or more since the last access, when >it will get updated).
I am going to stick to my guns here, in this case when dselect update was done the availibilty files creation time was set to 0810, the time the file was writen to. Apt-get update, and apt dist-upgrade was done at 1010 the availibilty files creation time stayed at 0810, also its size did _Not_ change. This would seem to indicate the file was not writen to. I checked this again just now, apt-get update does not write to this file, where as dselect update does. Doing an strace on apt-get update shows it writes to files in the /var/lib/apt/lists directory and to the /var/lib/dpkg/status file but it does __not__ write to the availibilty file. So on my systems apt and dselect do have a different idea of what is availible. Lindsay

Doing an strace on apt-get update shows it writes to files in the /var/lib/apt/lists directory and to the /var/lib/dpkg/status file but it does __not__ write to the availibilty file.
I will try to resolve some of the confusion I have seen here. dselect is obsolete, it is recommended you don't use it anymore. It could be broken. It probably doesn't support features like apt pinning properly, or being able to let you select from multiple versions of a package. Use something like aptitude instead. The only recommended way of upgrading from one release to another release is with "apt-get dist-upgrade". No other methods (including aptitude) are recommended (although this doesn't mean they won't work). It is not recommended that you have a mix of "stable" and "testing" or "unstable" either, it could break (unless you are very careful). /var/lib/dpkg/status is a list of all currently installed packages. As a result "apt-get update" has no need to change this, because nothing is installed, upgraded or removed. /var/lib/apt/lists is the authoritative list of packages available. However, these are text files, which are slow to read and search every time you run apt-get. So apt-get creates cache/index files under /var/cache/apt/ to speed up searches. As dselect is so old, I don't think it supports this mechanism. It might in fact use /var/lib/dpkg/available, as mentioned here. This is, I believe, a legacy file. I am not sure what is responsible for updating /var/lib/dpkg/available. It is possible that the mechanism is broken, because dselect is considered legacy, and nobody noticed that it broke. I might have suggested that only dselect updates this file, however I notice I have this file, even though I have never used dselect. dselect might update this file automatically on start, based on this thread it looks like it doesn't.

On Sat, Jun 20, 2015 at 02:58:57AM +0000, Brian May wrote:
As dselect is so old, I don't think it supports this mechanism. It might in fact use /var/lib/dpkg/available, as mentioned here. This is, I believe, a legacy file.
I am not sure what is responsible for updating /var/lib/dpkg/available. It is possible that the mechanism is broken, because dselect is considered legacy, and nobody noticed that it broke.
I might have suggested that only dselect updates this file, however I notice I have this file, even though I have never used dselect. dselect might update this file automatically on start, based on this thread it looks like it doesn't.
dpkg uses this file, as well as /var/lib/dpkg/status because apt, like dselect, and all other tools for listing, installing, uninstalling, etc debian packages use dpkg, they all ultimately use /var/lib/dpkg/status. some also use /var/lib/dpkg/available (but that file is less important than it was in the mid-90s before apt arrived) when packages are installed, upgraded, removed, held/unheld, or purged these files are updated. /var/lib/dpkg/available is NOT a legacy file....it's not vitally important because it's easily rebuilt (unlike /var/lib/dpkg/status which is crucially important - lose that and you lose all information about installed packages on your system) but it's still in use. i used to use dselect for package selection and installation a long time ago. i stopped when the number of packages available became too many to want to wade through them. now i just install the debian base system plus some task selections and carefully chosen packages with 'apt-get install'. i still run 'dselect update' to update my packages list (configured to use apt as the method) partly out of long-standing habit and partly for convenience with bash history - i don't use dselect for anything else so typing '!dsel' into bash is guarranteed to run 'dselect update ; apt-get -V -d -u dist-upgrade' whereas running '!apt' could do anything, depending on what i last did with apt-get (or aptitude or apt-cache or apt-whatever). craig -- craig sanders <cas@taz.net.au>

Quoting Craig Sanders (cas@taz.net.au):
/var/lib/dpkg/available is NOT a legacy file....it's not vitally important because it's easily rebuilt (unlike /var/lib/dpkg/status which is crucially important - lose that and you lose all information about installed packages on your system) but it's still in use.
Recovering from the latter is a challenge, but here's one way to do so (using the contents of /usr/share/doc as a guide): 'Package Database Repair' on http://linuxmafia.com/kb/Debian -- Cheers, C.S. Lewis fan: "I'd like to visit Narnia." Rick Moen Tolkien fan: "I'd like to live in Middle-Earth." rick@linuxmafia.com George R.R. Martin fan: "Nope, I'm good." McQ! (4x80)
participants (4)
-
Brian May
-
Craig Sanders
-
Rick Moen
-
zlinw@mcmedia.com.au