Cygwin安裝與使用
1. Cygwin安裝
從Cygwin官網下載在線安裝包.
安裝Cygwin. 安裝時記得裝上常用的包: wget, tar, gawk, bzip2.
注意選源的時候, 選一個國內的源, 下載速度會快很多.
2. 安裝apt-cyg
在Cygwin終端,輸入:
wget http://apt-cyg.googlecode.com/svn/trunk/apt-cyg
chmod +x apt-cyg
mv apt-cyg /usr/local/bin/
事實上谷歌無法訪問之後這個鏈接已經不能用了. 這裏提供一個可用的下載地址apt-cyg程序及教程.
3. apt-cyg常用指令
設置安裝源
apt-cyg -m http://mirrors.163.com/cygwin
更新源
apt-cyg update
安裝軟件
apt-cyg install xxx
卸載軟件
apt-cyg remove xxx
4. 常見問題
(1) apt-cyg安裝軟件出現MD5 sum did not match, exiting錯誤
在Win10 64位操作系統上使用apt-cyg安裝軟件時, 出現了MD5 sum did not match, exiting錯誤.有博客說是現在的apt-cyg還沒有支持新的x86_64架構.
找到apt-cyg文件, 前面我們將其複製到/usr/local/bin目錄下, 如果忘了也可以用whereis查找:
$ whereis apt-cyg
apt-cyg: /usr/local/bin/apt-cyg
使用vim打開apt-cyg文件, 搜索”MD5 sum”, 發現如下代碼:
# check the md5
digest=`cat "desc" | awk '/^install: / { print $4; exit }'`
digactual=`md5sum $file | awk '{print $1}'`
if ! test $digest = $digactual
then
echo MD5 sum did not match, exiting
exit 1
fi
將exit 1這一行註釋掉, 之後哪怕報錯, 程序也會繼續執行.