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

-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