How to find actual folder of sudo apt install libbluetooth-dev

Status
Not open for further replies.

anneranch

Active Member
Joined
Mar 16, 2019
Messages
223
Reaction score
43
Credits
2,078
I need to verify the actual content of installation.
How do I find WHERE was the package installed and its content?
I am looking to specific file(s) provided by this package.

How can I use

"find" -name what name ?


pi@raspberrypi:~ $ sudo apt remove libbluetooth-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
python-colorzero
Use 'sudo apt autoremove' to remove it.
The following packages will be REMOVED:
libbluetooth-dev
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 524 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 133670 files and directories currently installed.)
Removing libbluetooth-dev:armhf (5.50-1.2~deb10u2+rpt1) ...
pi@raspberrypi:~ $ sudo apt install libbluetooth-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
python-colorzero
Use 'sudo apt autoremove' to remove it.
The following NEW packages will be installed:
libbluetooth-dev
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 190 kB of archives.
After this operation, 524 kB of additional disk space will be used.
Get:1 http://archive.raspberrypi.org/debian buster/main armhf libbluetooth-dev armhf 5.50-1.2~deb10u2+rpt1 [190 kB]
Fetched 190 kB in 1s (244 kB/s)
Selecting previously unselected package libbluetooth-dev:armhf.
(Reading database ... 133622 files and directories currently installed.)
Preparing to unpack .../libbluetooth-dev_5.50-1.2~deb10u2+rpt1_armhf.deb ...
Unpacking libbluetooth-dev:armhf (5.50-1.2~deb10u2+rpt1) ...
Setting up libbluetooth-dev:armhf (5.50-1.2~deb10u2+rpt1) ...
pi@raspberrypi:~ $
 


If you are looking for libbluetooth-dev you can use "locate"
Code:
 sudo apt install locate
in the terminal
Code:
 locate libbluetooth-dev
Locate is fast because it doesn't read the file system for the searched file or directory name. It actually refers to a database which is prepared by the command updatedb to find what user is looking for and based on that search, produces its output.
If database locate searches that wasn't updated after the file was created on the system. So, let's update the database, which can be done using the updatedb command. In the terminal run:
Code:
sudo updatedb
then run the Locate command again
 
Last edited by a moderator:
When you install dev packages in Debian based distro's:
Header files usually end up somewhere in /usr/include/.
Libraries/shared objects will normally be in a sub-directory of /usr/lib/, or /usr/lib/x86_64-linux-gnu/.
And documentation usually ends up in /usr/share/doc/{packagename}-dev/

If you want to find out exactly what files were in the package and where they were installed to - you could use dpkg:
Bash:
dpkg -L libbluetooth-dev
But if the package is a meta-package that pulls in other packages, it might not show anything. In which case, you'd need to use dpkg-query to get a list of the dependencies for the package (I forget the exact syntax to do that) and then run dpkg -L on the list of dependencies.

Or perhaps you could try apt-file?
If you don't already have it, you'll have to install it.
Bash:
sudo apt install apt-file

Once you have it, you will need to update its cache:
Bash:
sudo apt-file update

Then you can query packages like this:
Bash:
apt-file show libbluetooth-dev
And that should show you all of the files that are in the package and where they were installed to.

Another thing that apt-file is handy for is finding out which package provided a certain file.
So for example, if you want to find out which package provided the executable for the nano editor - you would do this:
Bash:
apt-file search -F /bin/nano
or
Bash:
apt-file search -F $(which nano)

The -F flag in the above tells apt-file that the pattern we're searching for is a fixed string. In other words - don't use any wildcards on either side of the string. Only search for packages that provide a file that exactly matches the passed in string. In this case /bin/nano.
And obviously, apt-file will tell us that it's provided by the nano package.

And it works for any other system-files and by system files - I mean files in your main system directories ( e.g. files in subdirectories under /bin/ /usr/ etc. etc.) NOT your personal files.
For example, if you wanted to find out which package provided the header file /usr/include/stdio.h:
Bash:
apt-file search -F /usr/include/stdio.h
And on my Debian 10 install I'd get the result libc6-dev (you'd see whatever version of libc-dev you have installed on your distro)
So apt-file can be extremely useful!

If dpkg doesn't yield what you need, apt-file will definitely do the trick!
 
Last edited:
When you install dev packages in Debian based distro's:
Header files usually end up somewhere in /usr/include/.
Libraries/shared objects will normally be in a sub-directory of /usr/lib/, or /usr/lib/x86_64-linux-gnu/.
And documentation usually ends up in /usr/share/doc/{packagename}-dev/

If you want to find out exactly what files were in the package and where they were installed to - you could use dpkg:
Bash:
dpkg -L libbluetooth-dev
But if the package is a meta-package that pulls in other packages, it might not show anything. In which case, you'd need to use dpkg-query to get a list of the dependencies for the package (I forget the exact syntax to do that) and then run dpkg -L on the list of dependencies.

Or perhaps you could try apt-file?
If you don't already have it, you'll have to install it.
Bash:
sudo apt install apt-file

Once you have it, you will need to update its cache:
Bash:
sudo apt-file update

Then you can query packages like this:
Bash:
apt-file show libbluetooth-dev
And that should show you all of the files that are in the package and where they were installed to.

Another thing that apt-file is handy for is finding out which package provided a certain file.
So for example, if you want to find out which package provided the executable for the nano editor - you would do this:
Bash:
apt-file search -F /bin/nano
or
Bash:
apt-file search -F $(which nano)

The -F flag in the above tells apt-file that the pattern we're searching for is a fixed string. In other words - don't use any wildcards on either side of the string. Only search for packages that provide a file that exactly matches the passed in string. In this case /bin/nano.
And obviously, apt-file will tell us that it's provided by the nano package.

And it works for any other system-files and by system files - I mean files in your main system directories ( e.g. files in subdirectories under /bin/ /usr/ etc. etc.) NOT your personal files.
For example, if you wanted to find out which package provided the header file /usr/include/stdio.h:
Bash:
apt-file search -F /usr/include/stdio.h
And on my Debian 10 install I'd get the result libc6-dev (you'd see whatever version of libc-dev you have installed on your distro)
So apt-file can be extremely useful!

If dpkg doesn't yield what you need, apt-file will definitely do the trick!
Thanks
Your post is very helpful , especially the explanation how the package is distributed to various folders.,
It confirms my mistage to try scp wrong file / folder.
 
When you install dev packages in Debian based distro's:
Header files usually end up somewhere in /usr/include/.
Libraries/shared objects will normally be in a sub-directory of /usr/lib/, or /usr/lib/x86_64-linux-gnu/.
And documentation usually ends up in /usr/share/doc/{packagename}-dev/

If you want to find out exactly what files were in the package and where they were installed to - you could use dpkg:
Bash:
dpkg -L libbluetooth-dev
But if the package is a meta-package that pulls in other packages, it might not show anything. In which case, you'd need to use dpkg-query to get a list of the dependencies for the package (I forget the exact syntax to do that) and then run dpkg -L on the list of dependencies.

Or perhaps you could try apt-file?
If you don't already have it, you'll have to install it.
Bash:
sudo apt install apt-file

Once you have it, you will need to update its cache:
Bash:
sudo apt-file update

Then you can query packages like this:
Bash:
apt-file show libbluetooth-dev
And that should show you all of the files that are in the package and where they were installed to.

Another thing that apt-file is handy for is finding out which package provided a certain file.
So for example, if you want to find out which package provided the executable for the nano editor - you would do this:
Bash:
apt-file search -F /bin/nano
or
Bash:
apt-file search -F $(which nano)

The -F flag in the above tells apt-file that the pattern we're searching for is a fixed string. In other words - don't use any wildcards on either side of the string. Only search for packages that provide a file that exactly matches the passed in string. In this case /bin/nano.
And obviously, apt-file will tell us that it's provided by the nano package.

And it works for any other system-files and by system files - I mean files in your main system directories ( e.g. files in subdirectories under /bin/ /usr/ etc. etc.) NOT your personal files.
For example, if you wanted to find out which package provided the header file /usr/include/stdio.h:
Bash:
apt-file search -F /usr/include/stdio.h
And on my Debian 10 install I'd get the result libc6-dev (you'd see whatever version of libc-dev you have installed on your distro)
So apt-file can be extremely useful!

If dpkg doesn't yield what you need, apt-file will definitely do the trick!
Thanks @JasKinasis
I have installed apt-file and it works great. I get the same exact result as you did - libc6-dev.
The old geezer is done with golf and now back! LOL.
 
Status
Not open for further replies.

Members online


Top