In Ubuntu 10.04, when I goto System > Administration > Software Sources and goto the Authentication tab, I can view all of my keys allowing me to download from third party sources.

How would I back this up to copy all of my sources and keys to a new system?

3 Answers 3


The method to backup your sources list has already been described by garbagecollector (also note the additional directory as explained by Javier Rivera).

To backup the trusted keys added to your system you can use the apt-key command line program. I don't know if there is a way to do this from the GUI.

From a terminal you can run something like this:

sudo apt-key exportall > ~/repositories.key

Then on your other system you should be able to import that key file from Software Sources or you can use apt-key again:

sudo apt-key add /path/to/repositories.key

I only have one Ubuntu desktop system so I haven't tested this out, but I think it should work.


From 10.04 the source list can be in different places, the file /etc/apt/sources.list as said before and all the files inside /etc/apt/sources.list.d/.

The keys are stored in a similar fashion, the file /etc/apt/trusted.gpg and the files inside /etc/apt/trusted.gpg.d/

Finally you will need the info in trustdb.gpg to be able to decrypt the keys.

You will need to copy all these files and dirs.

Edit: The best way to copy the keys is explained in another answer. So please copy only sources.list and all the files inside sources.list.d. I keep the info about the files placement in the case it proves useful to another person.


I believe this would help backing up your sources.

sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup

Then do the reverse when you are your new system.

Maybe also try this software. Although I haven't used it myself.

  • I have tried backing up all of my sources lists but I get this error for each source I have: W: GPG error: http://linux.dropbox.com lucid Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY FC918B335044912E Aug 12, 2010 at 14:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .