1. Home
  2. Linux

How to use Ubuntu PPAs on Debian Linux

Ubuntu Linux is built off of the Debian Unstable branch and uses the same underlying technologies, such as Apt, DEB packages, and other core components. It is what is known as a “derivative” of Debian Linux.

Although Ubuntu is a derivative of Debian, Debian users cannot use PPAs very easily. The reason? PPAs are a unique technology to Ubuntu, and it requires specialized software to interact with Launchpad. Furthermore, since Ubuntu is based on Debian Unstable, most Debian users will not have the up to date packages that the PPAs require.

Before we begin

in this guide, we will go over how to add Ubuntu PPAs by hand. It is a tedious process, but it is the safest way to go about it, as it is important to understand how PPAs function on the system, and that not every PPA works well Debian. If you do not like the manual method, try using the command below. It should allow you to use PPA commands, just like on Ubuntu.

sudo apt install software-properties-common

Making a backup of software sources

Enabling PPAs on Debian involves making edits to the sources file inside of /etc/apt/ directory. As a result, it is a good idea to make a backup of this file. That way, if any issues arise with PPAs, it can easily be undone.

To make a backup of your software sources in Debian, start by making a copy of the sources.list file with the cp command. Keep in mind that this command must be done as root with the sudo command.

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

Alternatively, if you do not have sudo enabled, use the su command.

su -
cp /etc/apt/sources.list /etc/apt/sources.list.bak

At any time, if something has gone wrong and you need to restore the backup, do the following in a terminal.

Step 1: Delete the broken sources list file from /etc/apt/ using the rm command.

sudo rm /etc/apt/sources.list

or

su -
 rm /etc/apt/sources.list

Step 2: Make a copy of the backup file and rename it as sources.list with the cp command.

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

or

su -
cp /etc/apt/sources.list.bak /etc/apt/sources.list

Step 3: Use the apt update command to refresh the software sources. This command will remove the PPAs, and restore the default repositories.

sudo apt update

Finding PPAs for Debian

Finding PPAs to add to Debian is best done with the Launchpad.net website. The reason? Search engines like Google or Bing or DuckDuckGo often omit certain PPAs, for unknown reasons.

If you’d like to find a new PPA to use on your Debian Linux PC, do the following. For example, to find a PPA for the latest version of Firefox, you’d use the following search term.

firefox ppa

From there, click on the PPA page with the mouse, and you’ll be taken to the PPA page. From here, you will see the PPA description, followed by “Adding this PPA to your system,” and the Ubuntu-specific instructions on how to install it.

Adding the PPA to Debian

Now that you’ve located a PPA to use with Debian, you will need to add the software repository to the system. Follow the step-by-step instructions to learn how to add the PPA on your Debian PC.

Step 1: On the PPA page, locate the green text that says, “Technical details about this PPA.” Then, click on it with the mouse to reveal it. These details are the full repository information that needs to be added to the sources.list file.

Step 2: Launch a terminal window on the desktop by pressing Ctrl + Alt + T or Ctrl + Shift + T on the keyboard. Then, use the terminal to open up the sources.list file in the Nano text editor.

sudo nano -w /etc/apt/sources.list

or

su -
nano -w /etc/apt/sources.list

Step 3: Make your way to the bottom of the sources.list file by pressing the Down Arrow key on the keyboard. Then, write the following text in.

# Ubuntu PPAs

Step 4: Take the code in the “Technical details” section and copy it to your clipboard. Be sure to copy everything.

Step 5: Go to the Nano text editor in the terminal and press Enter to create a new line under # Ubuntu PPAs. Then, press Ctrl + Shift + V to paste the code.

Step 6: Look through the code pasted under # Ubuntu PPAs, and locate YOUR_UBUNTU_VERSION_HERE. Erase it, and replace it with “Bionic,” if you are using Debian 10 Buster. Ubuntu 18.04 Bionic Beaver and Debian 10 Buster are very identical in packages, so PPAs set to Bionic usually have the highest chance of working.

If you have multiple PPAs to add to Debian, please paste them all under # Ubuntu PPAs. It will help you tell which repositories are PPAs.

Note: the code below is an example. Your PPA URLs will differ.

deb http://ppa.launchpad.net/ubuntu-mozilla-security/ppa/ubuntu bionic main


deb-src http://ppa.launchpad.net/ubuntu-mozilla-security/ppa/ubuntu bionic main

Step 7: Save the changes to the sources.list file by pressingĀ Ctrl + O, and exit it with Ctrl + X.

Step 8: Run the apt update command. Once the command is run, an error will occur. This error is “The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY.”

Using your mouse, highlight the number next to “NO_PUBKEY” and save it to the clipboard with Ctrl + Shift + C.

Step 9: Use the GPG key recovery command to fix the “NO_PUBKEY” error with the PPA you’ve added to the system. Be sure to paste the number copied to your keyboard after –recv-keys.

To paste the key number, press Ctrl + Shift + V.

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys YOUR-KEY-NUMBER-HERE

Step 10: Re-run the apt update command, and ensure there are no errors. Assuming there aren’t any errors, install your software from theĀ PPA.

Leave a comment