Linux packages installed directory

Where is Ubuntu storing installed programs?

I am using Ubuntu and when I click on a program to download Firefox asks me «What should firefox do with this file?» And in the «Open with» I would like to find a program «Package installer». The problem is — I don’t know where to look for. Where is the program stored (I installed it using Ubuntu Software Center)

8 Answers 8

They are usually stored in the following folders:

If you’re not sure, use the which command:

~$ which firefox /usr/bin/firefox 

If you installed the package with the Ubuntu package manager (apt, synaptic, dpkg or similar), you can get information about the installed package with

Is it possible to do a search if I don’t know exact name of the program. i’m asking because the name of the program is «Package installer», therefore I tried with «package_installer», «package-installer», «package», and I can’t find it

dpkg -l lists all installed packages. You can use something like dpkg -l | grep package and than use dpkg -L . Nevertheless it is strange to add packages the way you are doing it. Typically this is done with the help of tools which are mostly always installed when using Ubuntu like apt-get or synaptic .

@Dantes If you write dpkg -L p and press tab, it will show you the name of packages that starts with p installed on your system.

for some applications, for example google chrome, they store it under /opt. you can follow the above instruction using dpkg -l to get the correct naming then dpkg -L to get the detail.

Just for an addition reference to the above answers. I can not use dpkg -L to find the correct path for cuda. See the results I got from dpkg -L

$ dpkg -L cuda /. /usr /usr/share /usr/share/doc /usr/share/doc/cuda /usr/share/doc/cuda/copyright /usr/share/doc/cuda/changelog.Debian.gz 

the correct path is /usr/local/cuda

$ ll /usr/local | grep cuda lrwxrwxrwx 1 root root 8 Oct 20 18:45 cuda -> cuda-9.0/ drwxr-xr-x 15 root root 4096 Oct 20 18:44 cuda-9.0/ 

Btw, I did install cuda by the command of

Источник

After doing a sudo apt-get install , where does the application get stored to? [duplicate]

enter image description here

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:

Читайте также:  Astra linux открыть порт 3389

2 Answers 2

Ask the package management what files the package contains:

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.

That did nothing interesting except tell me which command did do something interesting: dpkg —contents .

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

Источник

Where does apt-get install packages to?

Whether you are a Linux veteran or just starting with Linux, you must have used apt-get or seen it being used somewhere. It is the primary way to install packages and dependencies on Ubuntu. In simpler terms, apt-get is the go-to of every Linux user when looking to set up software on their computer. This gives rise to a new question – where does apt-get install these packages to? Where do the files go, and how can one access them? In this guide, we will find out the answers to these questions.

Ubuntu Filesystem Layout

Before we get into the technicalities of the matter, let us start by acquiring a basic understanding of the Filesystem Hierarchy Standard, shortly known as FHS. All Linux distributions get their directory structure and contents from Filesystem Hierarchy Standard. We will briefly go over some parts that are crucial to understanding where apt-get install packages are and why so.

FHS is not considered to be some authority on directory structure and contents for absolutely every Linux distribution, but it is generally the most common standard of file layout. All directories and files in FHS appear under ‘/’ – the root directory. Let’s take a look at some commonly used directories.

  • /bin directory holds the primary command binaries.
  • /dev directory contains device files.
  • /etc directory has host-specific configuration files.
  • /home folder contains the user’s personal settings and saved files.
Читайте также:  Creating user account linux

A non-profit organization known as Linux Foundation maintains the Filesystem Hierarchy Standard, and the last update (version 3.0) was made on June 3, 2015.

Now that we have gotten a better understanding of how the general Linux filesystem is structured and how it operates, we are ready to learn how apt-get makes use of this very structure to install packages and dependencies.

Package Management

All operating systems and Linux distributions come with a package manager. These package managers are responsible for installing and removing software from the computer and maintaining them. They give the user more control over what kind of programs they wish to run on the system and make their installation possible.

In Ubuntu (and Debian), dpkg is the package manager that most people use. You can manage packages with .deb extensions through dpkg. Discussing this utility is pertinent to our subject since we will be using it to find apt-get installs packages. “Aptitude” is the more user-friendly way to use dpkg as it provides a front-end to the users. Let us look at how dpkg works in Ubuntu, its syntax, and how you can use it to find out where apt-get installs packages.

The general syntax of this command is as follows.

Another common method of using it is:

You can install a package on your Linux system by running the following simple dpkg command.

We will understand how one can use dpkg and apt-get to install packages and learn where the packages are installed in the following sections.

How does apt-get work?

By this point, we all know that apt-get can be used to install, remove, and upgrade Linux packages. We also learned that it serves as the front-end for dpkg, the native package management utility for Ubuntu and Debian. But how does it really work? And what happens to the files that are installed by it? Let’s find out!

Let us start by installing a test package called ack. For this purpose, we will use apt-get, and later we will trace the files installed by it to their specific locations.

Читайте также:  Как создать ярлык на линуксе

Go ahead and start a new Terminal window through the Activities menu or pressing Ctrl + Alt + T on your keyboard. The next step is to make sure you have the multiverse repository added. Without that, you cannot install ack. You are, obviously, free to use any other package of your choice.

So, to add the repository, run the following command in the Terminal.

Once that is out of the way, we move on to installing the package.

(Note that instead of ack-grep, ack was installed. This is why we will be modifying the next commands we execute)

The installation will be complete within a few seconds. Having done that, we now investigate the package with the help of our package manager, dpkg. We will find out where the files of the package were installed and how to access them.

Recall the general syntax of the dpkg command that we described in the earlier sections. Here, we will be using a variation of that command to list the files in the installed package.

To list the contents of a package, we use the -L operator with the dpkg command. Run the command given below to see the files.

As you can see in the image, all the package manager installed files are shown along with their addresses on the computer.

In addition to that, some files are created or modified by pre/postrm and pre/postinstall scripts included in the installed package. You can view these scripts in the following directory.

Additional Information

Now that we have covered the meat of the tutorial, we will add some additional pieces of information for those that are curious about learning more.

Let’s say, for example, you want to use dpkg to extract all the files of a package in the current directory. You can do this by running the following simple command.

You can also get a hold of the files such as preinst, postrm, postinst, and more by the command given below.

This will extract said files into the current directory as well.

Conclusion

With that being said, we conclude this guide. We learned several things about apt-get today. We saw the Filesystem Hierarchy Standard, how the Ubuntu package manager works, and finally, how we can find where apt-get installs packages to.

About the author

Zeeman Memon

Hi there! I’m a Software Engineer who loves to write about tech. You can reach out to me on LinkedIn.

Источник

Оцените статью
Adblock
detector