4

I learned how to view the configuration files for a package that's already installed from reading:

How to list all configuration files for an already installed package?

Using dnsmasq as an example, I can view the files and configuration files for that package after it's installed using these two commands:

cat /var/lib/dpkg/info/dnsmasq.conffiles
dpkg -L dnsmasq

I know I can search for the existence of the package and get relevant meta data about the package using these commands

dpkg --list | grep dnsmasq
apt-cache search dnsmasq
apt-cache show dnsmasq

But, I'd like to know the configuration files for the package before installing it.

How do I list configuration files for a package before installing the package?

0

2 Answers 2

2

You can view the file list online on packages.ubuntu.com.

For example, for package dnsmasq, release xenial (16.04), architecture all, the URL is packages.ubuntu.com/xenial/all/dnsmasq/filelist. Info copied here:

File list of package dnsmasq in xenial of architecture all

/etc/default/dnsmasq
/etc/dnsmasq.conf
/etc/dnsmasq.d/README
/etc/init.d/dnsmasq
/etc/insserv.conf.d/dnsmasq
/etc/resolvconf/update.d/dnsmasq
/lib/systemd/system/dnsmasq.service
/usr/lib/resolvconf/dpkg-event.d/dnsmasq
/usr/share/doc/dnsmasq
2

To compliment the @wjandrea answer - you can use apt-file:

sudo apt install apt-file
sudo apt-file update
apt-file list dnsmasq

On 16.04 LTS you will get:

$ apt-file list dnsmasq
dnsmasq: /etc/default/dnsmasq
dnsmasq: /etc/dnsmasq.conf
dnsmasq: /etc/dnsmasq.d/README
dnsmasq: /etc/init.d/dnsmasq
dnsmasq: /etc/insserv.conf.d/dnsmasq
dnsmasq: /etc/resolvconf/update.d/dnsmasq
dnsmasq: /lib/systemd/system/dnsmasq.service
dnsmasq: /usr/lib/resolvconf/dpkg-event.d/dnsmasq
dnsmasq: /usr/share/doc/dnsmasq

Not the answer you're looking for? Browse other questions tagged .