Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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)
share|improve this question

5 Answers 5

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.

share|improve this answer
    
+1 Very helpful answer, thanks! –  Anthony Aug 1 '12 at 23:19
    
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 '13 at 18:54

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

share|improve this answer
5  
IMO this is cygwins main failing. We need a real package manager! –  Joseph Kern Nov 10 '09 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 '09 at 0:27
    
@Joseph: that sounds really cool. Thanks for letting us know. –  Born To Ride Nov 11 '09 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. –  Dawid Ferenczy Apr 17 at 20:50

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.

share|improve this answer

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/

share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.