How to find which cygwin package contains a particular file

cygwin - finding dependencies, file and package information

I always forget the commands so, a blog seem in order. The cygcheck program is a cygwin application allowing to gather information on files, packages or query package database. A few examples are below:

How to find from which package the program 'more.exe' belong to?

There are  afew ways to do this. The simplest is

% which more   # find where it is
% cygcheck -f /usr/bin/more.exe

But if you are not sure which more.exe need to be checked, you may want to use the following instead.

% cygcheck -p more.exe
Found 8 matches for more.exe
bvi/bvi-1.3.2-1	Binary vi-like editor
qt4-qtdemo/qt4-qtdemo-4.5.3-1	Qt4 demos and examples
util-linux/util-linux-2.13.1-2	Random collection of Linux utilities
util-linux/util-linux-2.14.1-1	Random collection of Linux utilities
util-linux/util-linux-2.17.2-1	Random collection of Linux utilities
xmore/xmore-1.0.1-2	X.Org plain text browser
xmore/xmore-1.0.2-1	X.Org plain text browser
xorg-x11-bin/xorg-x11-bin-	Obsolete package

OK, several answers come above (since -p was used, a REGEXP on more.exe) but you may infer the package is util-linux (the rest are derivatives, xmore.exe for example is installed as /usr/X11R6/bin/xmore.exe and matches more.exe). In other words, the answer is not always straight forward.

Now, this example has a single answer

% cygcheck -p less.exe
Found 2 matches for less.exe
less/less-436-1	A file pager program, similar to more(1)
less/less-444-1	A file pager program, similar to more(1)

Only the less package has this program (two revisions shows up in the query as a regexp was used). Note the answer with -f would provide your installed package version as single answer

% cygcheck -f /usr/bin/less.exe

Important Note: cygcheck actually requires an outgoing network connection to the cygwin web site. Essentially, it will POST a query to


How to find dependencies of more.exe?

Without the -p, the simple command would give different information on the more.exe executable.

% cygcheck more.exe
Found: F:\cygwin\bin\more.exe

In this command, all depencies (.dll) of more.exe are showed. If any of those are updated, it may influence the behavior of your program. If any is missing, it may stop working entirely. You may also use the '-v' command line option for the verbose mode (it shows the dll version information).

Which brings to ...


How to check if a package is properly installed?

Now that we know more.exe is part of the util-linux package, let us check if this package is properly installed. This can be done by issuing the command:

% cygcheck -c util-linux
Cygwin Package Information
Package              Version        Status
util-linux           2.17.2-1       OK

In this case, the package is all fine and properly installed. Here is an example of a package I had corrupt

% cygcheck -c gdbm
Cygwin Package Information
Package              Version        Status
gdbm                 1.8.3-20       Incomplete

Hum ... now, what is missing? The simplest is to re-install the package and try again.

OK, now you are curious and want to know what is installed from util-linux or the less package

How do I list the files installed by a package?

The -l command line option does this for you.

% cygcheck -l less

You can do the same for util-linux (the list is much longer so, will skip for this help). But you may also check the executables it has installed just like this

% cygcheck -l util-linux | grep bin  # this will include bin and sbin
Verifying your cygwin installation integrity

The command

% cygcheck -s -v -r

Will generate an extensive report - this how I did find that my package gdbm was corrupt - the report told specifically

Missing file: /usr/lib/gdbm/testdbm.exe from package gdbm
Missing file: /usr/lib/gdbm/testgdbm.exe from package gdbm
Missing file: /usr/lib/gdbm/testndbm.exe from package gdbm
gdbm                           1.8.3-20             Incomplete

which shows exactly what is missing. You can repair by re-installing the package from setup.exe but in some cases, you may need to first locate all files from that package, remove using setup.exe, check it is removed from a command line (and remove if files remain) and re-install. I noticed that if the signature of a file is not the same as the one from the package iniitally installed, the update or re-install would not override it (hence a forced deletion from the command line is needed).

More information?

This quick help is not meant to be complete. For more information, please go to the cygwin utilities manpage on the cygwin site.