Windows下安裝Cygwin及包管理器apt-cyg(轉)

本文爲轉載文章:
 http://www.2cto.com/os/201212/176551.html

Cygwin能夠在Windows下使用unix環境Bash和各類功能強大的工具,對於Linux管理員來講不想使用Linux桌面是必備的工具。
Cygwin下也有相似Linux下包管理工具apt-cyg,能夠方便的經過網絡安裝各類軟件。
1. 下載安裝:http://cygwin.com/setup.exe
2.選擇安裝源及軟件,如需安裝apt-cyg需安裝如下軟件包:
 
wget
tar
gawk
bzip2
 
3.Cygwin安裝完成後打開Cygwin Terminal安裝apt-cyg包管理器:
 
wget http://apt-cyg.googlecode.com/svn/trunk/apt-cyg -P /bin
chmod.exe +x /bin/apt-cyg
 
apt-cyg安裝源爲ftp://mirror.mcs.anl.gov,設置爲網易鏡像源。
 

apt-cyg update --mirror http://mirrors.163.com/cygwin/html

 
使用apt-cyg安裝軟件:
 
apt-cyg update
#更新源
apt-cyg install ping -u
#使用參數u沒必要每次都更新源
Working directory is /setup
Mirror is http://mirrors.163.com/cygwin/
 
Installing ping
Found package ping
--2012-12-05 09:59:20--  http://mirrors.163.com/cygwin//release/ping/ping-1.0-1.tar.bz2
正在解析主機 mirrors.163.com (mirrors.163.com)... 123.58.173.89, 123.58.173.106
正在鏈接 mirrors.163.com (mirrors.163.com)|123.58.173.89|:80... 已鏈接。
已發出 HTTP 請求,正在等待迴應... 200 OK
長度:8352 (8.2K) [application/octet-stream]
正在保存至: 「ping-1.0-1.tar.bz2」
 
100%[==============================================>] 8,352       --.-K/s 用時 0.1s
 
2012-12-05 09:59:21 (64.1 KB/s) - 已保存 「ping-1.0-1.tar.bz2」 [8352/8352])
 
Unpacking...
Package ping requires the following packages, installing:
cygwin
Package cygwin is already installed, skipping
Package ping installed
 
Cygwin安裝procps,包含uptime/free/top等經常使用工具:
 
bin/prockill.exe
bin/procps.exe
sbin/sysctl.exe
usr/bin/free.exe
usr/bin/pgrep.exe
usr/bin/pkill.exe
usr/bin/pmap.exe
usr/bin/pwdx.exe
usr/bin/skill.exe
usr/bin/slabtop.exe
usr/bin/snice.exe
usr/bin/tload.exe
usr/bin/top.exe
usr/bin/uptime.exe
usr/bin/vmstat.exe
usr/bin/w.exe
usr/bin/watch.exe
 
DOS命令輸出編碼爲GBK,Cygwin下默認爲UTF-8,兼顧顯示亂碼的問題設置Cygwin編碼爲GBK:
 
export LANG="zh_CN.GBK"
 
其它設置:
 
alias ls="ls --color=auto"
export PS1="\[\e]0;\w\a\]\[\e[32m\]\u@\h:\[\e[33m\]\w\[\e[0m\]\$ "
相關文章
相關標籤/搜索