Bad use recursive pacman -R $(pacman -Qdtq)

I restarted my desktop running manjaro and it fails to boot… and gets stuck in the motherboard flash screen at startup.

The last command i ran was :
pacman -R $(pacman -Qdtq)

Its really urgent please help me out.

you’ll have to boot into a LiveCD and chroot into your install then run
journalctl -b
which would give you a boot log. Look into the boot log and find what went wrong. If a needed package was remove then you can install it from the chroot.

1 Like

never do that pacman -R $(pacman -Qdtq)
too many package has been removed

if you do that you know what exactly your are doing

1 - boot on USB iso manjaro
2 - chroot to read in /var/pacman.log what has been removed ( list ALL packages )
3 - try to add for pacman -S

1 Like

…and once again we say … why automatic removal instead of inspect ?

Always run

pacman -Qqdt

then decide what you want to remove ala

sudo pacman -Rns package1 package2
1 Like

Minor amendment: More details are given with

pacman -Qdt
1 Like

Yes thank you, i had used it to autoremove unused packages but ended up removing my display driver, i pressed ctrl + alt + f2 toh open a terminal at boot… and installed it… that fixed the problem thank you.

1 Like

That’s interesting as the the following is recommended in the arch wiki

pacman -Rns $(pacman -Qtdq)

New users like myself tend to look up recommendations like that. Is there a significant difference to this command that makes it safer? From what I have read in the documentation the -Rns ought to be as critical as just the -R.

I linke the arch wiki entry below.
https://wiki.archlinux.org/index.php/Pacman/Tips_and_tricks#Removing_unused_packages_(orphans)

Great that you could fix it. Nevertheless, it’s a bit unusual that the display driver was removed. Could it be that you used the cascade option

-c, --cascade

when applying the pacman command? You could simply check your /var/log/pacman.log file to evaluate what command you actually used.

1 Like

Please show the actual pacman command used:

$ grep '\[PACMAN\] Running' /var/log/pacman.log | tail

It says to recursively remove all orphans automatically do that.
It doesnt suggest running it.

That said … Rns is recursive and removes save files, as opposed to R which just uninstalls.

The point is that just because something is an orphan it doesnt assure you dont need/want it.

1 Like

The whole thing concerning orphans seems a bit tricky to me - it looks like everything that isn’t referred by another package is listed with pacman -Qdt, in my list there are some packages that are just top of that chain…

1 Like

Thank you for clarifying that point.

Yes i referred to it and ended up with no display driver

No i used exactly what i wrote initially… not cascading

You’re forgetting an additional but very important condition: “not explicitly installed” packages.

1 Like

Of course you are right…

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