How to add repository from shell in Debian?

  • In Ubuntu one can add a repository via following command -

    sudo add-apt-repository ppa:yannubuntu/boot-repair

    As Ubuntu is based on Debian code base, I was expecting that the same would work in Debian too, but it doesn't.

    • What is the reason for this?
    • Is there some other shell command I can use to achieve the same?

    Note: I know I can edit /etc/apt/sources.list, but I want to achieve this from the shell. I also want to know why the same command won't work when the code base is the same.

  • Jim Paris

    Jim Paris Correct answer

    8 years ago

    Debian Jessie and later (2014-)

    As pointed out by @voltagex in the comments, it can now be found in the software-properties-common package:

    sudo apt-get install software-properties-common

    Debian Wheezy and earlier:

    The program add-apt-repository is available in Debian. It's in the python-software-properties package:

    sudo apt-get install python-software-properties

    It was added to that package in version 0.75. The current version in Debian Stable ('squeeze") is 0.60, so it doesn't have it. The version currently in Debian Testing ("wheezy") is, so it's available there.

    At least in sid, the add-apt-repository script seems to have moved to software-properties-common

    Version 0.92 of python-software-properties here, and (again) missing :-(

    See the comment above yours -- it's now in `software-properties-common`

    had hassles updating though

License under CC-BY-SA with attribution

Content dated before 6/26/2020 9:53 AM