How to add PPA repositories to Debian and distributions based on it

One of the great advantages that Ubuntu has over other distributions is the large number of applications available for this distribution and the ease of installing and keeping them updated through PPA repositories through Launchpad.

Unfortunately the command

add-apt-repository

It is only available for Ubuntu, so adding these repositories is not so easy when you want to add it in a distribution like Debian or based on this you can generally make use of the .deb packages created for Ubuntu.

This is not to say that we cannot make use of these repositories in Debian, since Debian also provides a way to add custom repositories, and then we are going to learn how to do it.

First of all we must understand how repositories are managed in Debian. Which are housed in the file

/etc/apt/sources.list

like all Debian-based distributions, including Ubuntu, and has the following format:

deb http://site.example.com/debian distribution component1 component2 component3 deb-src http://site.example.com/debian distribution component1 component2 component3

The first word in each line (

deb

,

deb-src

) means the type of file found in the repository. In the case of

deb

, it means that the file available in the repository is a binary type installable file, packaged as

.deb

for Debian or distributions based on it. And in the case of

deb-src

, it means that the repository contains the source code of the application.

The distribution may well be the name of the distribution (lenny, etch, squeeze, sid) or the type of package (stable, oldstable, test, unstable).

The components already depend on the repository distributor, for example in the case that we are going to use as an example, these are main, multiverse, restricted and universe.

Now that we know how repositories work in Debian, let's learn how we can add a PPA repository in Debian or distributions based on it.

The first thing to do is find the PPA repository page in Launchpad. We can do this generally by typing in a search engine like Google the name of the PPA repository.

In this manual, we will use the PPA provided by the stable version of ubuntu tweak, ppa: tualatrix / ppa.
In case of not finding the link to the repository page in the search engine, we can directly enter launchpad.net and in the search engine write the name of the PPA repository.

Launchpad Search Box

Following this, we search among the results for the repository page that interests us, finally reaching the site we are looking for, where we will find all the information we need to be able to correctly add the repository in Debian.

Launchpad search results

On the PPA repository page we can find a link in green that says "Technical details about this PPA", we click on this link and we will find the technical information about the repository in question, this information is precisely the addresses

deb

y

deb-src

that we need to add inside the file

/etc/apt/sources.list

which controls the repositories on Debian.

Launchpad GPG Key

Additionally, we can see a drop-down menu with the list of distributions supported by this application. In the best of cases, you will find the latest version of the application for all distributions, but in some cases, each distribution has a different version of the package, being generally older in older distributions. (note that this menu automatically changes the parameter distribution in the repository to make it easier for you to include it in the file

/etc/apt/sources.list

)

Launchpad distribution version

In these technical details we can also find the number of the public key that we will use to digitally sign the repository. This helps us so that the system verifies the validity and security of the repository that we are using.

After knowing all this very important information, we come to the part that we all expected, first of all, we must open the /etc/apt/sources.list file to add the new repository. We can do this by executing the following line in the terminal as root:

gedit /etc/apt/sources.list

With the file open as root, we go to the end of the document and add the repositories to ubuntu tweak (You can add a comment to be more clear about where the repository comes from).

# Ubuntu-Tweak repository by Tualatrix Chou deb http://ppa.launchpad.net/tualatrix/ppa/ubuntu maverick main deb-src http://ppa.launchpad.net/tualatrix/ppa/ubuntu maverick main

With the repository entered in the file

/etc/apt/sources.list

, we can save and close the document.

At this point we already have the repository in the list of Debian repositories, but we may have problems updating this list because Debian may consider the repository unsafe and not download the list of packages it contains.

To avoid this, we will install the public key of the repository by executing the following command in the terminal where we will include the number indicated as the public key in the previous image (X).

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0624A220

If everything goes well, we will see a text like the following in our terminal:

Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg - keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv-keys 0624A220 gpg: requesting key 0624A220 from hkp server keyserver.ubuntu.com gpg : code 0624A220: «Launchpad PPA for TualatriX» unchanged gpg: Total amount processed: 1 gpg: unchanged: 1

If this was the result, we can now calmly update the list of repositories and install the application with the following command:

aptitude update && aptitude install ubuntu-tweak

Final notes:

  • Please note that not all applications of Ubuntu they will work correctly on Debian or the distributions based on it.
  • You must carefully choose the version to use in the packages, since these can lead to the breaking of some dependencies especially in distributions like Debian stable, which does not always provide the latest versions of the packages.

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Eduardo said

    Thanks David, it's a great post and a great contribution to make our beloved Linux more accessible. Sure, didactic, simple, if everyone wrote like you there would be thousands more GNU / Linux users. Those things that can be very simple for the connoisseur are difficult for the novice and generally when looking for that help they send you to Google or read thousands of posts "so you can learn." Once again thank you and congratulations

    1.    David Gómez said

      Thank you very much Eduardo, your comment encourages me to continue writing.

  2.   hiram said

    Greetings David, many thanks for the tutorial, everything went to perfection, I already have the ubuntu tweak in my lmde have a good day

  3.   Daniel said

    David, you're the same one who writes the http://120linux.com?

    Greetings.

    http://microlinux.blogspot.com

    1.    David Gómez said

      Yes Daniel, I am the same one who writes in 120% Linux.

      1.    Daniel said

        Ahhh ok… xD I'm the other writer… 😛
        I did not know that you will work in 2 ... is this yours?

        Greetings.

        1.    David Gómez said

          No this is not mine, I am currently in ubunlog.com, 120linux.com and ubuntizadoelplaneta.com

          I left mine temporarily because I'm in a different project.

          1.    Daniel said

            ahhh ok 😀 I do have a blog that is mine and that I have been starting for about 2 months and a little ... take a look and give me your opinion plisss

            blog: http://microlinux.blogspot.com

            Email: daniel.120linux@gmail.com


  4.   Makova said

    Thank you very much David, it is excellently written and explained, I have finally learned to add repos in my Linux Mint Debian.
    I've only been using and learning with free software for 4 months, I started like many with ubuntu and I have installed, uninstalled, made countless errors and solutions with Linux Mint 9, Kubuntu, Zorin OS 4, Ubuntu 10.04 and 10.10, but the great personal challenge that I have is learning how to build the kernel and install Debian and know how to work with it. I also study the Python language in my spare time and later continue with C ++ and Java. Anyway, I have great aspirations and illusions, if when I picked up a script for the first time, someone had told me about free software, but hey, "it's never too late if happiness is good."
    From today added to my favorites.
    Regards…

    1.    David Gómez said

      Thank you very much for the comment and I encourage you with your goals, because in free software we need many people just like you.

  5.   Makova said

    Can I add grub ?, from Maverick or Lucid ?, on Linux Mint Debian.
    I already have the grub but the repos gave me a password error;
    W: GPG error: http://ppa.launchpad.net maverick Release: The following signatures could not be verified because your public key is not available: NO_PUBKEY 55708F1EE06803C5
    So I removed them, now could you still add them?
    Regards…

    1.    David Gómez said

      You have to be very specific in which repository you want to add to install Grub, because the truth is I don't really understand what the problem is.

  6.   Makova said

    Thanks, in the end I added Lucid's ppa-grub since Maverick's is missing.
    The problem was that I installed the grub to have the background image of the multiboot loader more beautiful, I installed everything well except the repos that gave me the error that I mentioned before. But I think I have already solved it thanks to your great tutorial.
    Regards…

  7.   Makova said

    Sorry it's Grub 2.

  8.   Makova said

    Wow, I'm not clear, it's the BURG GRUB for Grub 2.
    Regards…

    1.    David Gómez said

      I understand, you are trying to install Burg, it is like a fork of Grub to make the startup look much more attractive.

      Read this guide that I wrote, to know a little more about how to install it in Ubuntu (it may be useful for Mint) http://www.wereveryware.com/2010/07/como-instalar-modificar-y-eliminar-burg.html

  9.   Jose Salazar said

    thanks david I was looking for something like that, for some libraries that I need but in the end when trying to do
    apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0624A220

    I did not download the key so I wanted to know how I do in this case thanks….

    1.    David Gómez said

      First of all, what is the repository you are trying to install and on which distribution?

      1.    Jose Salazar said

        the one you published with this tuto

        # Ubuntu-Tweak Repository by Tualatrix Chou
        deb http://ppa.launchpad.net/tualatrix/ppa/ubuntu maverick main
        deb-src http://ppa.launchpad.net/tualatrix/ppa/ubuntu maverick main

        I am trying to update or install libgpod4 in its version 0.7.95-1

        since I have an iPhone 3gs and it does not recognize me in debian and I have squeeze and they just go there for 0.7.93 and it works from 95, I tell you because I made it work on my laptop, but I had to compile it and install it by hand, what I want is to save myself that work because there are many dependencies and it is tedious so I don't know if it makes it easier for me like this, although I think (NOSE) that it cannot be done since the same packages that depend on the libgpod depend on others the same you see and I ended up exploding all hahaha… well what could be done in that case ??? thanks in advance and for the answer….

        1.    David Gómez said

          José, the problem I see in the line you run to install the Ubuntu-Tweak key is that you are using a script (-) instead of two (--) before the commands keyserver y recv-keys.

          Correct that and try again to get the key.

          1.    Jose Salazar said

            no, I already did it and nothing, do not open another way to download and install it by hand ???

            I tried how you told me:

            # apt-key adv –keyserver keyserver.ubuntu.com –recv-keys 0624A220

            and I get this:

            Executing: gpg –ignore-time-conflict –no-options –no-default-keyring –secret-keyring /etc/apt/secring.gpg –trustdb-name /etc/apt/trustdb.gpg –keyring / etc / apt / trusted.gpg –primary-keyring /etc/apt/trusted.gpg –keyserver keyserver.ubuntu.com –recv-keys 0624A220
            gpg: requesting key 0624A220 from hkp server keyserver.ubuntu.com
            ?: keyserver.ubuntu.com: Connection timed out
            gpgkeys: HTTP fetch error 7: couldn't connect: Connection timed out
            gpg: no valid OpenPGP data found
            gpg: Total amount processed: 0

            Nothing is downloaded, I don't know if it will be down or open another source or what would you recommend me better ...


          2.    David Gómez said

            José, read the following line in which I answer you ...


  10.   David Gómez said

    Hi José, I already tried the key and there is no problem with it, I don't understand why your computer can't download it.

    Here is the link to the public key http://keyserver.ubuntu.com:11371/pks/lookup?op=get&search=0x6AF0E1940624A220.

    I recommend you read these two Seek 'N Geek entries where they teach how to troubleshoot public keys:

    Tell me how it went, in the meantime I'm going to virtualize Debian to help you in a better way, ok?

  11.   Jose Salazar said

    Ready, I solved, I had problems because I don't know what I had to do but the firewall was blocking the server and wouldn't let me download it, layer 8 error hehehe, what I'm trying to update libgpod4 0.7.95-1 but it's difficult because of the dependencies but I'm going to see…. Thanks a lot….

  12.   Jose Salazar said

    David, a question, do you know that I give aptitude update and it ignores those lines, that is, it does not load the ubuntu sources at all, I do it graphically through the ubuntu-tweak and I medice failure of the rest the other debian ones if they load me, why does that happen? ?

    1.    David Gómez said

      José, it may simply be that the application is not compatible with Debian, you are trying to install Ubuntu Tweak that is specially created for Ubuntu.

      I haven't been able to download Debian yet, I always get a download problem, that's why I can't help you at the moment, if you want to send me an email with your contact info and I'll let you know what I can find.

  13.   dayer said

    Hello. I would like to give a point of view on organizing the repositories if I may.
    Inside «/etc/apt/sources.list.d/» you can add auxiliary files —with a «list» extension —that also contain repositories, so that for example you can create one called «ubuntutweak.list» to the case covered in this tutorial.
    This ensures that the /etc/apt/sources.list file only contains the official Debian repositories.

    A greeting.

  14.   williamd said

    Thanks 🙂 this info helped me a lot, everything was always lost when I entered launchpad.

  15.   Adrian seimandi said

    I'm going to revive a dead issue, sorry .. I ask you, how safe is it to install applications from these repositories that are not the ones that my default distribution brings? . Thanks