[arch-general] How to find if a file belongs to a installed package?

Jakob Gruber jakob.gruber at gmail.com
Sun Nov 20 05:48:56 EST 2011


On 11/20/2011 11:44 AM, Hector Martinez-Seara wrote:
> Hi,
> I have been looking but I haven't found a solution to check if a given
> file in my system belongs to any of my Installed packages.
> 
> For example, in all my 3 archllinux machine I have a directory named:
> /usr/lib/libreoffice/basis3.3    85Mb
> 
> I would not expect to have this directory as I'm fully updated and my
> current libreoffice is 3.4. Accordingly there also exists the
> directory:
> /usr/lib/libreoffice/basis3.4        335Mb
> 
> I'm not an expert in the libreoffice package and therefore blindly
> removing the first, without knowing if it is really needed or it is
> just some directory during the updates, makes me feel unconformable.
> 
> The command in question should be able not only to check repository
> packages but also locally installed ones although if it is not
> possible with the first will be enough.
> Thanks in advance,
> Hector

That would be pacman -Qo. From the manpage:

QUERY OPTIONS
[...]
       -o, --owns <file>
           Search for packages that own the specified file(s). The path
can be relative or absolute and one or more files can be specified.


More information about the arch-general mailing list