1.使用setup,然后一路安装到select package,选择需要的包即可,然后一路next。

2.setup.exe -q -P 包名, 详细用法如下:

Command Line Options:
-A --disable-buggy-antivirus Disable known or suspected buggy anti
virus software packages during execution.
-C --categories Specify entire categories to install
-D --download Download from internet
-d --no-desktop Disable creation of desktop shortcut
-h --help print help
-K --pubkey Path to extra public key file (gpg format)
-L --local-install Install from local directory
-l --local-package-dir Local package directory
-n --no-shortcuts Disable creation of desktop and start menu
shortcuts
-N --no-startmenu Disable creation of start menu shortcut
-O --only-site Ignore all sites except for -s
-P --packages Specify packages to install
-p --proxy HTTP/FTP proxy (host:port)
-q --quiet-mode Unattended setup mode
-r --no-replaceonreboot Disable replacing in-use files on next
reboot.
-R --root Root installation directory
-S --sexpr-pubkey Extra public key in s-expr format
-s --site Download site
-U --keep-untrusted-keys Use untrusted keys and retain all
-u --untrusted-keys Use untrusted keys from last-extrakeys
-X --no-verify Don't verify setup.ini signatures

3.在cygwin上安装wget

4.在cygwin上安装apt-cyg(https://www.fir3net.com/UNIX/Linux/cygwin-package-installation.html)

(1)使用cygwin-setup下载并安装必要的工具:

C:\Windows\System32>C:\Users\admin\Downloads\setup.exe -q -P wget,tar,qawk,bzip2,subversion,vim

(2)下载并安装apt-cyg

$ svn --force export http://apt-cyg.googlecode.com/svn/trunk/ /bin/
$ chmod +x /bin/apt-cyg

(3)apt-cyg语法 

"apt-cyg install <package names>" to install packages
"apt-cyg remove <package names>" to remove packages
"apt-cyg update" to update setup.ini
"apt-cyg show" to show installed packages
"apt-cyg find <pattern(s)>" to find packages matching patterns
"apt-cyg describe <pattern(s)>" to describe packages matching patterns
"apt-cyg packageof <commands or files>" to locate parent packages

(4) 举例

$ apt-cyg install rsync
Working directory is /setup
Mirror is ftp://mirror.mcs.anl.gov/pub/cygwin
--2011-05-09 06:44:24-- ftp://mirror.mcs.anl.gov/pub/cygwin/setup.bz2
=> `.listing'
Resolving mirror.mcs.anl.gov (mirror.mcs.anl.gov)... 2620:0:dc0:1800:214:4fff:fe7d:1b9, 146.137.96.15, 146.137.96.7
Connecting to mirror.mcs.anl.gov (mirror.mcs.anl.gov)|2620:0:dc0:1800:214:4fff:fe7d:1b9|:21... failed: Connection timed out.
Connecting to mirror.mcs.anl.gov (mirror.mcs.anl.gov)|146.137.96.15|:21... connected. !! Output Omitted !! 2011-05-09 06:45:16 (131 KB/s) - `rsync-3.0.8-1.tar.bz2' saved [272248] Unpacking...
Package rsync requires the following packages, installing:
libgcc1 libiconv2 libpopt0 cygwin
Package libgcc1 is already installed, skipping
Package libiconv2 is already installed, skipping
Package libpopt0 is already installed, skipping
Package cygwin is already installed, skipping
Package rsync installed

5.查找包是否存在:cygcheck

Usage: cygcheck [-v] [-h] PROGRAM
cygcheck -c [-d] [PACKAGE]
cygcheck -s [-r] [-v] [-h]
cygcheck -k
cygcheck -f FILE [FILE]...
cygcheck -l [PACKAGE]...
cygcheck -p REGEXP
cygcheck --delete-orphaned-installation-keys
cygcheck --enable-unique-object-names Cygwin-DLL
cygcheck --disable-unique-object-names Cygwin-DLL
cygcheck --show-unique-object-names Cygwin-DLL
cygcheck -h List system information, check installed packages, or query package database. At least one command option or a PROGRAM is required, as shown above. PROGRAM list library (DLL) dependencies of PROGRAM
-c, --check-setup show installed version of PACKAGE and verify integrity
(or for all installed packages if none specified)
-d, --dump-only just list packages, do not verify (with -c)
-s, --sysinfo produce diagnostic system information (implies -c -d)
-r, --registry also scan registry for Cygwin settings (with -s)
-k, --keycheck perform a keyboard check session (must be run from a
plain console only, not from a pty/rxvt/xterm)
-f, --find-package find the package to which FILE belongs
-l, --list-package list contents of PACKAGE (or all packages if none given)
-p, --package-query search for REGEXP in the entire cygwin.com package
repository (requires internet connectivity)
--delete-orphaned-installation-keys
Delete installation keys of old, now unused
installations from the registry. Requires the right
to change the registry.
--enable-unique-object-names Cygwin-DLL
--disable-unique-object-names Cygwin-DLL
--show-unique-object-names Cygwin-DLL
Enable, disable, or show the setting of the
\"unique object names\" setting in the Cygwin DLL
given as argument to this option. The DLL path must
be given as valid Windows(!) path.
See the users guide for more information.
If you don't know what this means, don't change it.
-v, --verbose produce more verbose output
-h, --help annotate output with explanatory comments when given
with another command, otherwise print this help
-V, --version print the version of cygcheck and exit Note: -c, -f, and -l only report on packages that are currently installed. To
search all official Cygwin packages use -p instead. The -p REGEXP matches
package names, descriptions, and names of files/paths within all packages.

6. 官方帮助地址:

https://cygwin.com/faq.html#faq.setup

https://cygwin.com/cygwin-ug-net/using-utils.html#cygcheck

最新文章

  1. Expression Tree Basics 表达式树原理
  2. Sql Server聚集索引创建
  3. HTML+CSS+JS学习总结
  4. jquery 异步请求Demo【转载】
  5. RabbitMQ安装以及java使用(二)
  6. 1.MAVEN项目的创建与问题的解决
  7. Go命令官方指南【原译】
  8. BIO 和 NIO
  9. java.lang.StackOverflowError
  10. Luogu P2519 [HAOI2011]problem a
  11. 20170906xlVBA_GetEMailFromDocument
  12. 实习番外篇:解决C语言使用Makefile无法实现更好的持续集成问题
  13. Material Designer的低版本兼容实现(九)—— Float Button &amp; Small Float Button
  14. Gitlab 项目上传
  15. 2018.09.26 bzoj5218: [Lydsy2017省队十连测]友好城市(回滚莫队)
  16. AAC音频格式详解
  17. Linux学习(四)档案与目录管理
  18. selenium自动化之稳定版本环境介绍
  19. 【转】Ubuntu 14.04 引导修复(Boot Repair)(双系统修复一)
  20. Android内存优化(四)解析Memory Monitor、Allocation Tracker和Heap Dump

热门文章

  1. PHP检查表单提交是否来自于本站(验证HTTP_REFERER等)
  2. latin1字符集在navicat下显示乱码(mysql)
  3. linux内核--几个上下文(context)
  4. oracle启动
  5. Code Forces 711C Coloring Trees
  6. Mina学习之IoHandler
  7. Web资源文件的加载
  8. Ajax 整理总结(入门)
  9. win7下jdk安装环境变量配置
  10. FC网络学习笔记02 -网络配置方法