Include a remove-apt-repository ?

Asked by Loofy

Hi...

I was thinking maybe this could be a good thing to have? Also an easy way of removing a certain repository?

The command then needs to display what you have installed from that particular repository. And optionally if you want to remove it during the removal of the repository.

Best Regards
Fredrik L

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu software-properties Edit question
Assignee:
No assignee Edit question
Solved by:
Mark Rijckenberg
Solved:
Last query:
Last reply:
Revision history for this message
Best Mark Rijckenberg (markrijckenberg) said :
#3

Here is more information:

sudo add-apt-repository --help
sudo: unable to resolve host new-host-2
Usage: add-apt-repository <sourceline>

add-apt-repository is a script for adding apt sources.list entries.
It can be used to add any repository and also provides a shorthand
syntax for adding a Launchpad PPA (Personal Package Archive)
repository.

<sourceline> - The apt repository source line to add. This is one of:
  a complete apt line in quotes,
  a repo url and areas in quotes (areas defaults to 'main')
  a PPA shortcut.
  a distro component

  Examples:
    apt-add-repository 'deb http://myserver/path/to/repo stable myrepo'
    apt-add-repository 'http://myserver/path/to/repo myrepo'
    apt-add-repository 'https://packages.medibuntu.org free non-free'
    apt-add-repository http://extras.ubuntu.com/ubuntu
    apt-add-repository ppa:user/repository
    apt-add-repository multiverse

If --remove is given the tool will remove the given sourceline from your
sources.list

Options:
  -h, --help show this help message and exit
  -m, --massive-debug Print a lot of debug information to the command line
  -r, --remove remove repository from sources.list.d directory
  -k KEYSERVER, --keyserver=KEYSERVER
                        URL of keyserver. Default:
                        hkp://keyserver.ubuntu.com:80/
  -y, --yes Assume yes to all queries

You can use the add-apt-repository in combination with the following command

find /etc/apt -name '*.list' -exec bash -c 'echo -e "\n$1\n"; cat -n "$1"' _ '{}' \;

to determine which repositories you want to delete.

Your arguments are valid and so I suggest contacting Chow Loong Jin <email address hidden>

I hope Chow Loong Jin is still working on it.

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#4

I also suggest posting your suggestion here:

http://brainstorm.ubuntu.com/user?destination=ideatorrent/submit/

Revision history for this message
Loofy (loofy) said :
#5

Hi,

Great! Even better already implemented.. Just me not reading the manual sorry for that. :)

I will note the brainstorm url.

Thanks..

Best Regards
Fredrik L

Revision history for this message
Loofy (loofy) said :
#6

Thanks Mark Rijckenberg, that solved my question.