You can pull file list for all the packages using command apt-file list --regexp ".*"
however this will take time in gathering the list of all files. The same is mentioned on the man page of the command apt-file
:
-x, --regexp
Treat pattern as a (perl) regular expression. See perlreref(1) for
details. Without this option, pattern is treated as a literal
string to search for.
Be advised that this option can be rather slow. If performance is
an issue, consider giving apt-file non-regex pattern matching too
much and pipe the output to perl -ne '/<pattern-here>/'. This
enables apt-file to use more optimizations and leaves less work to
the "slower" regex.
Another way to pull file list for all the installed packages is by using below command:
for package in $(apt list --installed| awk -F"/" '{print $1}'); do
dpkg --listfiles "$package";
done
You can adjust the output as per your requirement.
In case you want to pull file list for all the packages from apt db, you should go with apt-file
which will take time as there are usually thousands of packages(depending on repos configured) in apt db, so there will be millions of files to list. You can go with either command:
apt list | awk -F"/" '{print $1}' > package_list
apt-file list -f package_list
or
apt-file list --regexp ".*"