You are not logged in.

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

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

[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: 11,846
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 MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 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: 418

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