FG

Find what package a file belongs to in Ubuntu/Debian?

Fresh3 days ago
Mar 15, 2026278055 views
Confidence Score1%
1%

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

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Find what package a file belongs to in Ubuntu/Debian?

Low Risk

(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

Environment