Sunday, December 8, 2013

Some Debian tricks

Now that I'm back using Debian, I'm finding there are new tricks I've needed to learn since the way repositories are run have changed.

Adding an Ubuntu PPA to sources.list


Often a current package binary exists for Ubuntu via PPA, but not for Debian.  The quick fix is to just add the PPA as a source to your /etc/apt/sources.list :

Go to https://launchpad.net/ubuntu/+ppas‎ and search for the package you are interested in.

Once on the package page click on the "Technical details about this PPA" link and choose the Ubuntu version that best corresponds to the Debian release you are using.  Change this if you see dependency problems.

Add the resulting lines to your sources.list file.  Then in a terminal:

sudo apt-get update

You will see an error that says something like "public key is not available: NO_PUBKEY  [TheKey-NumbersAndLetters]".  

Adding a new public key

To add the key type the following:

sudo gpg --keyserver pgpkeys.mit.edu --recv-key [TheKey-NumbersAndLetters]
sudo gpg -a --export [TheKey-NumbersAndLetters] | sudo apt-key add -

Then try to update again

sudo apt-get update

Now you should be able to install the package via apt-get or your package manager.

Enabling Debian Sponsored packages:


Search for the package at http://mentors.debian.net/packages/index

if it exists, add the following line to your /etc/apt/sources.list

deb-src http://mentors.debian.net/debian unstable main contrib non-free

then at a command line

sudo apt-get update
sudo apt-get build-dep [packageName]
sudo apt-get source -b [packagName]
sudo dpkg -i *.deb

If you gt any errors at the build-dep step, just install those dependencies.


Auto-installing reccomended dependancies:

apt install packagename --install-recommends