mvo5 / unattended-upgrades

Automatic installation of security upgrades on apt based systems
GNU General Public License v2.0
278 stars 78 forks source link

Feature Request: Add logging for broken apt sources #358

Open triatic opened 5 months ago

triatic commented 5 months ago

unattended-upgrades does not log anything when apt sources are broken. My feature request is that attempts to update from broken apt sources are logged.

Example:

I first run unattended-upgrade -d with a valid apt source, unattended-upgrade logs no error.

Then I run unattended-upgrade -d with a broken apt source, unattended-upgrade still logs no error.

debian@server:~$ cat /etc/apt/sources.list
deb http://deb.debian.org/debian testing main
debian@server:~$ sudo apt update
Hit:1 http://deb.debian.org/debian testing InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
debian@server:~$ sudo unattended-upgrade -d
Checking if system is running on battery is skipped. Please install powermgmt-base package to check power status and skip installing updates when the system is running on battery.
Checking if connection is metered is skipped. Please install python3-gi package to detect metered connections and skip downloading updates.
Starting unattended upgrades script
Allowed origins are: o=*
Initial blacklist:
Initial whitelist (not strict):
Using (^linux-.*-[1-9][0-9]*\.[0-9]+\.[0-9]+-[0-9]+(-.+)?$|^kfreebsd-.*-[1-9][0-9]*\.[0-9]+\.[0-9]+-[0-9]+(-.+)?$|^gnumach-.*-[1-9][0-9]*\.[0-9]+\.[0-9]+-[0-9]+(-.+)?$|^.*-modules-[1-9][0-9]*\.[0-9]+\.[0-9]+-[0-9]+(-.+)?$|^.*-kernel-[1-9][0-9]*\.[0-9]+\.[0-9]+-[0-9]+(-.+)?$|^linux-.*-[1-9][0-9]*\.[0-9]+\.[0-9]+-[0-9]+(-.+)?$|^kfreebsd-.*-[1-9][0-9]*\.[0-9]+\.[0-9]+-[0-9]+(-.+)?$|^gnumach-.*-[1-9][0-9]*\.[0-9]+\.[0-9]+-[0-9]+(-.+)?$|^.*-modules-[1-9][0-9]*\.[0-9]+\.[0-9]+-[0-9]+(-.+)?$|^.*-kernel-[1-9][0-9]*\.[0-9]+\.[0-9]+-[0-9]+(-.+)?$) regexp to find kernel packages
Using (^linux-.*-6\.6\.15\-amd64$|^kfreebsd-.*-6\.6\.15\-amd64$|^gnumach-.*-6\.6\.15\-amd64$|^.*-modules-6\.6\.15\-amd64$|^.*-kernel-6\.6\.15\-amd64$|^linux-.*-6\.6\.15\-amd64$|^kfreebsd-.*-6\.6\.15\-amd64$|^gnumach-.*-6\.6\.15\-amd64$|^.*-modules-6\.6\.15\-amd64$|^.*-kernel-6\.6\.15\-amd64$) regexp to find running kernel packages
pkgs that look like they should be upgraded:
Fetched 0 B in 0s (0 B/s)
fetch.run() result: 0
Packages blacklist due to conffile prompts: []
No packages found that can be upgraded unattended and no pending auto-removals
Extracting content from /var/log/unattended-upgrades/unattended-upgrades-dpkg.log since 2024-03-30 11:04:11
debian@server:~$ cat /etc/apt/sources.list
deb http://deb.debian.org/debian xtesting main
debian@server:~$ sudo apt update
Ign:1 http://deb.debian.org/debian xtesting InRelease
Err:2 http://deb.debian.org/debian xtesting Release
  404  Not Found [IP: 199.232.58.132 80]
Reading package lists... Done
E: The repository 'http://deb.debian.org/debian xtesting Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
debian@server:~$ sudo unattended-upgrade -d
Checking if system is running on battery is skipped. Please install powermgmt-base package to check power status and skip installing updates when the system is running on battery.
Checking if connection is metered is skipped. Please install python3-gi package to detect metered connections and skip downloading updates.
Starting unattended upgrades script
Allowed origins are: o=*
Initial blacklist:
Initial whitelist (not strict):
Using (^linux-.*-[1-9][0-9]*\.[0-9]+\.[0-9]+-[0-9]+(-.+)?$|^kfreebsd-.*-[1-9][0-9]*\.[0-9]+\.[0-9]+-[0-9]+(-.+)?$|^gnumach-.*-[1-9][0-9]*\.[0-9]+\.[0-9]+-[0-9]+(-.+)?$|^.*-modules-[1-9][0-9]*\.[0-9]+\.[0-9]+-[0-9]+(-.+)?$|^.*-kernel-[1-9][0-9]*\.[0-9]+\.[0-9]+-[0-9]+(-.+)?$|^linux-.*-[1-9][0-9]*\.[0-9]+\.[0-9]+-[0-9]+(-.+)?$|^kfreebsd-.*-[1-9][0-9]*\.[0-9]+\.[0-9]+-[0-9]+(-.+)?$|^gnumach-.*-[1-9][0-9]*\.[0-9]+\.[0-9]+-[0-9]+(-.+)?$|^.*-modules-[1-9][0-9]*\.[0-9]+\.[0-9]+-[0-9]+(-.+)?$|^.*-kernel-[1-9][0-9]*\.[0-9]+\.[0-9]+-[0-9]+(-.+)?$) regexp to find kernel packages
Using (^linux-.*-6\.6\.15\-amd64$|^kfreebsd-.*-6\.6\.15\-amd64$|^gnumach-.*-6\.6\.15\-amd64$|^.*-modules-6\.6\.15\-amd64$|^.*-kernel-6\.6\.15\-amd64$|^linux-.*-6\.6\.15\-amd64$|^kfreebsd-.*-6\.6\.15\-amd64$|^gnumach-.*-6\.6\.15\-amd64$|^.*-modules-6\.6\.15\-amd64$|^.*-kernel-6\.6\.15\-amd64$) regexp to find running kernel packages
pkgs that look like they should be upgraded:
Fetched 0 B in 0s (0 B/s)
fetch.run() result: 0
Packages blacklist due to conffile prompts: []
No packages found that can be upgraded unattended and no pending auto-removals
Extracting content from /var/log/unattended-upgrades/unattended-upgrades-dpkg.log since 2024-03-30 11:04:33