10

I know what Debian package management says:

Do not erase or alter files in /var/lib/dpkg/.

However, there are 11,501 files in that folder dating from 2006:

$ ls -l /var/lib/dpkg/info | wc -l 11502 sudo find /var/lib/dpkg/info -type f -printf '%T+ %p\n' | sort | head -n 20 | awk '{print $NF}' | xargs ls -l -rwxr-xr-x 1 root root 184 Jul 19 2008 /var/lib/dpkg/info/extra-xdg-menus.postrm -rw-r--r-- 1 root root 27 Aug 10 2006 /var/lib/dpkg/info/freepats.conffiles -rw-r--r-- 1 root root 12993 Aug 10 2006 /var/lib/dpkg/info/freepats.md5sums 

How can I determine the status of the files and the correct management method?

Seeing files there with a date of 2006 is surprising to me because this little machine (Acer Aspire One Netbook) was only released 2008 and I didn't get it for a few years after that (it previously ran Windows, before Linux gave it a new life).

2 Answers 2

34

The modification time on files installed by dpkg, including the metadata files in /var/lib/dpkg/info, is the modification time they have inside the package archive file (the .tar.gz or equivalent contained inside the .deb file). It's normally the time they were last changed by the maintainer for files that are manually written. For files that are generated automatically by the package build tools, it's normally the time the package was built, or, with reproducible builds, the date of the latest entry in the changelog file. It has nothing to do with the time the package was installed.

It's unsurprising that some package metadata files haven't changed in a very long time. Even if the content of the package changes because the program has updates, new features and so on, some things don't change often. For example a .postrm script contains things to do as the very last step of uninstallation, and most packages don't need one at all; it's unsurprising that what needs to be done at that point rarely changes. In the case of freepats.md5sum, the .md5sum file does change any time the package changes; this is a data file (some audio synthesis data) which hasn't changed in years (it's just data, no code, so there's a pretty low risk of bugs, and nobody has been interested in doing any enhancement to it).

Each package averages about half a dozen files under /var/lib/dpkg/info, and Debian tends to split software into fine-grained packages (each library into its own package, data and documentation are often packaged separately from code, etc.). So having ~10k files there is typical.

The state of your system is normal and there is no action to take.

0
20

The timestamps of the files in /var/lib/dpkg/info reflect the date and time at which they were last changed. For many of these, that’s the date and time at which the package was built: the files are generated during the build. In some cases, it’s the timestamp of the original file as stored in the source archive. For .list files, it’s the date and time at which the package was installed and caused the list of files to change. The version of freepats currently in Debian 10 was last updated in 2006...

It does happen however that files are left over in /var/lib/dpkg/info when the corresponding package is purged. All the files are named after their owning package; remove the extension, then check whether the package is installed with dpkg -l — if it isn’t, you can delete them.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.