I try to remove my orphans manually for the first time ever and that’s why I’d like to double check with you guys if I’m not missing something big here. Please check below my pacman -Qdt and let me know if I could proceed with such removal.
I already use pamac 9.5.8-1, but I guess it doesn’t work retroactive, therefore I should mark some of those packages as explicitly installed. Is there any standard procedure to identify which of those packages are safe to remove? I’ve seen many cases of people running into big issues upon removing some of the false positives. Thanks.
I don’t know if there is a standard procedure to do this or not. But you can start by marking the packages that you know that are installed by you as Explicitly installed. Some of those packages listed might just be dependencies of the AUR packages.
Omit the --noconfirm switch because your reviewed package list from the 1st command could get alot bigger due to -s switch (recursive) on that 2nd command.
Better take a good hard look at the actual list of packages that are about to be removed when you issue that 2nd command.
The 2 lines of code I pasted above are included within a script originally made by @pux (therefore I will mention him, so he may follow up to your comment if needed) :
Luckily for me, I never ran the second command yet.
That script also contains the yay -Yc command for orphan and yay cleaning. Never knew there was a command to clean yay. Tried it out and it removed 6 packages.
$ sudo pacman -Rsn boost
checking dependencies...
Packages (1) boost-1.72.0-2
Total Removed Size: 175,72 MiB
:: Do you want to remove these packages? [Y/n] n
Quite a big package. According to this, it would remove only the boost package. I would assume it’s safe to remove, since it won’t remove any other package and I could always install it again if any application may complain about it?
Yes, looks that way. It isn’t installed on my system. ``/var/log/pacman.log` tells me, it got removed half a year ago - probably when I cleaned up orphans.
Absolutely.
If any application complains - it should have defined boost as a hard or optional dependency and isn’t packaged correctly.
According to the list of my orphans, it seems only one package belongs to the core, which is syslinux. I’m afraid it may be dangerous if I remove it, but since I use GRUB - at the same time it also looks safe to remove. One last check: do you have syslinux installed?
Pamac already had a reported bug in older versions, therefore I felt like swimming in the unknown. After somewhat unnecessary “panic-mode” steps in order to prevent any damage to my Manjaro system prior to my first orphan removal, I finally succeeded to clean my system by using the above command. Overall, I needed to review the list one-by-one and when I identified the packages I wanted to keep, I did the following (before removing the orphans) to mark them as explicitly installed:
$ sudo pacman -Rsn $(pacman -Qqdt) # Press n
$ # Check your packages carefully and write down those ones that you've installed manually!!!
$ sudo pacman -D --asexplicit atom-editor-bin drawio-desktop-bin viber # The packages that you need
Creating backups is important and this is the routine I relied on for this particular purpose before I removed anything:
sudo su
for x in $(cat pkglist-repo.txt); do pacman -S --needed $x; done
yay -S --needed --nouseask $(< pkglist-aur.txt)
After the pamac command, I restarted Manjaro and used the aforementioned script that additionally cleared 234M of space.
I have freed approx. 1.5G of my disk space by removing those orphans and after some testings, the system seems stable. This was my very first experience in removing the orphans, so I apologize if I raised some eyebrows out there.