Arch has two ways for doing this (well, two ways of which I'm aware, anyway):
- With the package manager (
- and with an add-on tool called
First, update the database for files which are in packages which you do not have installed on your system (now there's a mouthful), which you can then query with the
sudo pacman -Fy
Then you can query the database like so (for texmaker, as an example):
$ pacman -Fo /usr/bin/texmaker
usr/bin/texmaker is owned by community/texmaker 5.0.2-1
The problem here is that you need to know the actual path of the file. Not much use if you're looking for a (La)TeX package (at least not to me -- I certainly don't know my texmf-dist tree by heart). But still, the option exists.
More geared towards our use case is the
s option though, which allows searching for a filename (note that the query for
datatool.sty will yield an empty result if you run it with
$ pacman -Fs datatool.sty
According to the manpages, this search mechanism should also support regexes, but I have not found a way to get them to work. So if I want to do wildcard searches, so far I need to use another way.
Thanks to Fox for the hint about the
-x option; I'd overlooked that when browsing the manpages:
$ pacman -Fxs 'data.*\.sty'
This will give you a list of packages and the files within those packages which match the regex:
[ etc. ]
First, install as usual:
sudo pacman -S pkgfile
sudo pgkfile --update
The default works pretty much like one would expect:
$ pkgfile datatool.sty
But let's say we want to find all packages which own a file with
tikz in it, case-insensitive, via regular expression syntax:
$ pkgfile -ri '.*tikz.*'
You could then query those packages if you wanted to get the specific files. For
auctex, as an example:
$ pkgfile -l auctex|grep -i tikz
And the same query can also be run with pacman (though, funnily enough, it's actually slower than pkgfile, at least on my machine):
$ pacman -Fl auctex | grep -i tikz
The Arch wiki also has a page on TeX Live, which is probably worth a look. Basically, you have the following package groups:
texlive-most : includes most TeX Live applications
texlive-lang : provides various character sets and non-English features
texlive-core is based on the medium install scheme of TeX Live.
I usually just install
texlive-lang on my machines. I have almost never had an issue with a missing package. Downside is that it's not exactly a lightweight affair.
(EDIT: cleaned up some confusing terminology stemming from the difference between packages and package groups.)
See also this answer on the Unix/Linux SE