Which way to delete packages with pacman

I have found this alias on my fish.conf
alias rmpkg="sudo pacman -Rdd"

Are there benefits of using this alias instead of sudo pacman -Rns

https://wiki.archlinux.org/title/pacman
To remove a package, which is required by another package, without removing the dependent package:

Warning: The following operation can break a system and should be avoided. See System maintenance#Avoid certain pacman commands.

pacman -Rdd package_name

3 Likes

First @sammiev :wink:

4 Likes

Hi, with alias you can use any name you wish and can remember. Myself I just use the real command.

3 Likes

I understand how aliases work, I wonder about which one to always use and never break stuff

They are both the same. You create it to use the command.

3 Likes

I think I should use sudo pacman/yay -Rns for "big" ( packages ) and sudo pacman/yay -Rdd for small ones.
Correct me if I'm wrong which I probably am

If you open up a 'Terminal' and type 'man pacman' you will see what choices do what.

3 Likes

For sure but I also think that you should modify the alias to -Rns cause that should be default and used most of the time according to what I've read

-Rns is what I use. Hearing-Rdd for the first time and personally I never used it :eyes:
For me -Rns makes more sense, since, after uninstalling a package, it's orphans are useless.

4 Likes

Dito, best way to get rid of all the leftovers automatically. :innocent:
I occasionally use -Rdd for special purposes such as getting rid of a few packages which are dependency of another package (absolutely not recommended btw, depends are there for a reason) but not needed for my own setup.

7 Likes

And sudo pacman -Rns $(pacman -Qtdq) will remove orphans.

And please see Pacman Rosetta for more comprehensive, human-readable information.

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.