Cygwin configuration summary

Posted by wenxi on Sat, 07 Dec 2019 05:11:35 +0100

Cygwin is

  • A large collection of GNU and open source tools that provide features similar to Linux distributions on Windows

  • DLL (cygwin1.dll), which provides a large number of POSIX API functions.

Cygwin is not

  • A method of running a local Linux Application on Windows. If you want the application to run on Windows, you must rebuild the application from source.

  • A magic way to make native Windows applications know UNIX ∈ functions (such as signals, ptys, etc.). Again, if you want to take advantage of Cygwin's capabilities, you need to build the application from source.

Install Cygwin

Domestic source address

When selecting a site during installation, you must add your own domestic source, otherwise the download will be slow. Sohu is recommended

Install the third-party package management tool apt Cyg

wget https://raw.githubusercontent.com/transcode-open/apt-cyg/master/apt-cyg
mv apt-cyg /bin/apt-cyg
chmod +x /bin/apt-cyg
apt-cyg mirror http://mirrors.sohu.com/cygwin/

Usage of apt Cyg

install
  Install package(s).

remove
  Remove package(s) from the system.

update
  Download a fresh copy of the master package list (setup.ini) from the
  server defined in setup.rc.

download
  Retrieve package(s) from the server, but do not install/upgrade anything.

show
  Display information on given package(s).

depends
  Produce a dependency tree for a package.

rdepends
  Produce a tree of packages that depend on the named package.

list
  Search each locally-installed package for names that match regexp. If no
  package names are provided in the command line, all installed packages will
  be queried.

listall
  This will search each package in the master package list (setup.ini) for
  names that match regexp.

category
  Display all packages that are members of a named category.

listfiles
  List all files owned by a given package. Multiple packages can be specified
  on the command line.

search
  Search for downloaded packages that own the specified file(s). The path can
  be relative or absolute, and one or more files can be specified.

searchall
  Search cygwin.com to retrieve file information about packages. The provided
  target is considered to be a filename and searchall will return the
  package(s) which contain this file.

Install build environment

apt-cyg install gcc-core gcc-g++ gdb make autoconf automake libboost-devel

Install system management tools

apt-cyg install openssh openssl binutils util-linux bash-completion procps inetutils bind-utils

Install common tools

apt-cyg install git wget curl vim tree

Install python

apt-cyg install python python-ipython python-pip python-setuptools
apt-cyg install python3 python3-ipython python3-pip python3-setuptools

#pip configuration
mkdir ~/.pip
touch ~/.pip/pip.conf
echo -e "[global]\nindex-url = https://pypi.tuna.tsinghua.edu.cn/simple" > ~/.pip/pip.conf
python -m pip install --upgrade pip
pip install ipython

#Syntax check
pip install --user flake8
#Automatic code prompt
pip install --user jedi
#Auto import module
pip install --user isort
#Code formatting
pip install --user yapf

Installation help manual

apt-cyg install help2man man-db man-pages-posix

Install zsh

apt-cyg install zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Install nodejs

npm config set registry https://registry.npm.taobao.org
npm i -g tldr
tldr --update
npm i -g cnpm --registry=https://registry.npm.taobao.org
npm i -g yarn
yarn config set registry https://registry.npm.taobao.org

Super vim profile

wget -qO- https://raw.github.com/ma6174/vim/master/setup.sh | sh -x

Topics: Linux pip Cygwin npm Python