is orphans package safe to remove ? i use pamac , and do i need commands for remove orphans package or i can just remove form pamac?
Only you can answer that. You need to review the list of orphans and see if they are things you need or not.
An orphaned package is simply a package that was brought in as a dependency and the there are no longer any packages requiring it. However, that doesn’t mean you are no longer using it. This is especially true if you use meta-packages.
It is up to you to decide which method you prefer. The important part is to carefully review the list before removing them.
example gimp install, some package are installed with gimp . if i uninstalled gimp then only gimp uninstalled but what about other packages ?
It depends how you remove gimp.
But yes, that can leave orphans behind and it would probably be safe to remove those. However, that doesn’t mean removing orphans is a universally safe operation.
The key to removing orphans, as stated above, is to carefully review the list. If there is nothing you need on it, feel free to remove them.
You can try using
pacman -Rns (Warning: this is NOT the most recommended way to removal, so use caution please) will remove the target package and all packages that were installed as dependencies for that package that aren’t required by any other packages.
sudo pacman -Rns gimp
[scott@endeavourOS ~]$ sudo pacman -Rns gimp [sudo] password for scott: checking dependencies... :: gdk-pixbuf2 optionally requires libwmf: Load .wmf and .apm :: graphicsmagick optionally requires libwmf: wmf module :: imagemagick optionally requires libwmf: WMF support :: poppler optionally requires poppler-data: highly recommended encoding data to display PDF documents with certain encodings and characters Package (5) Old Version Net Change libmypaint 1.6.1-1 -1.09 MiB libwmf 0.2.12-2 -3.24 MiB mypaint-brushes1 1.3.1-1 -2.32 MiB poppler-data 0.4.11-1 -12.33 MiB gimp 2.10.30-1 -112.12 MiB Total Removed Size: 131.10 MiB :: Do you want to remove these packages? [Y/n]
Before accepting the full removal of gimp and it’s other dependencies you have to know and/or figure out if these other packages are okay to removed or not as well.
The reason I never do that is that
-Rs removes optional dependencies of other packages.
I’ve edited my post to mention a caution warning. I’ve used the -Rns command a handful of times myself, usually I just use -R to remove a package, or when I did use -Rns, it was only removing one package anyways, so the harm was minimal if any. I am careful to remove things; honestly most of the time I’ll just leave optional/orphaned packages installed, they don’t usually take up much space.
Depends on what you mean by “safe”. If you remove more than you want, you may miss them, and their absence may break functionality in other software. But typically, you can just reinstall what you’re missing later.
There is no simple universal answer here, except that you should understand what each package does and what it depends on and what depends on it (you can find out using the
pacman -Qi and
pacman -Si options for that, as well as
I am not sure it needs a warning. Lots of people remove packages that way. I was just pointing out that it wasn’t my preferred method for the reasons stated above.
If we’re not following in the footsteps of the al’mighty @dalto then we’re doing it wrong you’re advice is solid like 99.9% of the time
No!!! Don’t follow advices of super-advanced AI, we all gonna die, it’s Skynet!!!1
btw @dalto , i wonder if using
pacman -Rnss (double
-s) option mean that it won’t remove optional packages for other packages?
-s, --recursive Remove each target specified including all of their dependencies, provided that (A) they are not required by other packages; and (B) they were not explicitly installed by the user. This operation is recursive and analogous to a backwards --sync operation, and it helps keep a clean system without orphans. If you want to omit condition (B), pass this option twice.
Not sure that i understand wording correctly here…
I thought that meant it will remove them even if they are explicitly installed.
Oh ok…then it’s even worse
i’m not typing commands for uninstall package/apps for all time, and i tried many software as i can ,i use pamac - after uninstall gimp some packages still in my pc , named orphans i guess , so if i remove all orphans files so thats can harm pc or its only for software packages removal ?
Again, nobody can answer this for you because we don’t know which packages you have that are currently orphaned or if you still need them.
Orphans are packages that were brought in as dependencies of other packages that are no longer needed by those packages. However, that doesn’t mean you don’t need them.
In the best case, removing orphans can remove a bunch of packages you don’t need anymore. In the worst case, it can remove your entire DE and substantial portions of your software leaving you sitting at a TTY.
When you remove orphans, carefully review the list and decide for yourself if you can remove them.
seriously it can remove my entire DE?
Yes, if you let it.
Nothing is done without your approval.
You could use
pactree X pactree -r X
to see the dependency and reverse dependency tree for the package X. This will help you to connect the dots between a certain package with what it is depending upon and what is depending on it.
I know that after irregular shutdowns (such as pressing the power button or a power outage), the orphans are removed at boot time. At least this appears during boot in systemd system messages. How safe is this operation?