LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-20-2018, 02:44 PM   #1
notadoc
Member
 
Registered: Jan 2015
Posts: 113

Rep: Reputation: Disabled
How to find a package containing a specific file


Mint 18.2 64-bit Cinnamon

I've looked at apt, aptitude, and dpkg, but I can't see how to find a package, installed or not, that containg a specific file; e.g., "libxxxx.so"

Ideas?
 
Old 06-20-2018, 02:48 PM   #2
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Try:

Code:
dpkg -S libxxxx.so
 
Old 06-20-2018, 02:48 PM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
https://www.startpage.com/do/dsearch...+specific+file
 
Old 06-20-2018, 03:03 PM   #4
notadoc
Member
 
Registered: Jan 2015
Posts: 113

Original Poster
Rep: Reputation: Disabled
Wow! That was fast.

Question: does dpkg -S <filename> work on packages not installed? I phrased my original question awkwardly...I need to find what package to install to get a particular file.

Thanks again
 
Old 06-20-2018, 03:11 PM   #5
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
As far as I am aware, it only looks at installed packages.

For your particular purposes, I would check the "Search the contents of packages" section at https://packages.ubuntu.com/ - it won't include Mint-specific packages, but those are only a small minority of the packages in a Mint system.
 
Old 06-20-2018, 05:13 PM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
apt-cache policy <package>
 
Old 06-20-2018, 05:22 PM   #7
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by Habitual View Post
apt-cache policy <package>
That only shows the candidate and alternative software sources for a package, not what the OP was looking for which is a reverse lookup of the files that a package installs.
 
Old 06-20-2018, 05:35 PM   #8
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
You can search packages.debian.org. There is a web interface for searching specific files in Debian.

I know you are using Mint, but Mint is a derivative of Debian, eventually. I think if you search for packages in Sid/Unstable you hit your solution in 95% of all cases. It is not perfect. Use older Debian versions for older versions of Mint.

Note that Mint and Debian packages are generally not compatible. Use this as a lookup tool.

jlinkels
 
Old 06-20-2018, 09:58 PM   #9
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
I use
Code:
$ apt-cache search <file name>
 
Old 06-21-2018, 01:56 AM   #10
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by AwesomeMachine View Post
I use
Code:
$ apt-cache search <file name>
All apt-cache search does is search through the package names and descriptions, not the names of the files that a package installs.
 
Old 06-21-2018, 02:10 AM   #11
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
@notadoc
Quote:
How to find a package containing a specific file
https://wiki.debian.org/apt-file

$ sudo apt install apt-file

$ apt-file search [file name]


-
 
1 members found this post helpful.
Old 06-21-2018, 02:24 AM   #12
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by knudfl View Post
@notadoc

https://wiki.debian.org/apt-file

$ sudo apt install apt-file

$ apt-file search [file name]
Nice one, knudfl.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How do I figure which package installed a specific file? thebombzen Linux - Software 1 01-14-2011 10:13 AM
Find folders with ONLY one specific file in and delete file and folder - How ? gedi1 Linux - Newbie 5 10-21-2009 08:09 PM
[SOLVED] How to know which package to install to get a specific file mrider Debian 12 09-04-2009 07:34 PM
problem - how to find package if you only know specific command? markomarko Linux - Newbie 3 08-05-2009 02:21 PM
How to find out if you have a specific package installed? AriciU Slackware 2 07-08-2007 10:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration