The forbidden terminal command has nuked me

sudo pacman -Rns $(pacman -Qdtq)

I ran this command to fully get rid of any residual marks of a package I had installed ‘arch-parental-controls’. I decided just using a DNS would get the same result more simply. But by running the above command I completely wiped out all kinds of Orphan packages that it turns out were kind of important.

Now Steam won’t run a single game, I’ve lost previously established settings on my PC, and my backlight slider has vanished and the machine only displays MAX brightness. I’ve attempted to use logs to find out what packages were removed but the logs only records the current day and then disappears. I had some Time Shift saves but they date all the way back to 2022 so they’re no good to me either.

I’m running the Zen kernel on this hardware. ASUS ROG Strix G15 Advantage Edition 15.6” (512GB SSD, AMD Ryzen 9 5000 Series) Gaming Laptop

Any advice for how I can begin to restore my machine? The main things i’d like to solve ASAP would be getting Steam working properly again and getting the backlight slider to both appear and work. But any of those lost orphans I can save I’ll be happy to have back.

Does this provide you with a list of removed packages (change the date accordingly) ?

grep "removed" /var/log/pacman.log | grep 2026-07-10 | awk '{print $4}'   

You could then selectively re-install the ones you think you need --asdeps (as dependencies).

sudo pacman -S --asdeps somepackage

If they were truly orphans though, it seems strange you’d have issues after removing them, and re-installing them --asdeps might result in them being cleaned up again the next time you clean up orphans if they’re not connected to any installed packages as a dependency.

But perhaps I’m missing a nuance of the sudo pacman -Rns $(pacman -Qdtq) command :thinking:

I suspect this worked rather too aggressively in your case.

Next time run pacman -Qdt first and check what is about to be removed before running the original command from above.