Find what package a file belongs to in Ubuntu/Debian?
Problem
I frequently find myself missing a program, man page, or other file when working on my Ubuntu 8.04 system. Is there any simple way to look up what package contains a given file (whether it is installed already or not)? Maybe some obscure option for apt or dpkg?
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Fix for: Find what package a file belongs to in Ubuntu/Debian?
(Debian/Ubuntu) Discover what package a file belongs to: 'dpkg -S' just matches the string you supply it, so just using 'ls' as an argument matches any file from any package that has 'ls' anywhere in the filename. So usually it's a good idea to use an absolute path. You can see in the second example that 12 thousand files that are known to dpkg match the bare string 'ls'.
Awaiting Verification
Be the first to verify this fix
Sign in to verify this fix