This question already has an answer here:

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?

marked as duplicate by wjandrea, Community Jan 27 at 20:35

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


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


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 or ask your own question.