50

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

Jorge Castro
  • 73,907
Newbi
  • 2,219
  • 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) – Black Block Nov 28 '11 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 '17 at 19:15

2 Answers2

47

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

Jorge Castro
  • 73,907
29

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 :)

dcharles
  • 4,047
Caesium
  • 16,237
  • 4
    This doesn't prove anything: e.g. /usr/bin/xzcat is a symlink to xz, but works quite differently. – Ruslan Feb 20 '16 at 06:16
  • @Ruslan xzcat is equivalent to xz --decompress --stdout. – Shayan Mar 07 '18 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 07 '18 at 11:30
  • @Ruslan Yep, I added it for reference so others can see why it's different :) – Shayan Mar 07 '18 at 11:47