DarkMatter in Cyberspace
  • Home
  • Categories
  • Tags
  • Archives

Cygwin on Windows 10


相关文件夹:

  • Package cache: d:\warez\cygwinPackages

  • Installation directory: d:\apps\cygRoot

  • User home directory: d:\docs\cygHome

安装步骤:

  1. 从cygwin官网下载setup-x86_64.exe

  2. 安装cygwin核心:在Windows命令行中执行 setup-x86_64.exe --no-admin -q -n -R d:\apps\cygRoot -s http://mirrors.163.com/cygwin/ -l d:\warez\cygwinPackages

  3. 修改$Home目录:在 D:\apps\cygRoot\etc\nsswitch.conf 文件中增加 db_home: /cygdrive/d/docs/cygHome;

  4. 定义启动快捷键Alt-F10:在Autohotkey脚本中添加 !F10:: Run D:\apps\cygRoot\bin\mintty.exe -i /Cygwin-Terminal.ico -

  5. 修改用户名:启动cygwin,执行命令 mkpasswd -c > /etc/passwd

  6. 安装新包:在Windows命令行中执行 setup-x86_64.exe --no-admin -q -n -R d:\apps\cygRoot -s http://mirrors.163.com/cygwin/ -l d:\warez\cygwinPackages -P tmux,python3,vim,zsh,fzf-zsh,git,curl,zip,unzip,python3-setuptools,the_silver_searcher,procps-ng

  7. 安装pip:cygwin中执行easy_install-x.y pip,例如easy_install-3.4 pip

  8. 安装oh-my-zsh:git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh

  9. 安装autojump: git clone git://github.com/joelthelion/autojump.git cd autojump ./install.py echo '[[ -s /cygdrive/d/docs/cygHome/.autojump/etc/profile.d/autojump.sh ]] && source /cygdrive/d/docs/cygHome/.autojump/etc/profile.d/autojump.sh' >> ~/.zshrc

  10. 安装Vundle: git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim` vim +PluginInstall

  11. 使用vi启动vim:在~/.bash_aliases中增加alias vi='vim'

  12. 恢复配置和笔记 mkdir $HOME/apps cd $HOME/apps git clone git@github.com:leetschau/sysClone.git git clone git@github.com:leetschau/dsnote.git // download dsnote tarball dn r

  13. 使用zsh作为登录shell:将/etc/passwd中的登录shell改为/bin/zsh

说明:

  • 不要安装到C盘,不要使用管理员权限安装:setup-x86_64.exe --no-admin

  • cygwin使用Alt-F11作为全屏快捷键,所以这里将启动快捷键改为Alt-F10

  • 使用cygcheck -p <package-name>来搜索package,类似于apt search ...

  • cygwin中可以直接使用Windows中的环境变量,大小写必须与Windows中的定义一致, 在Windows命令行中用set命令列出所有环境变量,在cygwin下用env列出所有环境变量

Uninstall cygwin

  • Uninstall services: cygrunsrv -L
  • Delete cygwin root folders: d:\apps\cygRoot

待解决问题

  • fzf无法用Ctrl-R搜索命令历史:在 sysClone/confs 中增加文件~/.fzf.zsh

参考

  • cygwin网易开源镜像站

  • cygwin安装程序命令行参数列表



Published

Feb 27, 2017

Last Updated

Feb 27, 2017

Category

Tech

Tags

  • cygwin 5
  • windows 67

Contact

  • Powered by Pelican. Theme: Elegant by Talha Mansoor