124

After installing apps via apt-get install -app name-. Where does the files get copied to? Are the copied to just one location or multiple locations? And if so how do I find this out?

Here's an example:

enter image description here

Patoshi パトシ
  • 2,993
  • 15
  • 32
  • 44

2 Answers2

136

Ask the package management what files the package contains:

dpkg -L <packagename>

This shows the files simply copied to those locations. These files are marked as managed by the package management, so don't touch them.

Additionally, sometimes some files are created/modified by pre-/postinstall and pre-/postrm scripts included in the package. You can find the scripts in /var/lib/dpkg/info/ once the package is installed.

gertvdijk
  • 67,947
  • That did nothing interesting except tell me which command did do something interesting: dpkg --contents. – ijoseph Nov 27 '22 at 22:42
8

Linux uses several directories and where stuff goes is explained here: How to understand the Ubuntu file system layout?

In general: software from the normal installations gets installed in such a manner that the same files (ie. libraries) use the same file and not install their own version of that file.

If you want to know specifics of that package in your image see: http://packages.ubuntu.com/en/saucy/all/ack-grep/filelist for an on-line reference. Someone else will post the dpkg version to do this locally ;)

From the link it states that these are the files:

/usr/bin/ack-grep
/usr/share/doc/ack-grep/NEWS.Debian.gz
/usr/share/doc/ack-grep/changelog.Debian.gz
/usr/share/doc/ack-grep/copyright
/usr/share/man/man1/ack-grep.1p.gz
/usr/share/perl5/App/Ack.pm
/usr/share/perl5/App/Ack/ConfigDefault.pm
/usr/share/perl5/App/Ack/ConfigFinder.pm
/usr/share/perl5/App/Ack/ConfigLoader.pm
/usr/share/perl5/App/Ack/Filter.pm
/usr/share/perl5/App/Ack/Filter/Default.pm
/usr/share/perl5/App/Ack/Filter/Extension.pm
/usr/share/perl5/App/Ack/Filter/FirstLineMatch.pm
/usr/share/perl5/App/Ack/Filter/Inverse.pm
/usr/share/perl5/App/Ack/Filter/Is.pm
/usr/share/perl5/App/Ack/Filter/Match.pm
/usr/share/perl5/App/Ack/Resource.pm
/usr/share/perl5/App/Ack/Resource/Basic.pm
/usr/share/perl5/App/Ack/Resources.pm

The executable is /usr/bin/ack-grep

Rinzwind
  • 299,756