Importing Repository GPG Keys
One of the features of apt.get is that it checks applications to see if they’re signed with a GPG repository public key to make sure that they aren’t malware placed on the site by a cracker. No signature, no installation. This means that you have to get the repository public key.
Here is my sources.list file. Listings in bold are vendor-specific repositories. Any line starting with # is commented out. The generic version names stable/testing/unstable mean the same as they do elsewhere in this document. Common names (lenny, sid, etc.) are used only where the repository is not set up to use the generic names.
To add a repository:
- Use the APT Key Manager (a GUI for apt-key) to install downloaded keys or key rings to the apt key database. Get it by:
# aptitude install gui-apt-key
- At the repository site, find the line that describes the site for sources.list and, if provided, the one that matches the version you want it to use. It will look something like:
deb http://debian.hands.com/debian/ stable main contrib non-free
- Open a text editor as root and open /etc/apt/sources.list.
- Add the line that describes the repository, choosing stable or non-stable to match your distribution version and the application types (main and/or contrib and/or non-free) you want from the repository.
- Download the gpg key if you can on the repository website, and install it via APT Key Manager (Start > System > APT Key Manager).
- Whether you can find it or not, run:
# apt-get update
This updates the local apt database to tell it what applications/versions are available. It's run every time you change sources.list. If there is an error message, it will usually work anyway, but try to fix the errors because each error message usually means a repository is inaccessible. - If you couldn’t find the key, take the repository key ID from the NO_PUBKEY [keyID] error message, enter it in the Key ID text box, and press +Add. Rerun the apt-get update.
You should be able to copy and paste the following into your sources.list file. I suggest renaming the old sources.list file:
# cd /etc/apt # mv sources.list sources.listold # kwrite /etc/apt/sources.list
Drop the following text between start and end into the file (or use the text editor of your choice—just remember it has to be opened from root). The entries in bold are vendor-specific repositories not part of the official Debian distribution. They can be removed if you prefer; because sources.list is a text file, the formatting won't paste into the file in any case.
============== sources.list start # in this configuration file, # means non-executable comment line, not a root prompt. deb http://debian.hands.com/debian/ stable main contrib non-free deb http://debian.hands.com/debian/ testing main contrib non-free deb http://security.debian.org/ stable/updates main contrib non-free deb http://security.debian.org/ testing/updates main contrib non-free # this gets you the most current bug-fixed Opera deb http://deb.opera.com/opera/ etch non-free # this gets you the most current bug-fixed swiftfox – swiftfox is a slightly tweaked Firefox for speed and stability deb http://getswiftfox.com/builds/debian/ unstable non-free # this gets you the most current bug-fixed Skype conferencing app deb http://download.skype.com/linux/repos/debian/ stable non-free # this downloads from the primary US Debian repository. deb http://ftp.us.debian.org/debian/ stable main non-free contrib deb-src http://ftp.us.debian.org/debian/ stable main non-free contrib deb http://ftp.us.debian.org/debian/ testing main non-free contrib deb-src http://ftp.us.debian.org/debian/ testing main non-free contrib # this downloads from the primary non-US Debian repository; may have some applications not available in America. deb http://non-us.debian.org/debian-non-US/ stable/non-US main contrib non-free deb-src http://non-us.debian.org/debian-non-US/ stable/non-US main contrib non-free # this makes latest multimedia applications available and some codecs unavailable from US repositories for legal reasons. deb http://www.debian-multimedia.org/ stable main deb http://www.debian-multimedia.org/ testing main # this is for the virtualbox virtualization software deb http://www.virtualbox.org/debian/ etch non-free # this gets you Debian Volatile (see below) deb http://volatile.debian.org/debian-volatile/ etch/volatile main contrib non-free # this is for the latest version of hibernate/suspend software deb http://cp.yi.org/apt/hibernate/ ./ # this gets you a python API framework some programs require # wxWidgets/wxPython repository at apt.wxwidgets.org deb http://apt.wxwidgets.org/ etch-wx main deb-src http://apt.wxwidgets.org/ etch-wx main # this gets you the restricted packages – commented out because I consider it very definitely optional # deb http://ftp.debian-unofficial.org/debian/ stable main contrib non-free restricted # deb-src http://ftp.debian-unofficial.org/debian/ stable main contrib non-free restricted # this gets you Linux apps by Google – at the moment, Picasa (image browser/cataloguer) and GoogleEarth (local API for googlemaps) deb http://dl.google.com/linux/deb/ stable non-free ============== sources.list end
Once you’re happy with it, make a copy of each configuration file. That way, if you modify it into uselessness or something eats the file, you can simply use the backup.
# cp source.list source-list-dd-mm-yr (dd-my-yr means day-month-year) # cp preferences preferences-dd-mm-yr