About Launchpad PPAs
On Debian 7
add-apt-repository is a script specifically developed for the Ubuntu distribution that allows adding or removing repositories and that automatically imports the public GPG key required to use these repositories.
As of Debian 7 it is possible to use add-apt-repository to add Launchpad PPAs. However, there are a few things to know before using it.
To add a Launchpad PPA in Debian, as in Ubuntu, use the following command:
sudo add-apt-repository ppa: you / ppa
Obviously you have to replace ppa: you / ppa for the PPA you want to add.
However, if a PPA is added in this way, the source file of the PPA will use the current version of Debian (for example, »wheezy»). If we run an apt-get update we will see a 404 error, as there are no packages for Debian Wheezy in the Launchpad PPA repositories. They are all packages built for different versions of Ubuntu. How to solve it? Simple, you have to change the source file of the PPA and indicate the packages of which version of Ubuntu we want to use.
To get it to work correctly, then, after using the command "ppa add-apt-repository ppa: tu / ppa", you have to edit the source file of the PPA that is in the /etc/apt/sources.list folder .d /, and replace the Debian version (eg "wheezy") with an Ubuntu version. At this point, it is advisable to use an LTS version of Ubuntu.
Here is an example. Let's say we add the webupd8team / java ppa in Debian Wheezy using "add-apt-repository: webupd8team / java". As a result, the file /etc/apt/sources.list.d/webupd8team-java-wheezy.list must have been created. We edit it with the following command:
sudo nano /etc/apt/sources.list.d/webupd8team-java-wheezy.list
This file should contain two lines:
deb http://ppa.launchpad.net/webupd8team/java/ubuntu wheezy main deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu wheezy main
It only remains to change "wheezy" by the code name of the Ubuntu distribution that we want to use. In this case, for example, we can use Trusty, the latest LTS version of Ubuntu. After editing the file, it should look like this:
deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
Finally, you just have to run:
sudo apt-get update
This will update the list of packages, now taking into account the packages hosted in the newly added PPA repositories.
In older versions of Debian
In older versions of Debian, if the add-apt-repository command is not available, the repository can be added manually by editing the file / Etc / apt / sources.list and adding the key with apt-key.
All of this information can be found on the PPA's Launchpad website, under the section titled "Technical details about this PPA," as seen in the screenshot below:
First we import the key with the apt-key command:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886
Obviously, you have to replace EEA14886 with the key of the PPA you want to add.
1024R / EEA14886 (What is this?)
As you can see, the key to use in the apt-key command is after the forward slash.
Once this is done, add the corresponding deb lines at the end of the /etc/apt/sources.list file.
The trick here is to choose a version of Ubuntu "equivalent" to the version of Debian we are using on the PPA website. This will generate the corresponding http addresses, as seen in the screenshot above.
Once we have the http addresses of the PPA, we can use a text editor or simply run the following from a terminal to add them to the end of the /etc/apt/sources.list file:
echo 'deb deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main' >> /etc/apt/sources.list echo 'deb deb-src http://ppa.launchpad.net/webupd8team/ java / ubuntu trusty main '>> /etc/apt/sources.list
Finally, we update the package list:
sudo apt-get update