You are not logged in.

#1 2025-12-11 22:29:24

Dave_G
Member
Registered: 2021-09-02
Posts: 19

Is there a file or database with a list of installed packages?

I know I can get a list of installed packages with pacman -Q. But I have a workstation with a newly-formatted disk that I'm trying to restore to the state of the old disk. I backed up the entire contents of the old disk, but I did not think to run pacman -Q before wiping the disk. Is there anywhere in the backup of that disk that I can get a list of packages that were previously installed?

I've tried pacman -Q --cachedir /<backup>/var/cache/pacman/pkg, but that gives me the same list as the currently running system, i.e. /var/cache/pacman/pkg.

Last edited by Dave_G (2025-12-11 22:37:09)

Offline

#2 2025-12-11 22:39:52

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,675

Re: Is there a file or database with a list of installed packages?

pacman --root=/path/to/old/root_partition -Q

should™ work.
The package database was in /var/lib/pacman/local

Online

#3 2025-12-11 22:45:22

Dave_G
Member
Registered: 2021-09-02
Posts: 19

Re: Is there a file or database with a list of installed packages?

I just did it with a listing of the  /<backup>/var/cache/pacman/pkg directory, stripping out the version numbers, and deleting duplicate lines.

Offline

#4 2025-12-11 22:48:08

Dave_G
Member
Registered: 2021-09-02
Posts: 19

Re: Is there a file or database with a list of installed packages?

seth wrote:
pacman --root=/path/to/old/root_partition -Q

should™ work.
The package database was in /var/lib/pacman/local

Thanks, that worked. It was easier than my way, and also included a few extra packages that my way missed.

Offline

#5 2025-12-12 08:06:24

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,675

Re: Is there a file or database with a list of installed packages?

\o/
Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Online

Board footer

Powered by FluxBB