when gpg key add fails, entry is still added to sources.list
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
software-properties (Ubuntu) |
Confirmed
|
Medium
|
Unassigned |
Bug Description
When verifying bug 1532855 I realized that when add-apt-repository fails
(at least due to a gpg key-add failure) it will leave the sources entry
that it added still in place. It does not clean up as it should.
The issue is that after the failure, 'apt-get update' will fail as it
wont have the key it needs but apt will grab the ppa sources.
$ find /etc/apt/
/etc/apt/
$ sudo add-apt-repository -y ppa:smoser -k hkp://127.0.0.1/
gpg: keybox '/tmp/tmp03u3ib
gpg: keyserver receive failed: No keyserver available
Failed to add key.
$ echo $?
1
$ find /etc/apt/
/etc/apt/
/etc/apt/
$ apt-get update -q
Hit:1 http://
Hit:2 http://
Get:3 http://
Err:3 http://
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0620BBCF03683F77
Reading package lists...
W: GPG error: http://
E: The repository 'http://
$ echo $?
100
ProblemType: Bug
DistroRelease: Ubuntu 16.10
Package: software-
ProcVersionSign
Uname: Linux 4.9.0-15-generic x86_64
ApportVersion: 2.20.3-0ubuntu8.2
Architecture: amd64
Date: Thu Mar 9 16:54:42 2017
PackageArchitec
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
LANG=C.UTF-8
SourcePackage: software-properties
UpgradeStatus: No upgrade log present (probably fresh install)
Related bugs:
* bug 1532855 add-apt-repository exits with 0 even when adding key failed