I'm trying to figure out why a package was not upgraded unattended, and I have turned my eyes to the Allowed-Origins
configuration. However, I do not know how to check the origin and archive of packages in the apt cache. How do I do so?
I'm trying to figure out why a package was not upgraded unattended, and I have turned my eyes to the Allowed-Origins
configuration. However, I do not know how to check the origin and archive of packages in the apt cache. How do I do so?
The method to find the package identification(Origin, Archive, etc) is to check the
Release
file of the repository. TheRelease
file is located at directory/var/lib/apt/lists/
, and named after your repository URI path.For example, my Debian operating system's third party
Release
file is/var/lib/apt/lists/mirrors.ustc.edu.cn_dotdeb_packages.dotdeb.org_dists_wheezy_Release
. Its content is as below:Then I add the following line in
Unattended-Upgrade::Origins-Pattern
section:The following command lists all the versions of a given package available from all sources configured in your
sources.list
:EDIT
Here is sample output from a system with multiple sources in
sources.list
.The version table shows the available package versions, priorities, archive URLs, and suites.
Ok, I found a way that's enough for my immediate purpose, even though it isn't general enough. I'll leave the answer here, but I will not accept it.
When running
unattended-upgrade -d
, it will log information about the packages with upgrades available. This information contains origin and archive. For example:The script
unattended-upgrade
itself is Python, and usespython-apt
, an interface tolibapt-pkg
, to get that information.