Difference between -r and --remove when removing a repository

Viewed 17

To remove a repository we do it manually by removing the row we have added in /etc/apt/sources.list or deleting the file from /etc/apt/sources.list.d. But we can also take advantage of add-apt-repository by adding --remove so in the example above we would have to write the following to remove the existing repository:

$ sudo add-apt-repository --remove 'deb http://archive.getdeb.net/ubuntu wily-getdeb games'.

But I've seen some people write -r instead of --remove and I assume they do the same thing? But I also know that the r flag read all files under each directory, recursively so I wonder what the case would be here. Should you use -r or --remove?

1 Answers

If you do add-apt-repository --help, the help page will tell you that -r is just a shortcut for --remove.

If you wish to be more explicit, for example, in a script that you plan on sharing, using --remove might be a good idea, since it's slightly more readable.

If you're just using the command in your own terminal, -r is faster to type.

Related