[arch-general] How to find if a file belongs to a installed package?
guillaume at alaux.net
Sun Nov 20 06:21:46 EST 2011
On 20 November 2011 12:02, Hector Martinez-Seara <hseara at gmail.com> wrote:
> Why I'm so blind,
> On 20 November 2011 12:48, Jakob Gruber <jakob.gruber at gmail.com> wrote:
> > 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.
> Hector Martínez-Seara Monné
> mail: hseara at gmail.com
> Tel: +34656271145
> Tel: +358442709253
The only thing being that "pacman -Qo" cannot determine ownership of
But still you can guess with:
$ pacman -Ql libreoffice-base| grep basis
More information about the arch-general