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这一行注释掉, 之后哪怕报错, 程序也会继续执行.