How not to end up deleting important stuff while clearing unused (orphan ) packages?

Is it safe to just remove all unused packages using sudo pacman -Scc or using yay -c? Will I end up deleting important packages as well? How can I make sure that there are no important packages getting list of orphaned packages
I see that go and breath2-wallpaper are on there, that is why I feel like this might not go well. Expecially go.

Also will doing sudo pacman -Scc do any damaging changes like deleting important stuff or will it just clear the cache?

-Scc flag is used to clean up all local caches so no important stuff will be deleted. You can use pacman -Rs $(pacman -Qtdq) to remove dependencies that are no longer needed, because e.g. the package which needed the dependencies was removed.

1 Like

From the manpage:

REMOVE OPTIONS (APPLY TO -R)
-c, --cascade
Remove all target packages, as well as all packages that depend on one or more target packages. This operation is recursive and must be used with care, since it can remove many potentially needed packages.

So I’m guessing it’s only safe if you’re very careful, as mentioned there. A safer wat to do this, I’m thinking, would be:

pamac remove $(pamac list --orphans --quiet )

BUT that’s only what I think, and I might be wrong, so if you do this, it’s at own risk.

I have 146 orphan packages, personally, and I leave them. They’re not doing any harm AFAIK.

i just love pamac for cleaning both orphans and cache (and thats about it).

clearing orphans

pamac remove -o

clearing packages deleted from package cache

pamac clean -uv -k 0

clearing redundant package versions from package cache (this keep last 2 versions)

pamac clean -v -k 2
1 Like

pamac list --orphans --quiet gave me the exact same list of packages. Also I have more than a GB worth of disk space used by orphans alone, I was thinking about clearing that up, that is all.

Thanks, cleared cache. So thats done.
About Orphans, the topic you’ve quoted solves half of my concern, but about golang.
But I don’t remember installing golang manually, that probably explains that.
Now I just noticed nodejs is also there and that seems fishy because I am a developer and I do use nodejs often.
Otherwise everything else seems like unused deps. So I’m gonna ahead and remove all stuff. I can just re-install node.

golang is a make dependency of yay which is used while installing yay. You can safely delete it. Same case for nodejs

I haven’t tried using pamac much. Do you prefer pamac over the other options?

I just checked. Mine uses more:

$ pamac remove --orphans

[...]

Total removed size: 2.5 GB

Apply transaction ? [y/N] n

Transaction cancelled.

But as I have enough space:

$ df /                                                                                                                                                                                                                                               

Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme0n1p2  221G  124G   86G  60% /

I don’t worry.

Thats 's nice but I don’t have much so… I was clearing some junk
Thanks

Thanks, removed stuff. All is cool it seems. I’m gonna go ahead and mark this as solved.

1 Like

Then I think that pamac command would be good.

i use pamac only for the functionality i listed, not that i think it is inferior. just that for installing/upgrading/removing packages, IMO pamac gives me the sense of being in control of whats happening and less like likeliness of failure inbetween operations.

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