How to determine location of packages in Ubuntu

It will carry discussion on general topics. It may vary from ece, cse, coding and anything which helps in both growth and development
Post Reply
successai
Posts: 1
Joined: 16 Jun 2019

How to determine location of packages in Ubuntu

Post by successai » 16 Jun 2019

Hello AI Sangam and anyone who is reading this question. I had been using Ubuntu for a long time. There comes a question in my mind and question is as below

Question
When some one install Debian package or some program using apt-get install **name_package**, where is the location of these packages installed. I have another query what is /etc/apt/sources.list and how it is it related to apt.

What is the confusion in my mind
I am unable to understand the difference between apt and Debian. This creates a lot of mess for me.

I hope, I am opening this topic for general discussion so that all the readers can provide their valuable points here and better knowledge can be shared.

User avatar
Aisangam
Site Admin
Posts: 27
Joined: 24 Mar 2019
Location: Delhi, India
Contact:

Re: How to determine of location of packages in Ubuntu

Post by Aisangam » 16 Jun 2019

In reply to "When some one install Debian package or some program using apt-get install **name_package**, where is the location of these packages installed."

First of all there is difference between Debian package and package installed using APT (Advanced Packaging Tool) which i guess is second question so It would be more appropriate if I would answer there. Now let us focus on this point. If you want to get the location of debian package which is being installed, please run the below code.

Code: Select all

dpkg -L **name_package**
Please see the screenshot for the above code from here.

If you want to study about the command Debian. I would suggest you to type the below line in the terminal. You can open the terminal using Ctrl+Alt+T. Please type the below line

Code: Select all

man dpkg
If you face any problem, please see the output of this command from this screenshot

Coming back to the question, you need to know the location of program installed using apt. For this please type the below command

Code: Select all

command 1: whereis **name_package**
command 2: locate **name_package**
From my experience whereis command runs for both debian package and program installed using apt. For the output of the whereis command please see this screenshot

I hope I was able to answer the first question that you have asked. If you want to get the location of the debian packages you can also visit the below path which is provided below

Code: Select all

/var/cache/apt/archives
Once you will visit this path, you will see an output similar to this output.

Coming back to the question second which is difference between apt and dpkg.
The apt or Advanced Packaging Tool is a package manager for Debian based Operating Systems like Ubuntu, Linux Mint etc, whereas dpkg is the package manager for Debian. In other words when you have .deb package, you install it using the below command

Code: Select all

dpkg -i *name.deb*
In the same way you can install the program using apt-get install **name**. It will look for the package in the /etc/apt/source.list. It install the package from this source. If you face any problem, please have a look at this screenshot.

In the same way there are a lot of error being solved which you can find here. I wish you would not miss these and AI Sangam also hope that this would provide you some broad idea to what you are asking. I also hope adding screenshots would help you a lot. I have also added some comments on the screenshot which would help you better.

With Regards
https://www.aisangam.com/

Post Reply