47

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
  • 3,492
  • 7
  • 27
  • 23
  • 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 Sep 14 '09 at 16:17
  • @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 Jun 30 '15 at 23:56

1 Answers1

67
lynx -source rawgit.com/transcode-open/apt-cyg/master/apt-cyg > apt-cyg
install apt-cyg /bin
apt-cyg install bc
Zombo
  • 1
  • 24
  • 120
  • 163
knorv
  • 3,492
  • 7
  • 27
  • 23
  • 5
    Nice. (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 Sep 14 '09 at 16:47
  • 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 Sep 14 '09 at 17:34
  • Huzzah!! Excellent tip.. – Fergal Moran Jun 01 '11 at 09:30
  • 1
    Any alternatives if neither wget nor curl are not installed? – Erik Kaplun Sep 13 '12 at 20:58
  • 2
    This is so awesome I've been looking for this my entire life – ardiyu07 May 15 '13 at 13:28
  • 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 Jan 18 '14 at 06:51
  • 1
    @chovy: you get wget on the machine by running the setup again and selecting wget – doublehelix May 04 '14 at 14:26
  • 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 Jun 30 '15 at 23:58
  • @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 Jul 10 '15 at 12:14
  • 2
    @jeremytwfortune - *"how hard is it to just run the setup again?"* - that's actually a very good UX question. `sudo install ` 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 Jul 11 '15 at 00:29
  • @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 Jul 13 '15 at 01:05