How to see files installed by a package

If you’ve ever downloaded a package on Debian (or any of its derivatives) and want to see which files were installed, it’s easily accomplished using the ‘dpkg-query’ command:

$ dpkg-query -L vsftpd
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/vsftpd
/usr/share/doc/vsftpd/FAQ.gz
/usr/share/doc/vsftpd/examples


/usr/share/doc/vsftpd/changelog.Debian.gz
/usr/share/doc/vsftpd/REWARD
/usr/share/doc/vsftpd/SPEED
/usr/share/man
/usr/share/man/man8
/usr/share/man/man8/vsftpd.8.gz
/usr/share/man/man5
/usr/share/man/man5/vsftpd.conf.5.gz
/usr/sbin
/usr/sbin/vsftpd
/etc
/etc/init.d
/etc/pam.d
/etc/pam.d/vsftpd
/etc/init
/etc/init/vsftpd.conf
/etc/vsftpd.conf
/etc/logrotate.d
/etc/logrotate.d/vsftpd
/etc/ftpusers
/etc/init.d/vsftpd

The above example is for the ‘vsftpd’ package, but this equally applies to all of the other packages installed using dpkg/apt.

In case you’re on a system which uses yum (Fedora, RedHat, CentOS etc…) you can use ‘rpm -ql [package name]’:

# rpm -ql yum-cron
/etc/cron.daily/0yum.cron
/etc/rc.d/init.d/yum-cron
/etc/sysconfig/yum-cron
/etc/yum/yum-daily.yum
/etc/yum/yum-weekly.yum
/usr/share/doc/yum-cron-3.2.29
/usr/share/doc/yum-cron-3.2.29/COPYING

Signature Errors on Ubuntu repositories

On all of the Ubuntu installs I’ve ever had, I almost always eventually run into the following error when running the ‘apt-get update’ command or hitting the ‘Reload’ button in Synaptic.

Error:
W: GPG error: http://nz.archive.ubuntu.com hardy-updates Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key
W: You may want to run apt-get update to correct these problems

From what I understand the problem comes from apt downloading an incomplete/corrupt signature file, meaning that the signature then doesn’t match that of the packages. The fix at the moment is to simply delete the incomplete/corrupt signature file and download it again. To do this run the following command:

sudo rm /var/lib/apt/lists/partial/*

Afterwards running apt-get update doesn’t return the same error.