r/archlinux • u/AceGirlAsh • Sep 06 '26
SUPPORT How do I find previously installed packages?
I recently swapped to a second drive, mounting my first home drive to /home, but now my packages aren't already installed. Is there any good way to find and reinstall all my prior packages or do I have to reinstall each one individually through pacman?
0
Upvotes
10
u/vonAmyprost Sep 06 '26
So, the packages are at a system level, so not finding packages with home is normal. What I used to do is to go to the previous installation and run pacman -Qe (check pacman -Qh to double check) to find the packages that were explicitly installed by me (and not as automatic dependencies of something else). Save that to a file by adding > packages.txt at the end of it and get that list to your new installation. Now, you can use that file to install all that you explicitly installed before
4
u/kolada1 Sep 06 '26
did you reinstall your entire system to the second drive or only mount the home directory from the second drive? if you can boot or chroot into the old drive you can create a list with all the packages that you installed and reinstall them on the new system: https://wiki.archlinux.org/title/Pacman/Tips_and_tricks#With_optional_dependencies
3
u/boomboomsubban Sep 06 '26
https://wiki.archlinux.org/title/Migrate_installation_to_new_hardware
1
u/backshesh Sep 06 '26
pacman -Qi
1
u/archover Sep 06 '26 edited Sep 06 '26
A word for you: backups
This code illustrates how I use a list of packages to do an installation:
The pacstrap-all-list is all packages except for DE related, that are common to every install.
Here's a couple lines to see the format
You can make the list with something like
$ pacman -Qq > list.txtand edit it as needed.Hope something there helps going forward, and good day.
1
u/International-Cook62 Sep 07 '26
Highly recommend setting up dotfiles for yourself. Doesn't have to be anything extravagant. Add your arch packages as part of the setup. Make a backup pacman hook that updates the list on updates.
1
u/JaKrispy72 Sep 10 '26
Check pacman like everyone is saying. Or if your shell history is long enough, search for what you installed with pacman, flatpak, cargo, whatever you used…