4

I just installed the package autojump through apt and now I have no idea how to actually use it. Newer versions uses a j alias, but apparently the apt version does not.

In interest of finding out which binaries I should execute to use autojump, is there a way to see what exactly was installed by package?

4 Answers 4

7

The following command will list all files installed by the package autojump:

dpkg -L autojump

It is a dpkg command because dpkg is actually responsible for installing packages, apt just a frontend that runs dpkg.

For completeness, there is also the reverse command:

dpkg -S file

This will give you all packages which contain something named file (this can also be a single part of a path).

1
  • Woohoo! I've been using apt-filefor ages and can't believe I didn't know about this. Thanks!
    – SirCharlo
    Aug 9, 2012 at 14:16
1

When you just installed a package with apt, the downloaded .deb file is still in /var/cache/apt/archives/

You can open the file with file-roller and you'll see which files and folders are added to the filesystem. For the executable it's usually in usr/bin/ folder.

1

install apt-file

sudo apt-get update && sudo apt-get install apt-file -y

use it this way

apt-file show packageName
1
  • 1
    This is useful for packages which are not installed, but not necessary for installed packages. Aug 9, 2012 at 14:10
0

Once a package is installed, its archive file is stored locally in /var/cache/apt/archives/.

To examine the contents of a deb file stored there, use the following command:

dpkg -c /var/cache/apt/archives/package-name.deb

Note that this method will only work for packages that have been installed recently.
If the package cache has been emptied since you installed the said package, this method logically won't work.


For example, in my case, this is what the command outputs for the toiletpackage:

# dpkg -c /var/cache/apt/archives/toilet_0.2-1_i386.deb
drwxr-xr-x root/root         0 2010-05-12 18:21 ./
drwxr-xr-x root/root         0 2010-05-12 18:21 ./usr/
drwxr-xr-x root/root         0 2010-05-12 18:21 ./usr/bin/
-rwxr-xr-x root/root     14096 2010-05-12 18:21 ./usr/bin/toilet
drwxr-xr-x root/root         0 2010-05-12 18:21 ./usr/share/
drwxr-xr-x root/root         0 2010-05-12 18:21 ./usr/share/man/
drwxr-xr-x root/root         0 2010-05-12 18:21 ./usr/share/man/man1/
-rw-r--r-- root/root      1559 2010-05-12 18:21 ./usr/share/man/man1/toilet.1.gz
drwxr-xr-x root/root         0 2010-05-12 18:21 ./usr/share/doc/
drwxr-xr-x root/root         0 2010-05-12 18:21 ./usr/share/doc/toilet/
-rw-r--r-- root/root       164 2010-02-08 20:03 ./usr/share/doc/toilet/README
-rw-r--r-- root/root       174 2010-02-08 20:03 ./usr/share/doc/toilet/TODO
-rw-r--r-- root/root       708 2006-11-15 22:11 ./usr/share/doc/toilet/copyright
-rw-r--r-- root/root      9601 2010-02-08 20:22 ./usr/share/doc/toilet/changelog.gz
-rw-r--r-- root/root       346 2010-02-08 19:50 ./usr/share/doc/toilet/NEWS.gz
-rw-r--r-- root/root       428 2010-02-08 20:34 ./usr/share/doc/toilet/changelog.Debian.gz
lrwxrwxrwx root/root         0 2010-05-12 18:21 ./usr/bin/figlet-toilet -> toilet
lrwxrwxrwx root/root         0 2010-05-12 18:21 ./usr/share/man/man1/figlet-toilet.1.gz -> toilet.1.gz

If you wish to exclude directories from the output, simply append | grep -v "^d" to the end of the command.

# dpkg -c /var/cache/apt/archives/toilet_0.2-1_i386.deb | grep -v "^d"
-rwxr-xr-x root/root     14096 2010-05-12 18:21 ./usr/bin/toilet
-rw-r--r-- root/root      1559 2010-05-12 18:21 ./usr/share/man/man1/toilet.1.gz
-rw-r--r-- root/root       164 2010-02-08 20:03 ./usr/share/doc/toilet/README
-rw-r--r-- root/root       174 2010-02-08 20:03 ./usr/share/doc/toilet/TODO
-rw-r--r-- root/root       708 2006-11-15 22:11 ./usr/share/doc/toilet/copyright
-rw-r--r-- root/root      9601 2010-02-08 20:22 ./usr/share/doc/toilet/changelog.gz
-rw-r--r-- root/root       346 2010-02-08 19:50 ./usr/share/doc/toilet/NEWS.gz
-rw-r--r-- root/root       428 2010-02-08 20:34 ./usr/share/doc/toilet/changelog.Debian.gz
lrwxrwxrwx root/root         0 2010-05-12 18:21 ./usr/bin/figlet-toilet -> toilet
lrwxrwxrwx root/root         0 2010-05-12 18:21 ./usr/share/man/man1/figlet-toilet.1.gz -> toilet.1.gz
4
  • the cache of apt is just a cache, who can ensure you that you will find your package in the cache? You have to guess.
    – user827992
    Aug 9, 2012 at 14:01
  • Well, I was assuming the OP wanted to find out the info not long after installing the package.
    – SirCharlo
    Aug 9, 2012 at 14:02
  • I was, but I would note in your answer that this only works for recently install packages. BTW I did upvote you, thanks for the detailed answer. Aug 9, 2012 at 14:04
  • Ok! The downvote was kind of harsh if you ask me, though.
    – SirCharlo
    Aug 9, 2012 at 14:05

You must log in to answer this question.

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