0

When I download a package in Ubuntu, what files does it install on my system and where? I'm just curious about the package structure in general (I searched and it doesn't look like anyone's asked this on here before). It will obviously differ to some extent from package to package, but I'm guessing there must be some 'standard' guidelines that are followed?

Also, are the packages in the Software Center the same as the packages that are available through apt-get? If not, how can I see what packages are available in apt-get and what they do?

Time4Tea
  • 295
  • 2
  • 3
  • 14
  • It is going to vary by package, and your question is very broad. See http://packaging.ubuntu.com/html/ – Panther Dec 18 '14 at 02:43
  • Don't worry, it is not a shame to miss a question :) Most duplicates I find because I remember I saw them once. – Jacob Vlijm Dec 18 '14 at 16:31

2 Answers2

2
  • Once you have installed a package, it is possible to see what files that package has installed on your system. You can do this:

    1. with the graphical synaptic package manager:

      • install synaptic (it is not installed by default). Use apt-get install synaptic, or install it through Software Center. I like it better than the Software Center, but YMMV.

      • finding the package in question (try typing the name or a keyword in the search bar)

      • right-click on an installed package (green square next to package),

      • select Properties

      • click on the "Installed Files" tab

    2. with command line tools (see this question)

      • (once) install apt-file: sudo apt-get install apt-file
      • (once) apt-file update
      • (for any package) apt-file list
  • Yes, the packages in the software center are (edit: mostly) the same as those in apt-get. The repositories that ubuntu gets software from are configured in a common location (System Settings -> Software & Updates). apt-get, synaptic, the Ubuntu Software Center, etc... all use that system.

    • Edit: The dpkg subsystem is what is actually responsible for installation and removal of packages. Synaptic, the Software Center, and apt-get all use this to actually perform operations. This means that these three methods are all views into the same set of data about installed packages.

    • the only caveat: the Software Center can have apps in it that cost money, and synaptic and apt-get will not be able to install these packages as they have no payment mechanism in them. There thus are apps available in the Software Center that are not available by synaptic or apt-get. I believe (but am not 100% positive) that Software Center still uses dpkg under the hood to install these packages after they have been paid for, meaning the apt tools and synaptic will see them at that point.

    • Just for clarity, it is of course possible with root access to modify the system any way you wish, including manually installing software that is not contained in a .deb package file. Software installed outside of the dpkg system in this fashion will not be visible by any of the package management tools I mentioned.

  • Ok, thanks. Is Synaptic aware of packages that have been installed manually as well, or just ones downloaded from the repositories? – Time4Tea Dec 18 '14 at 13:26
  • Yes, it is. Editing my answer to include this – stochastic Dec 18 '14 at 16:20
  • Thanks for expanding on your answer stochastic - I really appreciate it and I think you've explained it very well. I had actually been wondering about the paid packages in the Software Center too. – Time4Tea Dec 19 '14 at 04:20
1

I would suggest to use dpkg from the command line (shell). The good thing about it is that it is already installed on your system, because apt-get is just an extension built around dpkg. apt-get handles checking for available packages, checking for updates, downloading the packages, but dpkg is the command that actually handles the package installs, removes, etc.

In order to get a list of all installed packages, you can run dpkg -l. And in order to list all files in a given package, you run dpkg -L <pkg_name>, for example:

dpkg -L zerofree
/.
/usr
/usr/share
/usr/share/man
/usr/share/man/man8
/usr/share/man/man8/zerofree.8.gz
/usr/share/doc
/usr/share/doc/zerofree
/usr/share/doc/zerofree/copyright
/usr/share/doc/zerofree/changelog.Debian.gz
/usr/sbin

As already explained by @stochastic, the sources of packages on your system are the same, regardless of whether you use the GUI or command line tools. The actual configuration files are in /etc/apt/sources.list and /etc/apt/sources.list.d/*.

Note that dpkg does not understand online repositories, it can work with packages that are already installed on the system or packages (.deb) that you have downloaded manually.