A Detailed Look at Where deb Packages Are Installed

Which directory are the files of software installed on a Linux system actually placed in? This article gives a brief introduction using dpkg.

  • Ryan
  • 1 min read
/images/posts/linux-filesystem.png

As everyone knows, when you install software on Windows, most of the files of that package are usually kept in the installation directory. But when you first install a package on Linux, you often wonder: where exactly are the package’s files stored?

Actually, when you install a package on Linux, the system copies different types of files from the package to different directories. If you’re using a Debian-based Linux system, you can find out which directories the different types of files of a package go to with the following command. For example, to see the distribution of all of nodejs’s files:

# dpkg -L nodejs

The output is as follows:

/. /usr /usr/share /usr/share/doc /usr/share/doc/nodejs /usr/share/doc/nodejs/changelog.Debian.gz /usr/share/doc/nodejs/api /usr/share/doc/nodejs/api/assets /usr/share/doc/nodejs/api/assets/style.css /usr/share/doc/nodejs/api/assets/sh.css /usr/share/doc/nodejs/api/https.markdown.gz /usr/share/doc/nodejs/api/events.markdown /usr/share/doc/nodejs/api/punycode.markdown …omitted

We can see that nodejs’s files roughly fall into the following categories:

  1. /usr/share/doc/nodejs/ Stores nodejs-related documentation.

  2. /usr/share/man/man1/nodejs.1.gz Stores the man-page help manual related to nodejs.

  3. /usr/lib/nodejs/ Stores nodejs-related library files.

  4. /usr/bin/nodejs The nodejs executable.

Written by : Ryan

Writing about distributed systems, AI engineering, and production internals.

Recommended for You

A Primer on Linux Package Management

A Primer on Linux Package Management

Linux has a wide variety of package management systems. This article sorts out the relationships among the mainstream Linux package management systems.

sed Quick Start

sed Quick Start

sed and awk are powerful tools for text stream processing. This article provides a quick-start reference for the sed command.