How To Install Packages In Cygwin

How To Install Packages In Cygwin 4,9/5 6785votes
How To Install Packages In Cygwin

November 2017 Update: If you are using Windows 10, I would instead suggest reading my posts or which goes through loading Linux on Windows using official Microsoft services. Linux in Windows? Cygwin is an awesome tool for agnostic operating system users who regularly use both Windows and Linux but want the power of a Linux shell and its tools running within Windows.

Step 2: Run Setup to Select, Download & Install Cygwin Packages Run 'setup-x86_64.exe' ⇒ Install from Internet ⇒ select a directory.

It is an excellent replacement for the primitive Windows command prompt without the need to learn a new collection of commands or a new scripting language. A requirement which is needed for the Microsoft developed and recommended Command Prompt alternative PowerShell.

Cygwin is (Portable Operating System Interface for uniX) compliant which means it shares a standard API with all the other compliant operating systems. It does not say applications compiled for other POSIX systems such as Linux software will automatically work within Cygwin. To add new POSIX software you still need to compile the software source code under Cygwin using its compilers and libraries. This process is a requirement for most POSIX compliant operating systems e.g.

Software compiled for FreeBDS (Unix) will not work under Debian/Ubuntu (Linux). Cygwin will work on any x86 32-bit or x86-64 editions of Windows NT from NT 4.0 Service Pack 4 (1998) onwards to Windows 7 including 2000, 2003, 2008, XP and Vista. Pete Droge Under The Waves Download. There is no support for the Windows 16/32-bit hybrids such as 95, 98 or ME. Installation So let’s get started.

Visit, download then run the setup.exe. This file is a Windows-based package manager for Cygwin. By default, it will download and install the latest minimal install of Cygwin, but on future launches, it will also enable you to add new packages and update your existing Cygwin software. So after you install Cygwin do not delete or lose the location of setup.exe! Cygwin Net Release Setup Program (setup.exe). For Choose A Download Source select Install from Internet.

Select Root Install Directory. By default Cygwin will install to C: cygwin but you can change this to any directory of your choosing. I recommend that you do not choose a directory path which contains spaces in the name, so both C: Program Files cygwin or C: Program Files (x86) cygwin are out. Select Local Package Directory. Cygwin setup will save all downloaded packages to this folder after it has finished the installation. You can then either delete them, leave them in this directory or back them up to a USB stick for future use on this or other computers.

Select Your Internet Connection. Unless otherwise needed you should leave the Internet Connected selection with the default selection of Direct Connection. Choose A Download Site. Choose A Download Site lets you select a file repository from where Cygwin setup will download the packages and files.

It is preferable to pick a download location from a site that is physically close to your own. But if you can not determine this from the country codes in the URL or cannot find a suitable mirror then just select the first item. Selecting packages Select Packages. This Select Packages screen is the most critical part of the Cygwin setup. It is the Cygwin package manager interface, equivalent to in Debian and Ubuntu or in Fedora Linux. The screen capture has some arrows pointing to features of the interface, but as a first time user you can completely ignore all of these and press Next to accept the default installation.

• The dark green solid arrow points to the search dialogue enabling you to quickly filer packages by name. Unfortunately, the search does not work on the package descriptions. • The solid black arrow has four radio buttons enabling you to mass-apply installation restrictions on all packages. • Keep tells Cygwin setup not to update any installed packages.

• Prev is short for previous which reverts all packages to the previous version. • Curr is the default and recommended option as it installs the current version of all selected packages. • Exp will install the most current or experimental version of all selected packages. • The red arrows point to the manager categories which can be expanded to reveal individual packages. • The purple arrow points to version numbers which belong to packages that are already installed onto Cygwin. • Orange arrow enables you to manually override the global package version (black arrow radio buttons). • Skip means the package has not been installed and setup will ignore it.

• Keep means the package has been installed but the setup will ignore it. • Reinstall will overwrite an existing package installation with the same version of a fresh download. • 1.0-1 or some other version number means setup will install this version of the package for the first time. • Source means setup will ignore the installed package but will download the source codes. • Uninstall removes the installed package from your Cygwin installation. • The yellow arrow points to a Binary check-box while the light green points to a Source check-box.

These check-boxes only appear only when available in the package New column. • The light blue arrow is the package download size in Kilobytes.

• Dark blue contains the package name and a brief description. Cygwin setup will now download and install all the default-install packages. Wait until the Progress screen is complete and go to the Next screen. Create Icons & Install Complete. Create Icons enable you to add Desktop and Start Menu shortcuts, once finished use either shortcut to launch Cygwin.

Bash terminal Welcome to Bash. Welcome to your Bash prompt in Windows! You can test this by running Bash version. Bash --version Display your version of Bash. The first thing I’d recommend doing is customising your bash shell to implement some aliases for basic colouring on a few staple Cygwin commands. Dir -A ~ Will reveal some hidden setting files in your home directory which you can edit these using a text editor, but please avoid using the standard Windows Notepad. I use Windows and would edit w: cygwin home Ben.bashrc, but you would probably need to update c: cygwin home [User name].bashrc.

Windows may have issues opening a file which it sees as only having an extension but lacking a file name. If this is the case, just use the Open With dialogue but make sure you have the Always use the selected program to open this kind of file check-box left unchecked.

The yellow highlights the settings I would recommend to un-comment. Bash settings file after the comments have been removed. Once you have finished your changes, you can apply them by reloading Bash.

Bash --login Test your new alias and option defaults. Cd / ll You now see a colourised directory and file listing of the Cygwin root.

Line list of root. This is the same directory as you chose during the Cygwin setup installation which by default is c: cygwin. You can use either Windows File Explorer, Windows command prompt or Cygwin to modify the contents of the root. For more details on how Cygwin handles POSIX permissions within Windows and other potential incompatibilities, I’d recommend reading the in Cygwin chapter in the manual. Tips By default, there is no Cygwin clear command ( cls in command prompt), but the easiest way to clean your terminal is to press [Ctrl] l. Use the [Tab] key on your keyboard to auto-complete commands, file and directory names. This Bash feature is superior to the basic Tab auto-complete used by Windows command prompt.

Did you also know you can chain 2 or more commands together using a semi-column; character as the separator? Cd /; echo 'Root Directory'; ls; cd ~; echo 'My Home Directory'; ls And if you didn’t realise in the command above, change directory forward-slash cd / takes you to the Cygwin root, while change directory tilde cd ~ takes you to your user home directory. Drill down of the Cygwin root • Cygwin.bat is the Windows batch file used to launch a Cygwin Bash prompt from a Windows command prompt. • Cygwin.ico is a standard Windows icon file attached to the Cygwin batch file. • bin/ is a directory containing binary (execute) applications that have been compiled for use on Windows under Cygwin. In here are all the unique POSIX-like commands and applications that give you all that extra functionality that a bare-Windows install often lacks. • cygdrive/ contains a list of mounted Windows drive letters.

From here you can access any drive partition that is viewable to Windows. For example cygdrive/c/Windows/ would be the location of most peoples Windows installation. • dev/ is short for devices.

Traditionally for POSIX, this is where your detected hardware devices are listed, but in Cygwin its usage is mainly there for software compatibility and can be ignored. • etc/ contains all your Cygwin related configuration files.

Unlike the Windows registry, these should all be plain text files that can be edited within any Windows text editor (such as NotePad++) or a Cygwin editor such as VM or Nano. • home/ contains the user directories which are not unlike the Windows User directories.

It is where your non-Cygwin files such as documents, file downloads should be stored. • lib/ is an abbreviation for libraries. These are compiled, shared components used by various Cygwin commands and applications but you can ignore this directory. • proc/ is a virtual directory that allows you to display various aspects of your system using the cat command. • cat /proc/cpuinfo Displays your computer CPU details. • cat /proc/meminfo Displays your Windows memory information.

• cat /proc/mounts Lists your disk mounts within Cygwin. • tmp/ is the Cygwin temporary directory. • usr/ is the bread and butter of your Cygwin install. • usr/bin/ is identical to bin/ that was listed previously.

• usr/include/ are programming header files which are somewhat like shared libraries, and you can ignore this. • usr/local/ is a location where you can compile applications for yourself, again ignore if this does not interest you. • usr/sbin/ contains system binaries and applications tools for Cygwin system administration. • usr/share/ are platform independent read-only shared files such as documentation. For example /usr/share/fonts contain a collection of system fonts.

/usr/share/doc contains application documents. • usr/src/ is a location for storing application source code. • usr/ssl/ is a location for storing SSL (Secure Socket Layer) and TLS (Transport Layer Security) certificates which are used for Internet communication encryption and security.

• usr/tmp/ is the same temporary folder as /tmp. • var/ is where variable data files are stored. 2go Pc Drivers Download. These are files generated by yourself or applications. For example, all log files would go in /var/log.

If you ran an Apache HTTP daemon, the files it hosted would be contained in /var/www. POSIX and Cygwin commands Now the usage of a Bash shell or POSIX-like commands is out of the scope of this article. You can run dir /bin to see all the.exe execute commands available to you within Cygwin. Like Windows command prompt you do not need to include the file extension when running an application, dir works the same as dir.exe. If you need quick help on the usage of a command, use [command] –help e.g. Many commands share the same options. If you think the default Cygwin bash shell is a bit ugly, then you are not alone.

Microsoft does not give the default command prompt much love, and unfortunately, this is what Cygwin relies on for its terminal interface. You can change this though by again running Cygwin setup.exe. When you are back in the Select Packages screen, do a search for mintty.

Select to install the mintty binary package and once complete go to your Cygwin start menu. There should be a new mintty option in addition to the Cygwin Bash Shell. I think it would be the way to go especially if you run open source web servers such as Apache or Nginx.

Personally I use Windows as a desktop and ‘headless’ Linux for a server software. You can use a virtualization environment on Windows such as VirtualBox to run a terminal/shell aka server edition of Linux even with its own IP address. That way you get the best of both worlds. Ubuntu Server is probably a good bet if you are not familiar with Linux as its documentation & support is very extensive.

The default look of Cygwin. SSH on my customized Cygwin.

Install Cygwin Cygwin is available as a installable download. Although the site offers both 32-bit and 64-bit versions, you should use the 32-bit version (setup-x86.exe), regardless of your computer's architecture, as not everything works in the 64-bit version. Once you've downloaded setup-x86.exe, run the installer. The default options are all fine, so just click through all the prompts. Beware that the actual installation process may take up to an hour. Install apt-cyg You may have heard of programs like apt-get (Ubuntu), yum/dnf (Fedora), pacman (Arch), or brew (Mac OS X). These programs help manage the installation and upkeep of other command line programs on their respective operating system (for this reason, they are known as 'package managers').

The analogous program for Cygwin is called apt-cyg. Installing apt-cyg is simple. First, save this file:. Then, use File Explorer to find the file in your Downloads folder and move it into C: cygwin bin. Then, open Cygwin and enter 'chmod +x /bin/apt-cyg'. This tells Cygwin that you want to be able to execute the apt-cyg command.

Lastly, enter 'apt-cyg mirror ftp://sourceware.org/pub/cygwin'. This sets up apt-cyg to use the official repository when downloading programs. Install packages Cygwin is really just a shell, so you'll need to install some packages to make it useful. Here's a bunch I suggest to have for 15-122: • wget • curl • rlwrap • tar • gcc-core • libpng15 • libpng-devel • openssh • xorg-server • xinit • xorg-docs • xterm • make • gdb • vim • emacs You should install these packages using apt-cyg. To install a single package, enter into Cygwin something like 'apt-cyg install gcc-core'.

To install several at a time, use something like 'apt-cyg install xinit xorg-docs xterm make'. You might find that some of the packages are already installed, and that's okay. There are tons of packages available to install in Cygwin, including familiar programs like python, idle, git, and zip, so feel free to check them out! Set up X-Forwarding I promise this is easier than using X-Win32. Just enter this into Cygwin: 'echo 'export DISPLAY=:0.0' >>~/.bashrc' Install C0 Locally (optional) Enter the following into Cygwin: • mkdir /opt • cd /opt • wget • tar -xzvf cc0-v0440-cygwin-bin.tgz • rm cc0-v0440-cygwin-bin.tgz • echo 'export PATH=/opt/cc0/bin:$PATH' >>~/.bashrc How do I use Cygwin?

How to SSH into AFS Just use 'ssh @unix.andrew.cmu.edu'. For example, since my AndrewID is adbenson, I would type 'ssh adbenson@unix.andrew.cmu.edu'.

How to SSH into AFS, but with X-Forwarding enabled First type 'xwin -multiwindow &' so that X-Forwarding begins running, then SSH with the -Y flag, as in (for me) 'ssh -Y adbenson@unix.andrew.cmu.edu'. How to run C0 Locally First, make sure you've installed C0 Locally, as detailed above. Then you should be able to use coin or cc0 just like on AFS. How to Troubleshoot Josh Korn (jkorn) and I (adbenson) both have some experience in setting up and using Cygwin.

If you post on Piazza or email us, we would be glad to assist you in any way we can.