--- Begin Message ---
- To: submit@bugs.debian.org
- Subject: Upgrade fails with "apt-key update" in the postinst script
- From: adrien <adrien@antipoul.fr>
- Date: Wed, 13 Jun 2007 23:54:56 +0200
- Message-id: <467067B0.70001@antipoul.fr>
Package: apt
Version: 0.7.2
Severity: grave
--- Please enter the report below this line. ---
Hi !
Since two days, the apt postinst script fails with the following output :
Paramétrage de apt (0.7.2) ...
gpg: key 2D230C5F: "Debian Archive Automatic Signing Key (2006)
<ftpmaster@debian.org>" not changed
gpg: key 6070D3A1: "Debian Archive Automatic Signing Key (4.0/etch)
<ftpmaster@debian.org>" not changed
gpg: key ADB11277: "Etch Stable Release Key
<debian-release@lists.debian.org>" not changed
gpg: Total number processed: 3
gpg: unchanged: 3
gpg: key "1" not found: eof
gpg: 1: delete key failed: eof
dpkg : erreur de traitement de apt (--configure) :
le sous-processus post-installation script a retourné une erreur de
sortie d'état 2
Des erreurs ont été rencontrées pendant l'exécution :
apt
E: Sub-process /usr/bin/dpkg returned an error code (1)
(Sorry for French messages, but it's not useful to translate them)
I managed to go deeper in the analysis : it's the "apt-key update" in
the postinst script that generates this error. So I had a look at it,
and I found that the "add new keys" section is alright, it fails at
removing no-longer used keys. Here is the bash code :
keys=`$GPG_CMD --keyring $REMOVED_KEYS --with-colons --list-keys |
grep ^pub | cut -d: -f5`
for key in $keys; do
if $GPG --list-keys --with-colons | grep ^pub | cut -d: -f5 |
grep -q $key; then
$GPG --quiet --batch --delete-key --yes ${key}
fi
done
The unused keys are stored in the 'keys' variable. Here is what I have :
root@complexe:/tmp# $GPG_CMD --keyring $REMOVED_KEYS --with-colons
--list-keys | grep ^pub | cut -d: -f5
1
17
17
The for loop try to find each key in the existing keyring, but guess
what ? The key '1' is not in my keyring, so it fails removing it, but
the if condition returns true. Let's have a look at the condition
without the final grep :
root@complexe:/tmp# $GPG --list-keys --with-colons | grep ^pub | cut -d: -f5
17
17
17
17
Yes, you finally understand that grep 1 on that list is true... but it's
not what apt-key should be looking for ! So it may be a good idea to use
a regexp to match the whole line and not only an expression that could
be contained in a larger one.
This is a grave severity since I can't do any upgrade on my PC : the apt
configure script is run before anything else :'(
--- System information. ---
Architecture: i386
Kernel: Linux 2.6.21-1-k7
Debian Release: lenny/sid
500 unstable ftp.fr.debian.org
--- Package information. ---
Depends (Version) | Installed
==============================================-+-====================
libc6 (>= 2.5-5) | 2.5-10
libgcc1 (>= 1:4.2-20070516) | 1:4.2-20070609-1
libstdc++6 (>= 4.2-20070516) | 4.2-20070609-1
debian-archive-keyring | 2007.02.19-0.1
--- End Message ---
--- Begin Message ---
Source: apt
Source-Version: 0.7.17~exp4
We believe that the bug you reported is fixed in the latest version of
apt, which is due to be installed in the Debian FTP archive:
apt-doc_0.7.17~exp4_all.deb
to pool/main/a/apt/apt-doc_0.7.17~exp4_all.deb
apt-transport-https_0.7.17~exp4_i386.deb
to pool/main/a/apt/apt-transport-https_0.7.17~exp4_i386.deb
apt-utils_0.7.17~exp4_i386.deb
to pool/main/a/apt/apt-utils_0.7.17~exp4_i386.deb
apt_0.7.17~exp4.dsc
to pool/main/a/apt/apt_0.7.17~exp4.dsc
apt_0.7.17~exp4.tar.gz
to pool/main/a/apt/apt_0.7.17~exp4.tar.gz
apt_0.7.17~exp4_i386.deb
to pool/main/a/apt/apt_0.7.17~exp4_i386.deb
libapt-pkg-dev_0.7.17~exp4_i386.deb
to pool/main/a/apt/libapt-pkg-dev_0.7.17~exp4_i386.deb
libapt-pkg-doc_0.7.17~exp4_all.deb
to pool/main/a/apt/libapt-pkg-doc_0.7.17~exp4_all.deb
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 428752@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Eugene V. Lyubimkin <jackyf.devel@gmail.com> (supplier of updated apt package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.8
Date: Fri, 24 Oct 2008 23:45:17 +0300
Source: apt
Binary: apt apt-doc libapt-pkg-dev libapt-pkg-doc apt-utils apt-transport-https
Architecture: source all i386
Version: 0.7.17~exp4
Distribution: experimental
Urgency: low
Maintainer: APT Development Team <deity@lists.debian.org>
Changed-By: Eugene V. Lyubimkin <jackyf.devel@gmail.com>
Description:
apt - Advanced front-end for dpkg
apt-doc - Documentation for APT
apt-transport-https - APT https transport
apt-utils - APT utility programs
libapt-pkg-dev - Development files for APT's libapt-pkg and libapt-inst
libapt-pkg-doc - Documentation for APT development
Closes: 428752
Changes:
apt (0.7.17~exp4) experimental; urgency=low
.
* debian/rules:
- Fixed lintian warnings "debian/rules ignores make errors".
* debian/control:
- Substituted outdated "Source-Version" fields with "binary:Version".
- Added 'python-apt' to Suggests, as apt-mark need it for work.
- Drop Debian revision from 'doc-base' build dependency, this fixes
appropriate lintian warning.
* debian/libapt-pkg-doc.doc-base.*:
- Changed section: from old 'Devel' to 'Debian'. This fixes appropriate
lintian warnings.
* debian/{postrm,prerm,preinst}:
- Added 'set -e', fixes lintian warnings
'maintainer-script-ignores-error'.
* dselect/makefile:
- Removed unneeded 'LOCAL' entry. This allows cleaning rule to run smoothly.
* share/lintian-overrides:
- Added with override of 'apt must depend on python'. Script 'apt-mark'
needs apt-python for working and checks this on fly. We don't want
python in most cases.
* cmdline/apt-key:
- Added 'unset GREP_OPTIONS' to the script. This prevents 'apt-key update'
failure when GREP_OPTIONS contains options that modify grep output.
(Closes: #428752)
Checksums-Sha1:
07f68f3a1576cd414aa30b0748a39b82bfe637ca 1173 apt_0.7.17~exp4.dsc
1c5200130a54ae4602f38f2e3a5216731450d171 2030600 apt_0.7.17~exp4.tar.gz
a590e672b7737b6dcfea5308897d677752b4bf31 100194 apt-doc_0.7.17~exp4_all.deb
4252c28eae026f653680feddc7d524fd808bd7f9 124288 libapt-pkg-doc_0.7.17~exp4_all.deb
a47386f448d3d2e0f6d9fee3cf6f3fa6606b44c8 1650886 apt_0.7.17~exp4_i386.deb
dfe5fba4079dc8a30cd66e1d487de262d160cf8c 108918 libapt-pkg-dev_0.7.17~exp4_i386.deb
4e3af324b36c218348da7d7fb9eff12408914900 188116 apt-utils_0.7.17~exp4_i386.deb
a4600b5748990d4d3b57a1722d22d5ae297632ae 58388 apt-transport-https_0.7.17~exp4_i386.deb
Checksums-Sha256:
631c08036e6d142d2ec0d1363ad6ac207ffcbd3fd57c0ae5d927e998bf50a8ed 1173 apt_0.7.17~exp4.dsc
336e4436312e60ecb8b30be30a839497320c76a33e775a0e411af487465e6d46 2030600 apt_0.7.17~exp4.tar.gz
6f8ef7a20f3c0f3586fb62807ffa3f3bc7ea0b810a9d31803998e19f33c81fbd 100194 apt-doc_0.7.17~exp4_all.deb
5ff3fb35968264bfe15d89f9b441e459e7cc9f9d36d73d0034476a37b4b60f89 124288 libapt-pkg-doc_0.7.17~exp4_all.deb
4a9cb122c1ecd0e186c4f204e6546353cfa3a45a12c52ed80da0875d8a018274 1650886 apt_0.7.17~exp4_i386.deb
2c840fcbbe93de390cbe525a5362cd7802f0d3a2135df1cf9cbb1ed1b36d61f8 108918 libapt-pkg-dev_0.7.17~exp4_i386.deb
237f217e33af72ebf825eae9a4255e9a7563244ffbac7192daa2bda658632936 188116 apt-utils_0.7.17~exp4_i386.deb
d5bb86c50aa2411be33c4ef695afb8bb9bfa2ddb4ecfabc06d0459fa9f0096d9 58388 apt-transport-https_0.7.17~exp4_i386.deb
Files:
ff74749c45c3f07b0778634f891f2174 1173 admin important apt_0.7.17~exp4.dsc
d1a6a12997177f84727e8f8bc3ebd5d8 2030600 admin important apt_0.7.17~exp4.tar.gz
069ee0e4fd3ad5cb83f439373555ad26 100194 doc optional apt-doc_0.7.17~exp4_all.deb
fe094dcc431674870b5e2c45df465e41 124288 doc optional libapt-pkg-doc_0.7.17~exp4_all.deb
562fdddf0443c32456a4b645279167da 1650886 admin important apt_0.7.17~exp4_i386.deb
79b5cf422e49f17a73fe93a472861f12 108918 libdevel optional libapt-pkg-dev_0.7.17~exp4_i386.deb
501fc1843cd7c232326bbc10e8bb7df2 188116 admin important apt-utils_0.7.17~exp4_i386.deb
4254b2d5672a7c3afcb27e81319b447a 58388 admin optional apt-transport-https_0.7.17~exp4_i386.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAkkLhzAACgkQliSD4VZixzQfXQCfU022zt+LQOp09QS5qn9/iyWp
GGQAoIQWv4TOVU9ul0jznXCEL4mmii66
=AlfZ
-----END PGP SIGNATURE-----
--- End Message ---