5

How do I list the contents of a package that I just installed? This command:

dpkg --contents filename.deb

requires that I know where the .deb file is. I don't feel like I need to know that, and if I do, please tell me where they go when I do apt-get install.

Matt Gregory
  • 231
  • 1
  • 3
  • 11

5 Answers5

9

Use Synaptic Package Manager. Install it with

sudo apt-get install synaptic

Then go to Installed section, select a package then right-click to show its properties.

enter image description here

If you want to do it in Terminal, there is no need for Synaptic:

dpkg-query -L <package_name>

Package name is without .deb extension or version information (e.g. vlc, evince).

Cornelius
  • 9,653
5

This is another way where it doesn't matter whether the package is already installed or not.

install the apt-file helper package

apt install apt-file 

then run the apt-file list command

example (here for a python package installed from the repository):

apt-file list virtualenvwrapper

Result

virtualenvwrapper: /etc/bash_completion.d/virtualenvwrapper
virtualenvwrapper: /usr/lib/python2.7/dist-packages/virtualenvwrapper-4.3.1-nspkg.pth
virtualenvwrapper: /usr/lib/python2.7/dist-packages/virtualenvwrapper-4.3.1.egg-info/PKG-INFO
virtualenvwrapper: /usr/lib/python2.7/dist-packages/virtualenvwrapper-4.3.1.egg-info/SOURCES.txt

etc etc etc

virtualenvwrapper: /usr/share/doc/virtualenvwrapper/html/search.html
virtualenvwrapper: /usr/share/doc/virtualenvwrapper/html/searchindex.js
virtualenvwrapper: /usr/share/doc/virtualenvwrapper/html/tips.html
virtualenvwrapper: /usr/share/python/ns/virtualenvwrapper
virtualenvwrapper: /usr/share/virtualenvwrapper/virtualenvwrapper.sh
virtualenvwrapper: /usr/share/virtualenvwrapper/virtualenvwrapper_lazy.sh

More about apt-file:

apt show apt-file
Package: apt-file
Version: 3.1.5
Priority: optional
Section: universe/admin
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: APT Development Team <deity@lists.debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 84.0 kB
Depends: perl:any, apt (>= 1.3~exp1~), libapt-pkg-perl, liblist-moreutils-perl, libregexp-assemble-perl
Breaks: apt-venv (<< 1.0.0-1~), command-not-found (<< 0.2.38-2~), devscripts (<< 2.15.10~)
Download-Size: 25.5 kB
APT-Manual-Installed: yes
APT-Sources: http://de2.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
Description: search for files within Debian packages (command-line interface)
 apt-file is a command line tool for searching files contained in packages
 for the APT packaging system. You can search in which package a file is
 included or list the contents of a package without installing or fetching it.
knb
  • 5,292
3

For those who might like to see the contents of a package before it's installed, the package can first be downloaded with apt-get and then inspected.

apt-get download [package-name]
dpkg --contents [downloaded-file]
jamesc
  • 450
1

To get to know the list of most recently installed softwares via any method (synaptic, terminal, etc.), type in the command:

cat /var/log/dpkg.log | grep "\ install\ "

To list only the names of recently installed packages, type in the command:

awk '$3~/^install$/ {print $4;}' /var/log/dpkg.log

Credit goes to: Alvin Row

Raphael
  • 8,135
1

If you just installed that package, the package .deb is expected to still be in the cache:

ls /var/cache/apt/archives/*<package-name>*

Then you can run dpkg --contents ... against that .deb file. I think that's a practical tip to know, although the dpkg-query tool is certainly better overall, it's just yet another tool to learn about...

Alexis Wilke
  • 2,787