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
- Set the Windows user environment variable
c:\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:
This is the Windows batch file that I use to start my Cygwin/X environment. It does the following:
cds to my
- Starts the
ratpoisonwindow manager with a
Sets the colors, font, and scrolling behavior for
- Sets the
http_proxy, and other environment variables.
- Sets a lot of aliases
- Sets bash filename completion to be case insensitive
- Sets the
$ 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 run
$ 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
$ cyg-apt install cron so I can schedule my backups and
$ 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
- I thought that I needed to add
c:/cygwin/binto my Windows path in order to use
grepin Emacs Windows. However, I later found out that this step is not needed. It is generally bad practice to add
c:/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 the
http_proxyenvironment variable. (Note, it is lowercase and not uppercase. I don't know why this is.)
7 Comments — Comments feed for this post
#1 johne59 commented on 2008-03-16:
I had to make two edits to cyg-apt to get it to work:
1) root = '/'
2) mirror = 'http://sources-redhat.mirror.redwire.net/cygwin'
My cygwin root os set to '/' and it didn't appear that the http://mirrors.rcn.net/pub/sourceware/cygwin mirror was working.
#2 sofeng commented on 2008-03-26:
taking a look back, it seems like i needed to modify the mirror also. sorry for not noting that in the post. the weird thing is that my current version of cyg-apt is much different than the one from the location i posted. i wonder if the cyg-apt script auto updated itself. or did i download a different version and not remember? it turns out there is a much newer version located at http://lilypond.org/cygwin/cyg-apt. The modified date says 02-Jun-2007. I'm not sure why there are two versions on the site.
#3 bkline commented on 2008-06-19:
Be careful not to use cyg-apt to update a package that cyg-apt itself needs. I once ran cyg-apt install bzip2 to bring bzip2 up to the latest version, and was hosed: bzip2 was gone!
#4 roger commented on 2009-03-04:
Looks like there's also an apt-cyg http://stephenjungels.com/jungels.net/projects/apt-cyg/
#5 Chris commented on 2009-10-21:
cyg-apt is also several current projects on Google Code:
http://code.google.com/p/cyg-apt/ (Mine: emphasis on ease of installation, robustness and features.)
http://code.google.com/p/maphew/wiki/CygApt (Aims include installing Cygwin from scratch.)
http://code.google.com/p/apt-cyg/ (New home of apt-cyg mentioned above: rather than a Python program like cyg-apt, this is a shell script.)
Both cyg-apt projects have strategies to handle packages cyg-apt itself depends on.
#6 Eliot commented on 2009-10-21:
Chris, thanks for your update of the other projects out there including your own. It is cool to see these projects being developed for Cygwin.
P.S. I see your cyg-apt project is based off of the one I used by Jan Nieuwenhuizen. That is great you are keeping the project maintained. And, of course, I love that fact that it is in Python.
#7 gabriel commented on 2010-09-20:
Not work against the proxy...
i set the http_proxy system variable and set this guy on wgetcr
the error Error in server response, closing control connection.