Installing Cygwin packages from the command-line

46

24

Possible Duplicate:
upgrading and installing packages through the cygwin command line?

I'm looking for a "yum"-link method to install additional Cygwin packages from the command-line. Let's say I want to add the package "Math/bc", then ideally I'd like to be able to do it using one command as in:

yum install bc

Currently the only way I've found to install new packages is to locate and run the installation file SETUP.EXE file and then scroll to the relevant package, add it, etc. This is quite cumbersome so I'm sure there is a smarter command-line way to add an additional package.

knorv

Posted 2009-09-14T16:05:37.487

Reputation: 3 392

Question was closed 2009-09-14T16:58:41.493

@innaM - all the duplicates indicate Cygwin needs to provide a package manager. Unsuspecting users like me take it for granted one is available and installed. I think its the only modern Unix and Linux distro without one... – jww – 2015-06-30T23:56:41.023

1

This is a dupe and has been asked yesterday: http://superuser.com/questions/40545/upgrading-and-installing-packages-through-the-cygwin-command-line

– innaM – 2009-09-14T16:17:50.137

Answers

67

lynx -source rawgit.com/transcode-open/apt-cyg/master/apt-cyg > apt-cyg
install apt-cyg /bin
apt-cyg install bc

knorv

Posted 2009-09-14T16:05:37.487

Reputation: 3 392

My god this is a cripple distribution... Not only do they lack a package manager, they don't even include the tools needed to install one. Why do people use it? – jww – 2015-06-30T23:58:59.103

@jww, For one thing, it isn't a "distribution". It's an emulator. There's no kernel. Two, and more importantly, how hard is it to just run the setup again? Cygwin used to include tons of things on initial install until they realized that people want to install what people want to install and no more. – Jeremy Fortune – 2015-07-10T12:14:38.690

1@jeremytwfortune - "how hard is it to just run the setup again?" - that's actually a very good UX question. sudo <pkg mgr> install <package> is *one* step and the process is complete. I deleted setup after installation (setup was complete), so I have to download it again, click through screens, search, select, click through some more screens. That's about *six* steps. From a UX standpoint, which do you think is better? – jww – 2015-07-11T00:29:02.850

@jww, I do understand your point regarding experience. Since Cygwin is a Windows POSIX emulator, it made sense to me that they'd use a gui for the initial install. It would definitely be nice for it to come with a command-line package installer. To more directly answer your question, people use Cygwin because it gives you a unx-like experience while saying in Windows and giving you quite a bit of control over the dividing line. – Jeremy Fortune – 2015-07-13T01:05:39.457

Huzzah!! Excellent tip.. – Fergal Moran – 2011-06-01T09:30:53.417

5Nice. (Of course, you wouldn't be able to install wget this way - nor chmod or mv :) Will this install dependencies as well? What effect does this have on subsequent uses of setup, i.e., your "local package directory", etc? – Chris Noe – 2009-09-14T16:47:49.877

Chris: Yes, dependencies are handled automatically. I believe the script uses the same install mechanism as SETUP.EXE, so if that is correct then there should be no mismatch. – knorv – 2009-09-14T17:34:58.567

1Any alternatives if neither wget nor curl are not installed? – Erik Kaplun – 2012-09-13T20:58:05.330

2This is so awesome I've been looking for this my entire life – ardiyu07 – 2013-05-15T13:28:47.433

I think the built in cygwin setup-x86.exe (previously setup.exe) does all this now. Use the -q flag and the -P flag – ErichBSchulz – 2014-01-18T06:51:51.910

1@chovy: you get wget on the machine by running the setup again and selecting wget – doublehelix – 2014-05-04T14:26:19.503