What is the minimal packages list for Cygwin?

The Cygwin FAQ mentions that one the first install, the setup exe will download “a minimal subset of all available packages.” Which packages are part of this subset?

I’m installing Cygwin on a computer without Internet access, so I need to know what packages to download to bring over since I can’t run the setup.exe on the computer with Internet.


Solution 1:

Here is the minimal list of packages for a "base" installation of Cygwin:

_autorebase
_update-info-dir
alternatives
attr
base-cygwin
base-files
bash
bzip2
ca-certificates
coreutils
cygutils
cygwin
dash
editrights
file
findutils
gawk
gcc
gdbm
getent
gettext
gmp
grep
groff
gzip
hostname
ipc-utils
less
libargp
libffi
libiconv
libpipeline
libtasn1
login
lynx
man-db
mintty
mpfr
ncurses
openssl
p11-kit
pcre
popt
readline
rebase
run
sed
tar
texinfo
tzcode
util-linux
vim
which
xz
zlib

The total size will be ~ 1.4 GB.

Solution 2:

I have been experimenting with Cygwin attempting to get a "bare-bones", minimal install. I do find that installing utilities like grep, gawk, sed and similar tools has dependencies on cygwin, base-Cygwin and sometimes unwanted tools like bash, coreutils etc., I have not attempted to completely understand why this dependency exists, but that's not my goal. I wanted to get only the tools and their required dlls installed and started examining the Cygwin package. I discovered that not using the setup.exe supplied by Cygwin is an alternative way to accomplish minimal Cygwin installs. And this is how I got it done.

  1. Use the setup.exe supplied by Cygwin to download all the packages - download only and no install.
  2. Once the download is successfully completed, individual packages like zlib, gawk, grep, libiconv are found under the x86/release or x86_64/release directory.
  3. Each package is 'tar'red and compressed using tool 'xz' or bzip and stored in respective directories.
  4. To install a specific tool like sed or gawk, all that needs to be done, is to extract the tool executable and its dependencies (.dll)

    Before you attempt the following, please ensure you have a tool like 7z.exe, xz.exe, bzip2 or other that is capable of uncompressing an .xz or bzip archive

Installing gawk example below :

  1. Extract gawk.exe from gawk-4.1.3-1.tar.xz archive using the command - 7z.exe e -so gawk-4.1.3-1.tar.xz | tar xvf -
  2. Once that is done, you should find gawk.exe in a subfolder usually, usr/bin under the release/gawk folder
  3. Find the dependencies for gawk - you can do this in a couple of ways.

    Examine the Cygwin setup.ini file found in x86 or x86_64 folder. Look for the string '@ gawk' and in the lines after this line you should find a "requires:" line that lists the dependencies.

    Mine reads like this - "requires: bash cygwin libgmp10 libintl8 libmpfr4 libreadline7"

For gawk to run, bash is not a must since we have the windows command shell. (bash is included to get a few other dlls required by gawk. However, that causes a lot more unnecessary files to be installed). The other dependencies contain files that gawk needs to run. Extract each of the above packages using tools like 7z or xz into individual files.

After all the dependencies are extracted, copy your needed tool(s) (grep/sed/gawk) to a folder and all the dependent .dlls You should now be able to run your tool with the minimum set of .dlls required in a bare-bones cygwin installation.

Caution : It may not be sufficient to just extract the dependencies listed in setup.ini for each tool. Sometimes, you may need to execute/run the tool to discover that there are more dlls required.

There are other means of finding out the dlls required by an exe - you can use dumpbin from MS or dependency walker, ndepends or similar tools to find the list of dependent dlls

Consult - https://stackoverflow.com/questions/362560/how-do-i-detect-the-dlls-required-by-an-application https://stackoverflow.com/questions/475148/how-do-i-find-out-which-dlls-an-executable-will-load

I also brute forced the dependent dll info by just running the tool and installing the missing dlls listed one by one by extracting from the required packages.

When you run a exe and if it errors out with a missing .dll message, search for the package that contains the dll here - https://cygwin.com/cgi-bin2/package-grep.cgi . Enter the full/partial name of the missing dll to find the name of the package containing the dll.

Eventually, I have ended up with a bare-bones cygwin install with only the tools and dlls that I need. Example : gawk - gawk.exe and the following dlls - cygwin1.dll, cyggmp-10.dll, cygiconv-2.dll, cygintl-8.dll, cygmpfr-4.dll, cyggcc_s-seh-1.dll, cygncursesw-10.dll, cygreadline7.dll

sed - sed.exe and dlls - cygwin1.dll, cygintl-8.dll

Hope this is found useful. The Cywin installer also does dll re-basing, which I will not venture into here