16

In cygwin, how do I:

  • List all installed packages
  • List files belonging to a package
  • Tell which package a file belongs to
  • Install a new package
  • Uninstall a package
  • Get info about an installed package (deps, version, etc)

6 Answers 6

23

List all installed packages

cygcheck --check-setup --dump-only
  • without --dump-only the command will take few minutes to complete because it will TEST all packages. You should see an OK for each package if everything is fine ;)

List files belonging to a package

For package bash do:

cygcheck --list-package bash
  • it works for installed packages only

Tell which package a file belongs to:

For file /usr/bin/bash.exe

cygcheck --find-package /usr/bin/bash.exe
  • it works for installed packages only

Install a new package

Considering you already run setup GUI and have valid mirror(s), local package directory and other options set, you could run to install abook:

/path/to/setup-1.7.exe --quiet-mode --download --local-install --packages abook
  • it will also automatically update all your installed packages to the latest version available
  • you could also select the mirror and other options in command line, see /path/to/setup-1.7.exe --help
  • I know the new version of cygwin 1.7 (beta version, but pretty stable) which currently uses setup 2.649 supports these options, but I didn't tested on 1.6

Uninstall a package

As far as I know, only the GUI supports this option.

Get info about an installed package (deps, version, etc)

The version is listed together to each package on the listing (first item). Deps are really tricky to find: when setup runs, it creates on the local package directory one entry for each mirror. There you can find the list of all packages available on that mirror (setup.ini for version 1.6 and setup-2.ini for version 1.7) with the package name preceded by a @ and deps preceded by requires:. If, for any reason, the mirror you are using is outdated, setup displays a warning message when downloading info.

3
  • At least as of version 2.8, there is a -x --remove-packages option as well to remove packages via the command line.
    – Howler
    Oct 14, 2013 at 18:54
  • @Howler apt-cyg remove works, but you first need the tool, see @kevin's answer.
    – Timo
    Mar 29, 2018 at 15:12
  • apt-cyg install package for installation.
    – Timo
    Mar 29, 2018 at 15:14
3

Run setup.exe. It will give you a GUI with checkboxes for various packages.

4
  • 5
    IMO this is cygwins main failing. We need a real package manager! Nov 10, 2009 at 23:45
  • 1
    I saw some posts on the maillist. Someone is working on an apt equivalent for cygwin. It may show up as part of 1.7
    – Zoredache
    Nov 11, 2009 at 0:27
  • @Joseph: that sounds really cool. Thanks for letting us know. Nov 11, 2009 at 12:48
  • Real package manager isn't possible, since it's not possible to overwrite files in use on Windows. You have to close Cygwin before doing upgrade and then you can use external package manager (Cygwin's setup.exe). The most complete package manager is apt-cyg, I don't think, there will be anything better. Apr 17, 2014 at 20:50
3

Here is the best fork right now for apt-cyg. https://github.com/kou1okada/apt-cyg

3

I have found apt-cyg useful for command line installation of packages without updating all my other packages but it does not everything you need to do.

1
  • There is no equivalent to apt show, apt policy or apt search in ubuntu.
    – Timo
    Mar 29, 2018 at 15:20
1

It is now possible to uninstall packages as well:

/path/to/setup.exe -x yourpackagename
0

Allow me to introduce you to the Cygwin FAQ

  • List installed
  • How do I uninstall individual packages
  • How do I uninstall individual packages
  • Get info about an installed package

Run Cygwin Setup

  • List files belonging to a package
  • Tell which package a file belongs to

Search at http://cygwin.com/packages/

You must log in to answer this question.