You are not logged in.

#1 2018-11-16 17:52:51

ua4000
Member
Registered: 2015-10-14
Posts: 120

[SOLVED] pacman -R - ignore not installed packages

I switched from lxde-gtk3 to lxqt - now I want to perform a clean-up on no more required packages on several machines:

sudo pacman -Rns gpicview-gtk3 lxappearance-gtk3 lxappearance-obconf-gtk3  lxdm-gtk3 lxhotkey-gtk3 lxinput-gtk3 lxlauncher-gtk3 lxmusic-gtk3 lxpanel-gtk3 lxrandr-gtk3 lxsession-gtk3 lxtask-gtk3 pcmanfm-gtk3

The machines are all a bit different, say gpicview-gtk3 and lxmusic-gtk3 are already not installed anymore on a machine.
So the pacman -R fails (error: target not found: gpicview-gtk3) and I have to edit the list of packages.

Is there a way to tell pacman to ignore non-existing packages on remove ?

Thanks very much.

Last edited by ua4000 (2018-11-19 18:21:57)

Offline

#2 2018-11-16 18:03:26

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 8,404
Website

Re: [SOLVED] pacman -R - ignore not installed packages

I would mark the packages as installed as deps (pacman -D --asdeps $list-of-packages), then remove all orphaned deps with 'pacman -Rns $(pacman -Qqtd)'.

'pacman -D' does not abort if a package is not missing, it just prints an error and continues.


Sakura:-
Mobo: MSI X299 TOMAHAWK ARCTIC // Processor: Intel Core i7-7820X 3.6GHz // GFX: nVidia GeForce GTX 970 // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 5x 1TB HDD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2018-11-19 18:21:30

ua4000
Member
Registered: 2015-10-14
Posts: 120

Re: [SOLVED] pacman -R - ignore not installed packages

That's a nice idea.
Nevertheless I think pacman could handle the removal better, instead of hard exiting it could print a warning about the non-existing package and continue after the y/n question.

Thanks anyway for the help!

Offline

Board footer

Powered by FluxBB