How to remove a apt-key which I have added?

apt-key add adds a key to /etc/apt/trusted.gpg by default.

These keys are from Ubuntu repositories:

pub   1024D/437D05B5 2004-09-12
uid                  Ubuntu Archive Automatic Signing Key <[email protected]>
sub   2048g/79164387 2004-09-12

pub   1024D/FBB75451 2004-12-30
uid                  Ubuntu CD Image Automatic Signing Key <[email protected]>

pub   4096R/C0B21F32 2012-05-11
uid                  Ubuntu Archive Automatic Signing Key (2012) <[email protected]>

pub   4096R/EFE21092 2012-05-11
uid                  Ubuntu CD Image Automatic Signing Key (2012) <[email protected]>

Then you're left only with:

pub   1024D/D50582E6 2009-02-01
uid                  Kohsuke Kawaguchi <[email protected]>
uid                  Kohsuke Kawaguchi <[email protected]>
uid                  [jpeg image of size 3704]
sub   2048g/10AF40FE 2009-02-01

Remove it by running:

sudo apt-key del D50582E6

If you really want to make sure you're removing the right key, you could add the key again to a new keyring:

wget -q -O - https://jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key --keyring /tmp/test add -

Then list its contents:

sudo apt-key --keyring /tmp/test list

Then you'll see the key you want to remove.


You can also directly remove key using

$ sudo apt-key list | grep 'teejee'

You will get

/etc/apt/trusted.gpg.d/teejee2008-ppa.gpg

Then,

$ sudo rm /etc/apt/trusted.gpg.d/teejee2008-ppa.gpg

Just Test again with $ sudo apt-key list | grep 'teejee'


Open the software center, go to "Edit" → "Software Sources ..." → "Other Software" and you see a "Remove" button.

Tags:

Repository

Apt