Bug#741962: apt: dpkg: warning: version 'amd64' has bad syntax: version number does not start with digit
Package: apt
Version: 0.9.16.1
File: /etc/kernel/postinst.d/apt-auto-removal
I noticed a warning from dpkg while installing a locally built kernel:
,----
| Examining /etc/kernel/postinst.d.
| run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.14.0-rc7-nouveau /boot/vmlinuz-3.14.0-rc7-nouveau
| dpkg: warning: version 'amd64' has bad syntax: version number does not start with digit
`----
AFAICT this warning comes from "dpkg --compare-versions" and is
triggered by the linux-image-amd64 metapackage which I have installed.
The patch below should avoid the warning by not acting on such
metapackages, but I haven't checked possible side effects.
--8<---------------cut here---------------start------------->8---
diff --git a/debian/apt.auto-removal.sh b/debian/apt.auto-removal.sh
index 0c51586..372308d 100644
--- a/debian/apt.auto-removal.sh
+++ b/debian/apt.auto-removal.sh
@@ -41,7 +41,7 @@ version_test_gt ()
return "$?"
}
-list="$(${DPKG} -l | awk '/^ii[ ]+(linux|kfreebsd|gnumach)-image-[0-9]*/ && $2 !~ /-dbg$/ { print $2 }' | sed -e 's#\(linux\|kfreebsd\|gnumach\)-image-##')"
+list="$(${DPKG} -l | awk '/^ii[ ]+(linux|kfreebsd|gnumach)-image-[0-9]+/ && $2 !~ /-dbg$/ { print $2 }' | sed -e 's#\(linux\|kfreebsd\|gnumach\)-image-##')"
latest_version=""
previous_version=""
--8<---------------cut here---------------end--------------->8---
-- System Information:
Debian Release: jessie/sid
APT prefers unstable
APT policy: (500, 'unstable'), (101, 'experimental')
Architecture: i386 (x86_64)
Kernel: Linux 3.13.6-nouveau (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages apt depends on:
ii debian-archive-keyring 2012.4
ii gnupg 1.4.16-1.1
ii libapt-pkg4.12 0.9.16.1
ii libc6 2.18-4
ii libgcc1 1:4.8.2-16
ii libstdc++6 4.8.2-16
apt recommends no packages.
Versions of packages apt suggests:
ii apt-doc 0.9.16.1
ii aptitude 0.6.10-1
ii dpkg-dev 1.17.7
ii python-apt 0.9.3.3
-- no debconf information
Reply to: