Cygwin install tips using cyg-apt
I recently got a new computer at work and needed to reinstall Cygwin. Here is my install procedure using the very nice cyg-apt script. It's like Debian's apt-get for Cygwin! Note, this install process assumes that I have all my init files backed up and can copy them over to my new machine.
- Run the Cygwin setup program and install the default packages plus
wgetandpython. - Set the Windows user environment variable
HOMEtoc:\home\sofeng. Note, I tried it with forward slashes, but then it doesn't work in my Windows batch file. - Start the Cygwin bash shell
- Change the cygdrive prefix:
mount -s --change-cygdrive-prefix /
If you don't have admin privileges:
mount -u --change-cygdrive-prefix / - Copy over my init files and startup scripts:
- ~/bin/startxwin.bat
This is the Windows batch file that I use to start my Cygwin/X environment. It does the following:- Adds
~/binto myPATH cds to myHOMEdirectory- Starts the
ratpoisonwindow manager with aurxvtterminal runningscreen
- Adds
- ~/.Xdefaults
Sets the colors, font, and scrolling behavior forurxvt. - ~/.bashrc
- Sets the
PS1(prompt),EDITOR,http_proxy, and other environment variables. - Sets a lot of aliases
- Sets bash filename completion to be case insensitive
- Sets the
- ~/.cyg-apt
- ~/.emacs
- ~/.emacs.d
- ~/.inputrc
- ~/.screenrc
- /etc/ssmtp/ssmtp.conf
- /var/cron/tabs/sofeng
- ~/bin/startxwin.bat
- Install
cyg-apt$ wget http://www.lilypond.org/~janneke/software/cyg-apt $ chmod a+xr cyg-apt $ mv cyg-apt ~/bin
- Install good stuff (note, if you don't already have
~/.cyg-apt, you will need to runcyg-apt setupfirst):$ cyg-apt install rsync Best backup utility $ cyg-apt install screen Terminal multiplexer $ cyg-apt install xorg-x11-base X Windows $ cyg-apt install rxvt-unicode-X Better Xterm $ cyg-apt install diffutils diff $ cyg-apt install gcc-core GCC C complier $ cyg-apt install make GNU make $ cyg-apt install xorg-x11-devel X header and library files for compiling ratpoisonor other programs$ cyg-apt install readline used for ratpoison$ cyg-apt install cron so I can schedule my backups and updatedb$ cyg-apt install ssmtp Sendmail replacement so cron can email me $ cyg-apt install emacs Terminal version of emacs for quick editing jobs from the shell
Other notes:
- I thought that I needed to add
c:/cygwin/binto my Windows path in order to usegrepin Emacs Windows. However, I later found out that this step is not needed. It is generally bad practice to addc:/cygwin/binto the Windows path. Instead, I added the required code in my .emacs file. See http://cygwin.com/faq/faq-nochunks.html#faq.using.ntemacs for more information. - I used to keep my http proxy server information in
~/.wgetrc, but now I store it in thehttp_proxyenvironment variable. (Note, it is lowercase and not uppercase. I don't know why this is.)
