Is adding the Debian repository to my apt source.list dangerous on Ubuntu?

It's a bad idea to install binary packages from Debian on Ubuntu. But it's a good idea to install packages from source! So here's how:

It's not that hard. Here's how to do it (instructions taken from my old note at http://www.asheesh.org/note/backporting-with-apt-src.html ):

Step 1: Make sure you have an appropriate deb-src line

Backporting is the process of taking source packages and compiling them on your Debian(-like) system. The easiest way to find Debian "source packages" is the same way you find Debian "binary packages": apt-get and its configuration.

Make sure you have this line in /etc/apt/sources.list:

deb-src http://ftp.debian.org/debian/ unstable main

APT provides a command "apt-get source" that looks in these deb-src lines (rather than plain binary deb lines) and downloads source packages. In this tutorial, you'll use "apt-src" which is a convenient wrapper around "apt-get source".

Step 2

apt-get update

Step 3

sudo aptitude install apt-src

apt-src is a helper program that makes compiling source packages easy. It's not necessary, but it prevents you from having to type too many commands.

Step 4

 apt-src -bi install $package

If you wanted to install 'alpine', run this:

apt-src -bi install alpine

The "b" stands for "build", the "i" stands for "install the resulting package", and the word "install" means "download the source for alpine as found in a Debian source line from sources.list". apt-src will "install" the source into the current directory, make sure you have all the required packages to build the package (a process called "satisfying the build dependencies"), build it, and install the resulting .debs.