46

Difference between add-apt-repository & apt-add-repository ?

2
  • first time to know that there is a apt-add-repository command i always see it add-apt-repository, it is good as i always use command in the form of sudo apt-get update and sudo apt-get upgrade and apt-add-repository has the same form (Good) Nov 28, 2011 at 23:02
  • Is there a corresponding command for the newer apt command? I know there is apt edit-sources which lets one edit the /etc/apt/sources.list file with a text editor. But is there a quick way to add/remove sources with just the apt command?
    – mbigras
    Feb 22, 2017 at 19:15

2 Answers 2

43

They're the same command, someone just added the inverse because people kept mixing the command up and typing it wrong.

0
27

An easy way to find this out would have been:

minibun:~> ls -l `which apt-add-repository`
lrwxrwxrwx 1 root root 18 2011-08-26 15:36 /usr/bin/apt-add-repository -> add-apt-repository

You can see that apt-add-repository is simply a symlink to add-apt-repository :)

4
  • 4
    This doesn't prove anything: e.g. /usr/bin/xzcat is a symlink to xz, but works quite differently.
    – Ruslan
    Feb 20, 2016 at 6:16
  • @Ruslan xzcat is equivalent to xz --decompress --stdout.
    – Shayan
    Mar 7, 2018 at 11:06
  • 2
    @Shayan exactly, and my point was that the mere fact that a name is a symlink to something doesn't prove that the functionality between two names is identical.
    – Ruslan
    Mar 7, 2018 at 11:30
  • @Ruslan Yep, I added it for reference so others can see why it's different :)
    – Shayan
    Mar 7, 2018 at 11:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .