What are the commands for purging all packages from a specific repository only, and removing it?

8 risposte [Ultimo contenuto]
strypey
Offline
Iscritto: 05/14/2015

I added a https://deb.nodesource.com/node_8.x repository to install some npm stuff we were using at a hackathon. I no longer need any of that stuff, and I'd like to purge all packages installed from those repos and remove them. But I can't remember which packages I installed.

I tried using the "Origin" tab in Synaptic, which shows a list of installed packages available from each repo on the system. But for some reason the deb.nodesource repo doesn't show up there (all my other default and added repos are there).

How do I purge all packages installed from this repo and remove it?

boba
Online
Iscritto: 08/28/2017

You might want to try ppa-purge -h.

strypey
Offline
Iscritto: 05/14/2015

Boba:
> You might want to try ppa-purge -h

Will that work if it's a deb repository not a PPA (not sure either way). The URI is: https://deb.nodesource.com/node_8.x

boba
Online
Iscritto: 08/28/2017

I would try it and replace the respective options according to the name of the /var/lib/apt/lists file:

-p [ppaname] PPA name to be disabled (default: ppa)
-o [ppaowner] PPA owner
-s [host] Repository server (default: ppa.launchpad.net)

and following this:

PPA_LIST=/var/lib/apt/lists/${PPAHOST}_${PPAOWNER}_${PPANAME}_*_Packages

For instance, to remove tor, which current list file on my system is named: deb.torproject.org_torproject.org_dists_xenial_main_binary-amd64_Packages I would try to use: sudo ppa-purge -s deb.torproject.org -o torproject.org -p dists -d xenial

boba
Online
Iscritto: 08/28/2017

In your case, this might do the job: sudo ppa-purge -s deb.nodesource.com -o node_8.x -p dists -d xenial

Note that:

1. ppa-purge will let you know about what it is intending to do and ask you for confirmation before modifying anything on your system.

2. the following option: -d xenial is needed only because we are on Trisquel (without it ppa-purge would be unsuccessfully looking for 'flidas').

3. when I try it with tor, two extra packages are reverted to their older flidas version because the torproject repository had interfered with them at some point, and thus need to be upgraded again (python3-certifi and python-ipaddress). So be aware of the possibility of this kind of interference.

andyprough
Offline
Iscritto: 02/12/2015

This is amazing! I'm old school, I just 'cat /var/log/apt/history.log', and look for the dates when I was installing the packages.

boba
Online
Iscritto: 08/28/2017

What if the aforementioned dates have decided to side with the package names and keep escaping you?

Many times I gave up on "cleaning" my packages because I had no clue about what/when/how I had installed some exploratory stuff. There was no world ending, of course, and the situation was cleared anyway after the next fresh install, but the ppa-purge command could have spared me some time.

andyprough
Offline
Iscritto: 02/12/2015

> What if the aforementioned dates have decided to side with the package names and keep escaping you?

As I said, it sounds amazing. I will definitely have to try it. In fact, I have an upcoming need for it, as I am planning to install the latest KDE desktop from the Debian Sid repos to try it out, and then to get rid of it all.

boba
Online
Iscritto: 08/28/2017

> I tried using the "Origin" tab in Synaptic, which shows a list of installed packages available from each repo on the system. But for some reason the deb.nodesource repo doesn't show up there (all my other default and added repos are there).

Is the corresponding line in sources.list commented out, or the corresponding box in Software & Updates unchecked?