How do I install cygwin components from the command line?











up vote
151
down vote

favorite
62












Is there a tool in the Cygwin package similar to apt-get on Debian or yum on redhat that allows me to install components from the command line?










share|improve this question
























  • Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See What topics can I ask about here in the Help Center. Perhaps Super User would be a better place to ask. Also see Where do I post questions about Dev Ops?
    – jww
    Oct 27 '16 at 19:08








  • 4




    @jww, This isn't devops.
    – Pacerier
    Mar 4 '17 at 0:12















up vote
151
down vote

favorite
62












Is there a tool in the Cygwin package similar to apt-get on Debian or yum on redhat that allows me to install components from the command line?










share|improve this question
























  • Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See What topics can I ask about here in the Help Center. Perhaps Super User would be a better place to ask. Also see Where do I post questions about Dev Ops?
    – jww
    Oct 27 '16 at 19:08








  • 4




    @jww, This isn't devops.
    – Pacerier
    Mar 4 '17 at 0:12













up vote
151
down vote

favorite
62









up vote
151
down vote

favorite
62






62





Is there a tool in the Cygwin package similar to apt-get on Debian or yum on redhat that allows me to install components from the command line?










share|improve this question















Is there a tool in the Cygwin package similar to apt-get on Debian or yum on redhat that allows me to install components from the command line?







command-line cygwin






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 25 '14 at 1:46









Steven Penny

1




1










asked Feb 13 '12 at 11:51









vy32

11.7k2180159




11.7k2180159












  • Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See What topics can I ask about here in the Help Center. Perhaps Super User would be a better place to ask. Also see Where do I post questions about Dev Ops?
    – jww
    Oct 27 '16 at 19:08








  • 4




    @jww, This isn't devops.
    – Pacerier
    Mar 4 '17 at 0:12


















  • Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See What topics can I ask about here in the Help Center. Perhaps Super User would be a better place to ask. Also see Where do I post questions about Dev Ops?
    – jww
    Oct 27 '16 at 19:08








  • 4




    @jww, This isn't devops.
    – Pacerier
    Mar 4 '17 at 0:12
















Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See What topics can I ask about here in the Help Center. Perhaps Super User would be a better place to ask. Also see Where do I post questions about Dev Ops?
– jww
Oct 27 '16 at 19:08






Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See What topics can I ask about here in the Help Center. Perhaps Super User would be a better place to ask. Also see Where do I post questions about Dev Ops?
– jww
Oct 27 '16 at 19:08






4




4




@jww, This isn't devops.
– Pacerier
Mar 4 '17 at 0:12




@jww, This isn't devops.
– Pacerier
Mar 4 '17 at 0:12












9 Answers
9






active

oldest

votes

















up vote
88
down vote



accepted










There is no tool specifically in the 'setup.exe' installer that offers the
functionality of apt-get. There is, however, a command-line package installer
for Cygwin that can be downloaded separately, but it is not entirely stable and
relies on workarounds.



apt-cyg: http://github.com/transcode-open/apt-cyg



Check out the issues tab for the project to see the known problems.






share|improve this answer























  • Thanks! Just what I wanted to know. I wonder why they aren't mature?
    – vy32
    Feb 20 '12 at 2:53










  • Good question. I'm not entirely sure of the answer, actually.
    – Zorobabel
    Feb 25 '12 at 15:45






  • 4




    @vy32: because you didn't help to make them mature? :) They can't write themselves. Someone have to work on them. And since their usability is quite limited (to overwrite files currently in use on Windows you have to close Cygwin first, so it's not possible to execute any package manager in closed Cygwin :), there isn't many people interested.
    – Dawid Ferenczy
    Apr 17 '14 at 20:01






  • 6




    From another answer: setup-x86.exe -q -P packagename1,packagename2. Not as fancy as apt-get or even apt-cyg but it does the trick in most cases. And you can also run this from cmd.exe (after closing Cygwin).
    – guaka
    Jun 2 '15 at 16:40








  • 2




    @Steve , the answer by Dawid says it moved to "sage". stackoverflow.com/a/23143997/80772
    – eel ghEEz
    Feb 5 '16 at 17:29


















up vote
124
down vote













For a more convenient installer, you may want to use
apt-cyg as your package manager. Its syntax similar to
apt-get, which is a plus. For this, follow the above
steps and then use Cygwin Bash for the following steps



wget https://raw.githubusercontent.com/transcode-open/apt-cyg/master/apt-cyg
chmod +x apt-cyg
mv apt-cyg /usr/local/bin


Now that apt-cyg is installed. Here are few examples of
installing some packages



apt-cyg install nano
apt-cyg install git
apt-cyg install ca-certificates





share|improve this answer



















  • 13




    Obviously use setup-x86_64.exe -q -P wget,tar,qawk,bzip2,subversion,vim for 64 bit windows.
    – Arun
    Dec 24 '13 at 16:46












  • thanks it works for me
    – Shahjahan Khan
    Jan 3 '14 at 10:02






  • 2




    Needed to add --no-check-certificate to the wget command. Otherwise, superb.
    – akauppi
    Mar 20 '14 at 11:31










  • And now it's a 404 (after a few redirects)
    – Shadow
    Jul 29 '14 at 23:27








  • 1




    wget is not installed by default with cygwin, meaning this needs to be bootstrapped with a manual and non-programmatic installation.
    – user284244
    Jan 30 '15 at 11:43


















up vote
118
down vote













Cygwin's setup accepts command-line arguments to install packages from the command-line.



e.g. setup-x86.exe -q -P packagename1,packagename2 to install packages without any GUI interaction ('unattended setup mode').



(Note that you need to use setup-x86.exe or setup-x86_64.exe as appropriate.)



See http://cygwin.com/packages/ for the package list.






share|improve this answer



















  • 5




    Nice! setup.exe is now called setup-x86.exe - or a variant depending on cpu bits. Also see here for the package list cygwin.com/packages
    – ErichBSchulz
    Jan 18 '14 at 6:43








  • 2




    Also, to specify multiple packages, separate them with commas. e.g. in DOS, type setup-x86_64 --packages="openssh,python"
    – Michael Scheper
    Mar 19 '14 at 23:00










  • There doesn't seem to be a way of setting up specific versions.
    – CMCDragonkai
    May 26 '16 at 17:02










  • @jturney, Is this stable?
    – Pacerier
    Mar 4 '17 at 0:13






  • 1




    @Pacerier, It's unclear what you are asking. This should be a feature of setup that it's safe to rely on.
    – jturney
    Mar 5 '17 at 14:22


















up vote
41
down vote













There exist some scripts, which can be used as simple package managers for Cygwin. But it’s important to know, that they always will be quite limited, because of...ehm...Windows.



Installing or removing packages is fine, each package manager for Cygwin can do that. But updating is a pain since Windows doesn’t allow you to overwrite an executable, which is currently running. So you can’t update e.g. Cygwin DLL or any package which contains the currently running executable from the Cygwin itself. There is also this note on the Cygwin Installation page:




"The basic reason for not having a more full-featured package manager is that
such a program would need full access to all of Cygwin’s POSIX functionality.
That is, however, difficult to provide in a Cygwin-free environment, such as
exists on first installation. Additionally, Windows does not easily allow
overwriting of in-use executables so installing a new version of the Cygwin
DLL while a package manager is using the DLL is problematic."




Cygwin’s setup uses Windows registry to overwrite executables which are in use
and this method requires a reboot of Windows. Therefore, it’s better to close
all Cygwin processes before updating packages
, so you don’t have to reboot
your computer to actually apply the changes. Installation of a new package
should be completely without any hassles. I don’t think any of package managers
except of Cygwin’s setup.exe implements any method to overwrite files in use,
so it would simply fail if it cannot overwrite them.





Some package managers for Cygwin:



apt-cyg



Update: the repository was disabled recently due to copyright issues (DMCA takedown). It looks like the owner of the repository issued the DMCA takedown on his own repository and created a new project called Sage (see bellow).



The best one for me. Simply because it’s one of the most recent. It doesn’t use Cygwin’s setup.exe, it rather re-implements, what setup.exe does. It works correctly for both platforms - x86 as well as x86_64. There are a lot of forks with more or less additional features. For example, the kou1okada fork is one of the improved versions, which is really great.



apt-cyg is just a shell script, there is no installation. Just download it (or clone the repository), make it executable and copy it somewhere to the PATH:



chmod +x apt-cyg # set executable bit
mv apt-cyg /usr/local/bin # move somewhere to PATH
# ...and use it:
apt-cyg install vim


There is also bunch of forks with different features.





sage



Another package manager implemented as a shell script. I didn't try it but it actually looks good.



It can search for packages in a repository, list packages in a category, check dependencies, list package files, and more. It has features which other package managers don't have.





cyg-apt



Fork of abandoned original cyg-apt with improvements and bugfixes. It has quite a lot of features and it's implemented in Python. Installation is made using make.





Chocolatey’s cyg-get



If you used Chocolatey to install Cygwin, you can install the package cyg-get, which is actually a simple wrapper around Cygwin’s setup.exe written in PowerShell.





Cygwin’s setup.exe



It also has a command line mode. Moreover, it allows you to upgrade all installed packages at once (as apt-get upgrade does on Debian based Linux).



Example use:



setup-x86_64.exe -q --packages=bash,vim


You can create an alias for easier use, for example:



alias cyg-get="/cygdrive/d/path/to/cygwin/setup-x86_64.exe -q -P"



Then you can, for example, install Vim package with:



cyg-get vim






share|improve this answer



















  • 2




    sage is a fork of apt-cyg by its most active contributors over the past year or two (Steven Penny). It appears that earlier this year he had some disagreement with the original apt-cyg author (Stephen Jungels) and issued the DMCA takedown when he forked the project. Since Jungels (aka Transcode) is verifiably the original author of the project, GitHub restored the original project soon after. Currently, both projects are available – though the original project hasn't had any new code updates since the split. It’s a messy situation, really.
    – Anthony Geoghegan
    Dec 9 '16 at 13:26










  • setup-x86_64.exe -q --packages=bash,vim. This approach has helped me in the past. Just run it from command line and it works smoothly.
    – TheWalkingData
    Jan 11 '17 at 21:13




















up vote
4
down vote













Old question, but still relevant. Here is what worked for me today (6/26/16).



From the bash shell:



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





share|improve this answer



















  • 1




    wget or curl is probably a better tool for this. (And personally, I'd install it in some other directory in my $PATH rather than in /bin.)
    – Keith Thompson
    Jul 22 '16 at 21:34


















up vote
3
down vote













I wanted a solution for this similar to apt-get --print-uris, but unfortunately apt-cyg doesn't do this. The following is a solution that allowed me to download only the packages I needed, with their dependencies, and copy them to the target for installation. Here is a bash script that parses the output of apt-cyg into a list of URIs:



#!/usr/bin/bash

package=$1
depends=$(
apt-cyg depends $package
| perl -ne 'while ($x = /> ([^>s]+)/g) { print "$1n"; }'
| sort
| uniq)
depends=$(echo -e "$dependsn$package")
for curpkg in $depends; do
if ! grep -q "^$curpkg " /etc/setup/installed.db; then
apt-cyg show $curpkg
| perl -ne '
if ($x = /install: ([^s]+)/) {
print "$1n";
}
if (/[prev]/) {
exit;
}'
fi
done


The above will print out the paths of the packages that need downloading, relative to the cygwin mirror root, omitting any packages that are already installed. To download them, I wrote the output to a file cygwin-packages-list and then used wget:



mirror=http://cygwin.mirror.constant.com/
uris=$(for line in $(cat cygwin-packages-list); do echo "$mirror$line"; done)
wget -x $uris


The installer can then be used to install from a local cache directory. Note that for this to work I needed to copy setup.ini from a previous cygwin package cache to the directory with the downloaded files (otherwise the installer doesn't know what's what).






share|improve this answer




























    up vote
    3
    down vote













    Dawid Ferenczy's answer is pretty complete but after I tried almost all of his options I've found that the Chocolatey’s cyg-get was the best (at least the only one that I could get to work).



    I was wanting to install wget, the steps was this:



    choco install cyg-get


    Then:



    cyg-get wget





    share|improve this answer






























      up vote
      1
      down vote













      Usually before installing a package one has to know its exact name:



      # define a string to search
      export to_srch=perl

      # get html output of search and pick only the cygwin package names
      wget -qO- "https://cygwin.com/cgi-bin2/package-grep.cgi?grep=$to_srch&arch=x86_64" |
      perl -l -ne 'm!(.*?)</a>s+-(.*?):(.*?)</li>!;print $2'

      # and install
      # install multiple packages at once, note the
      setup-x86_64.exe -q -s http://cygwin.mirror.constant.com -P "<<chosen_package_name>>"





      share|improve this answer






























        up vote
        1
        down vote













        First, download installer at: https://cygwin.com/setup-x86_64.exe, then:



        # move installer to cygwin folder
        mv C:/Users/<you>/Downloads/setup-x86_64.exe C:/cygwin64/

        # add alias to bash_aliases
        echo "alias install='C:/cygwin64/setup-x86_64.exe -q -P'" >> ~/.bash_aliases

        # add bash_aliases to bashrc if missing
        echo "source ~/.bash_aliases" >> ~/.bashrc


        e.g.



        install vim





        share|improve this answer





















          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f9260014%2fhow-do-i-install-cygwin-components-from-the-command-line%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          9 Answers
          9






          active

          oldest

          votes








          9 Answers
          9






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          88
          down vote



          accepted










          There is no tool specifically in the 'setup.exe' installer that offers the
          functionality of apt-get. There is, however, a command-line package installer
          for Cygwin that can be downloaded separately, but it is not entirely stable and
          relies on workarounds.



          apt-cyg: http://github.com/transcode-open/apt-cyg



          Check out the issues tab for the project to see the known problems.






          share|improve this answer























          • Thanks! Just what I wanted to know. I wonder why they aren't mature?
            – vy32
            Feb 20 '12 at 2:53










          • Good question. I'm not entirely sure of the answer, actually.
            – Zorobabel
            Feb 25 '12 at 15:45






          • 4




            @vy32: because you didn't help to make them mature? :) They can't write themselves. Someone have to work on them. And since their usability is quite limited (to overwrite files currently in use on Windows you have to close Cygwin first, so it's not possible to execute any package manager in closed Cygwin :), there isn't many people interested.
            – Dawid Ferenczy
            Apr 17 '14 at 20:01






          • 6




            From another answer: setup-x86.exe -q -P packagename1,packagename2. Not as fancy as apt-get or even apt-cyg but it does the trick in most cases. And you can also run this from cmd.exe (after closing Cygwin).
            – guaka
            Jun 2 '15 at 16:40








          • 2




            @Steve , the answer by Dawid says it moved to "sage". stackoverflow.com/a/23143997/80772
            – eel ghEEz
            Feb 5 '16 at 17:29















          up vote
          88
          down vote



          accepted










          There is no tool specifically in the 'setup.exe' installer that offers the
          functionality of apt-get. There is, however, a command-line package installer
          for Cygwin that can be downloaded separately, but it is not entirely stable and
          relies on workarounds.



          apt-cyg: http://github.com/transcode-open/apt-cyg



          Check out the issues tab for the project to see the known problems.






          share|improve this answer























          • Thanks! Just what I wanted to know. I wonder why they aren't mature?
            – vy32
            Feb 20 '12 at 2:53










          • Good question. I'm not entirely sure of the answer, actually.
            – Zorobabel
            Feb 25 '12 at 15:45






          • 4




            @vy32: because you didn't help to make them mature? :) They can't write themselves. Someone have to work on them. And since their usability is quite limited (to overwrite files currently in use on Windows you have to close Cygwin first, so it's not possible to execute any package manager in closed Cygwin :), there isn't many people interested.
            – Dawid Ferenczy
            Apr 17 '14 at 20:01






          • 6




            From another answer: setup-x86.exe -q -P packagename1,packagename2. Not as fancy as apt-get or even apt-cyg but it does the trick in most cases. And you can also run this from cmd.exe (after closing Cygwin).
            – guaka
            Jun 2 '15 at 16:40








          • 2




            @Steve , the answer by Dawid says it moved to "sage". stackoverflow.com/a/23143997/80772
            – eel ghEEz
            Feb 5 '16 at 17:29













          up vote
          88
          down vote



          accepted







          up vote
          88
          down vote



          accepted






          There is no tool specifically in the 'setup.exe' installer that offers the
          functionality of apt-get. There is, however, a command-line package installer
          for Cygwin that can be downloaded separately, but it is not entirely stable and
          relies on workarounds.



          apt-cyg: http://github.com/transcode-open/apt-cyg



          Check out the issues tab for the project to see the known problems.






          share|improve this answer














          There is no tool specifically in the 'setup.exe' installer that offers the
          functionality of apt-get. There is, however, a command-line package installer
          for Cygwin that can be downloaded separately, but it is not entirely stable and
          relies on workarounds.



          apt-cyg: http://github.com/transcode-open/apt-cyg



          Check out the issues tab for the project to see the known problems.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Feb 5 '17 at 16:24









          rany

          1348




          1348










          answered Feb 19 '12 at 6:22









          Zorobabel

          96378




          96378












          • Thanks! Just what I wanted to know. I wonder why they aren't mature?
            – vy32
            Feb 20 '12 at 2:53










          • Good question. I'm not entirely sure of the answer, actually.
            – Zorobabel
            Feb 25 '12 at 15:45






          • 4




            @vy32: because you didn't help to make them mature? :) They can't write themselves. Someone have to work on them. And since their usability is quite limited (to overwrite files currently in use on Windows you have to close Cygwin first, so it's not possible to execute any package manager in closed Cygwin :), there isn't many people interested.
            – Dawid Ferenczy
            Apr 17 '14 at 20:01






          • 6




            From another answer: setup-x86.exe -q -P packagename1,packagename2. Not as fancy as apt-get or even apt-cyg but it does the trick in most cases. And you can also run this from cmd.exe (after closing Cygwin).
            – guaka
            Jun 2 '15 at 16:40








          • 2




            @Steve , the answer by Dawid says it moved to "sage". stackoverflow.com/a/23143997/80772
            – eel ghEEz
            Feb 5 '16 at 17:29


















          • Thanks! Just what I wanted to know. I wonder why they aren't mature?
            – vy32
            Feb 20 '12 at 2:53










          • Good question. I'm not entirely sure of the answer, actually.
            – Zorobabel
            Feb 25 '12 at 15:45






          • 4




            @vy32: because you didn't help to make them mature? :) They can't write themselves. Someone have to work on them. And since their usability is quite limited (to overwrite files currently in use on Windows you have to close Cygwin first, so it's not possible to execute any package manager in closed Cygwin :), there isn't many people interested.
            – Dawid Ferenczy
            Apr 17 '14 at 20:01






          • 6




            From another answer: setup-x86.exe -q -P packagename1,packagename2. Not as fancy as apt-get or even apt-cyg but it does the trick in most cases. And you can also run this from cmd.exe (after closing Cygwin).
            – guaka
            Jun 2 '15 at 16:40








          • 2




            @Steve , the answer by Dawid says it moved to "sage". stackoverflow.com/a/23143997/80772
            – eel ghEEz
            Feb 5 '16 at 17:29
















          Thanks! Just what I wanted to know. I wonder why they aren't mature?
          – vy32
          Feb 20 '12 at 2:53




          Thanks! Just what I wanted to know. I wonder why they aren't mature?
          – vy32
          Feb 20 '12 at 2:53












          Good question. I'm not entirely sure of the answer, actually.
          – Zorobabel
          Feb 25 '12 at 15:45




          Good question. I'm not entirely sure of the answer, actually.
          – Zorobabel
          Feb 25 '12 at 15:45




          4




          4




          @vy32: because you didn't help to make them mature? :) They can't write themselves. Someone have to work on them. And since their usability is quite limited (to overwrite files currently in use on Windows you have to close Cygwin first, so it's not possible to execute any package manager in closed Cygwin :), there isn't many people interested.
          – Dawid Ferenczy
          Apr 17 '14 at 20:01




          @vy32: because you didn't help to make them mature? :) They can't write themselves. Someone have to work on them. And since their usability is quite limited (to overwrite files currently in use on Windows you have to close Cygwin first, so it's not possible to execute any package manager in closed Cygwin :), there isn't many people interested.
          – Dawid Ferenczy
          Apr 17 '14 at 20:01




          6




          6




          From another answer: setup-x86.exe -q -P packagename1,packagename2. Not as fancy as apt-get or even apt-cyg but it does the trick in most cases. And you can also run this from cmd.exe (after closing Cygwin).
          – guaka
          Jun 2 '15 at 16:40






          From another answer: setup-x86.exe -q -P packagename1,packagename2. Not as fancy as apt-get or even apt-cyg but it does the trick in most cases. And you can also run this from cmd.exe (after closing Cygwin).
          – guaka
          Jun 2 '15 at 16:40






          2




          2




          @Steve , the answer by Dawid says it moved to "sage". stackoverflow.com/a/23143997/80772
          – eel ghEEz
          Feb 5 '16 at 17:29




          @Steve , the answer by Dawid says it moved to "sage". stackoverflow.com/a/23143997/80772
          – eel ghEEz
          Feb 5 '16 at 17:29












          up vote
          124
          down vote













          For a more convenient installer, you may want to use
          apt-cyg as your package manager. Its syntax similar to
          apt-get, which is a plus. For this, follow the above
          steps and then use Cygwin Bash for the following steps



          wget https://raw.githubusercontent.com/transcode-open/apt-cyg/master/apt-cyg
          chmod +x apt-cyg
          mv apt-cyg /usr/local/bin


          Now that apt-cyg is installed. Here are few examples of
          installing some packages



          apt-cyg install nano
          apt-cyg install git
          apt-cyg install ca-certificates





          share|improve this answer



















          • 13




            Obviously use setup-x86_64.exe -q -P wget,tar,qawk,bzip2,subversion,vim for 64 bit windows.
            – Arun
            Dec 24 '13 at 16:46












          • thanks it works for me
            – Shahjahan Khan
            Jan 3 '14 at 10:02






          • 2




            Needed to add --no-check-certificate to the wget command. Otherwise, superb.
            – akauppi
            Mar 20 '14 at 11:31










          • And now it's a 404 (after a few redirects)
            – Shadow
            Jul 29 '14 at 23:27








          • 1




            wget is not installed by default with cygwin, meaning this needs to be bootstrapped with a manual and non-programmatic installation.
            – user284244
            Jan 30 '15 at 11:43















          up vote
          124
          down vote













          For a more convenient installer, you may want to use
          apt-cyg as your package manager. Its syntax similar to
          apt-get, which is a plus. For this, follow the above
          steps and then use Cygwin Bash for the following steps



          wget https://raw.githubusercontent.com/transcode-open/apt-cyg/master/apt-cyg
          chmod +x apt-cyg
          mv apt-cyg /usr/local/bin


          Now that apt-cyg is installed. Here are few examples of
          installing some packages



          apt-cyg install nano
          apt-cyg install git
          apt-cyg install ca-certificates





          share|improve this answer



















          • 13




            Obviously use setup-x86_64.exe -q -P wget,tar,qawk,bzip2,subversion,vim for 64 bit windows.
            – Arun
            Dec 24 '13 at 16:46












          • thanks it works for me
            – Shahjahan Khan
            Jan 3 '14 at 10:02






          • 2




            Needed to add --no-check-certificate to the wget command. Otherwise, superb.
            – akauppi
            Mar 20 '14 at 11:31










          • And now it's a 404 (after a few redirects)
            – Shadow
            Jul 29 '14 at 23:27








          • 1




            wget is not installed by default with cygwin, meaning this needs to be bootstrapped with a manual and non-programmatic installation.
            – user284244
            Jan 30 '15 at 11:43













          up vote
          124
          down vote










          up vote
          124
          down vote









          For a more convenient installer, you may want to use
          apt-cyg as your package manager. Its syntax similar to
          apt-get, which is a plus. For this, follow the above
          steps and then use Cygwin Bash for the following steps



          wget https://raw.githubusercontent.com/transcode-open/apt-cyg/master/apt-cyg
          chmod +x apt-cyg
          mv apt-cyg /usr/local/bin


          Now that apt-cyg is installed. Here are few examples of
          installing some packages



          apt-cyg install nano
          apt-cyg install git
          apt-cyg install ca-certificates





          share|improve this answer














          For a more convenient installer, you may want to use
          apt-cyg as your package manager. Its syntax similar to
          apt-get, which is a plus. For this, follow the above
          steps and then use Cygwin Bash for the following steps



          wget https://raw.githubusercontent.com/transcode-open/apt-cyg/master/apt-cyg
          chmod +x apt-cyg
          mv apt-cyg /usr/local/bin


          Now that apt-cyg is installed. Here are few examples of
          installing some packages



          apt-cyg install nano
          apt-cyg install git
          apt-cyg install ca-certificates






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Dec 30 '16 at 22:35









          Steven Penny

          1




          1










          answered Jun 1 '13 at 6:27









          sagunms

          4,80323237




          4,80323237








          • 13




            Obviously use setup-x86_64.exe -q -P wget,tar,qawk,bzip2,subversion,vim for 64 bit windows.
            – Arun
            Dec 24 '13 at 16:46












          • thanks it works for me
            – Shahjahan Khan
            Jan 3 '14 at 10:02






          • 2




            Needed to add --no-check-certificate to the wget command. Otherwise, superb.
            – akauppi
            Mar 20 '14 at 11:31










          • And now it's a 404 (after a few redirects)
            – Shadow
            Jul 29 '14 at 23:27








          • 1




            wget is not installed by default with cygwin, meaning this needs to be bootstrapped with a manual and non-programmatic installation.
            – user284244
            Jan 30 '15 at 11:43














          • 13




            Obviously use setup-x86_64.exe -q -P wget,tar,qawk,bzip2,subversion,vim for 64 bit windows.
            – Arun
            Dec 24 '13 at 16:46












          • thanks it works for me
            – Shahjahan Khan
            Jan 3 '14 at 10:02






          • 2




            Needed to add --no-check-certificate to the wget command. Otherwise, superb.
            – akauppi
            Mar 20 '14 at 11:31










          • And now it's a 404 (after a few redirects)
            – Shadow
            Jul 29 '14 at 23:27








          • 1




            wget is not installed by default with cygwin, meaning this needs to be bootstrapped with a manual and non-programmatic installation.
            – user284244
            Jan 30 '15 at 11:43








          13




          13




          Obviously use setup-x86_64.exe -q -P wget,tar,qawk,bzip2,subversion,vim for 64 bit windows.
          – Arun
          Dec 24 '13 at 16:46






          Obviously use setup-x86_64.exe -q -P wget,tar,qawk,bzip2,subversion,vim for 64 bit windows.
          – Arun
          Dec 24 '13 at 16:46














          thanks it works for me
          – Shahjahan Khan
          Jan 3 '14 at 10:02




          thanks it works for me
          – Shahjahan Khan
          Jan 3 '14 at 10:02




          2




          2




          Needed to add --no-check-certificate to the wget command. Otherwise, superb.
          – akauppi
          Mar 20 '14 at 11:31




          Needed to add --no-check-certificate to the wget command. Otherwise, superb.
          – akauppi
          Mar 20 '14 at 11:31












          And now it's a 404 (after a few redirects)
          – Shadow
          Jul 29 '14 at 23:27






          And now it's a 404 (after a few redirects)
          – Shadow
          Jul 29 '14 at 23:27






          1




          1




          wget is not installed by default with cygwin, meaning this needs to be bootstrapped with a manual and non-programmatic installation.
          – user284244
          Jan 30 '15 at 11:43




          wget is not installed by default with cygwin, meaning this needs to be bootstrapped with a manual and non-programmatic installation.
          – user284244
          Jan 30 '15 at 11:43










          up vote
          118
          down vote













          Cygwin's setup accepts command-line arguments to install packages from the command-line.



          e.g. setup-x86.exe -q -P packagename1,packagename2 to install packages without any GUI interaction ('unattended setup mode').



          (Note that you need to use setup-x86.exe or setup-x86_64.exe as appropriate.)



          See http://cygwin.com/packages/ for the package list.






          share|improve this answer



















          • 5




            Nice! setup.exe is now called setup-x86.exe - or a variant depending on cpu bits. Also see here for the package list cygwin.com/packages
            – ErichBSchulz
            Jan 18 '14 at 6:43








          • 2




            Also, to specify multiple packages, separate them with commas. e.g. in DOS, type setup-x86_64 --packages="openssh,python"
            – Michael Scheper
            Mar 19 '14 at 23:00










          • There doesn't seem to be a way of setting up specific versions.
            – CMCDragonkai
            May 26 '16 at 17:02










          • @jturney, Is this stable?
            – Pacerier
            Mar 4 '17 at 0:13






          • 1




            @Pacerier, It's unclear what you are asking. This should be a feature of setup that it's safe to rely on.
            – jturney
            Mar 5 '17 at 14:22















          up vote
          118
          down vote













          Cygwin's setup accepts command-line arguments to install packages from the command-line.



          e.g. setup-x86.exe -q -P packagename1,packagename2 to install packages without any GUI interaction ('unattended setup mode').



          (Note that you need to use setup-x86.exe or setup-x86_64.exe as appropriate.)



          See http://cygwin.com/packages/ for the package list.






          share|improve this answer



















          • 5




            Nice! setup.exe is now called setup-x86.exe - or a variant depending on cpu bits. Also see here for the package list cygwin.com/packages
            – ErichBSchulz
            Jan 18 '14 at 6:43








          • 2




            Also, to specify multiple packages, separate them with commas. e.g. in DOS, type setup-x86_64 --packages="openssh,python"
            – Michael Scheper
            Mar 19 '14 at 23:00










          • There doesn't seem to be a way of setting up specific versions.
            – CMCDragonkai
            May 26 '16 at 17:02










          • @jturney, Is this stable?
            – Pacerier
            Mar 4 '17 at 0:13






          • 1




            @Pacerier, It's unclear what you are asking. This should be a feature of setup that it's safe to rely on.
            – jturney
            Mar 5 '17 at 14:22













          up vote
          118
          down vote










          up vote
          118
          down vote









          Cygwin's setup accepts command-line arguments to install packages from the command-line.



          e.g. setup-x86.exe -q -P packagename1,packagename2 to install packages without any GUI interaction ('unattended setup mode').



          (Note that you need to use setup-x86.exe or setup-x86_64.exe as appropriate.)



          See http://cygwin.com/packages/ for the package list.






          share|improve this answer














          Cygwin's setup accepts command-line arguments to install packages from the command-line.



          e.g. setup-x86.exe -q -P packagename1,packagename2 to install packages without any GUI interaction ('unattended setup mode').



          (Note that you need to use setup-x86.exe or setup-x86_64.exe as appropriate.)



          See http://cygwin.com/packages/ for the package list.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Sep 6 '15 at 21:40

























          answered Feb 20 '13 at 18:08









          jturney

          1,97811121




          1,97811121








          • 5




            Nice! setup.exe is now called setup-x86.exe - or a variant depending on cpu bits. Also see here for the package list cygwin.com/packages
            – ErichBSchulz
            Jan 18 '14 at 6:43








          • 2




            Also, to specify multiple packages, separate them with commas. e.g. in DOS, type setup-x86_64 --packages="openssh,python"
            – Michael Scheper
            Mar 19 '14 at 23:00










          • There doesn't seem to be a way of setting up specific versions.
            – CMCDragonkai
            May 26 '16 at 17:02










          • @jturney, Is this stable?
            – Pacerier
            Mar 4 '17 at 0:13






          • 1




            @Pacerier, It's unclear what you are asking. This should be a feature of setup that it's safe to rely on.
            – jturney
            Mar 5 '17 at 14:22














          • 5




            Nice! setup.exe is now called setup-x86.exe - or a variant depending on cpu bits. Also see here for the package list cygwin.com/packages
            – ErichBSchulz
            Jan 18 '14 at 6:43








          • 2




            Also, to specify multiple packages, separate them with commas. e.g. in DOS, type setup-x86_64 --packages="openssh,python"
            – Michael Scheper
            Mar 19 '14 at 23:00










          • There doesn't seem to be a way of setting up specific versions.
            – CMCDragonkai
            May 26 '16 at 17:02










          • @jturney, Is this stable?
            – Pacerier
            Mar 4 '17 at 0:13






          • 1




            @Pacerier, It's unclear what you are asking. This should be a feature of setup that it's safe to rely on.
            – jturney
            Mar 5 '17 at 14:22








          5




          5




          Nice! setup.exe is now called setup-x86.exe - or a variant depending on cpu bits. Also see here for the package list cygwin.com/packages
          – ErichBSchulz
          Jan 18 '14 at 6:43






          Nice! setup.exe is now called setup-x86.exe - or a variant depending on cpu bits. Also see here for the package list cygwin.com/packages
          – ErichBSchulz
          Jan 18 '14 at 6:43






          2




          2




          Also, to specify multiple packages, separate them with commas. e.g. in DOS, type setup-x86_64 --packages="openssh,python"
          – Michael Scheper
          Mar 19 '14 at 23:00




          Also, to specify multiple packages, separate them with commas. e.g. in DOS, type setup-x86_64 --packages="openssh,python"
          – Michael Scheper
          Mar 19 '14 at 23:00












          There doesn't seem to be a way of setting up specific versions.
          – CMCDragonkai
          May 26 '16 at 17:02




          There doesn't seem to be a way of setting up specific versions.
          – CMCDragonkai
          May 26 '16 at 17:02












          @jturney, Is this stable?
          – Pacerier
          Mar 4 '17 at 0:13




          @jturney, Is this stable?
          – Pacerier
          Mar 4 '17 at 0:13




          1




          1




          @Pacerier, It's unclear what you are asking. This should be a feature of setup that it's safe to rely on.
          – jturney
          Mar 5 '17 at 14:22




          @Pacerier, It's unclear what you are asking. This should be a feature of setup that it's safe to rely on.
          – jturney
          Mar 5 '17 at 14:22










          up vote
          41
          down vote













          There exist some scripts, which can be used as simple package managers for Cygwin. But it’s important to know, that they always will be quite limited, because of...ehm...Windows.



          Installing or removing packages is fine, each package manager for Cygwin can do that. But updating is a pain since Windows doesn’t allow you to overwrite an executable, which is currently running. So you can’t update e.g. Cygwin DLL or any package which contains the currently running executable from the Cygwin itself. There is also this note on the Cygwin Installation page:




          "The basic reason for not having a more full-featured package manager is that
          such a program would need full access to all of Cygwin’s POSIX functionality.
          That is, however, difficult to provide in a Cygwin-free environment, such as
          exists on first installation. Additionally, Windows does not easily allow
          overwriting of in-use executables so installing a new version of the Cygwin
          DLL while a package manager is using the DLL is problematic."




          Cygwin’s setup uses Windows registry to overwrite executables which are in use
          and this method requires a reboot of Windows. Therefore, it’s better to close
          all Cygwin processes before updating packages
          , so you don’t have to reboot
          your computer to actually apply the changes. Installation of a new package
          should be completely without any hassles. I don’t think any of package managers
          except of Cygwin’s setup.exe implements any method to overwrite files in use,
          so it would simply fail if it cannot overwrite them.





          Some package managers for Cygwin:



          apt-cyg



          Update: the repository was disabled recently due to copyright issues (DMCA takedown). It looks like the owner of the repository issued the DMCA takedown on his own repository and created a new project called Sage (see bellow).



          The best one for me. Simply because it’s one of the most recent. It doesn’t use Cygwin’s setup.exe, it rather re-implements, what setup.exe does. It works correctly for both platforms - x86 as well as x86_64. There are a lot of forks with more or less additional features. For example, the kou1okada fork is one of the improved versions, which is really great.



          apt-cyg is just a shell script, there is no installation. Just download it (or clone the repository), make it executable and copy it somewhere to the PATH:



          chmod +x apt-cyg # set executable bit
          mv apt-cyg /usr/local/bin # move somewhere to PATH
          # ...and use it:
          apt-cyg install vim


          There is also bunch of forks with different features.





          sage



          Another package manager implemented as a shell script. I didn't try it but it actually looks good.



          It can search for packages in a repository, list packages in a category, check dependencies, list package files, and more. It has features which other package managers don't have.





          cyg-apt



          Fork of abandoned original cyg-apt with improvements and bugfixes. It has quite a lot of features and it's implemented in Python. Installation is made using make.





          Chocolatey’s cyg-get



          If you used Chocolatey to install Cygwin, you can install the package cyg-get, which is actually a simple wrapper around Cygwin’s setup.exe written in PowerShell.





          Cygwin’s setup.exe



          It also has a command line mode. Moreover, it allows you to upgrade all installed packages at once (as apt-get upgrade does on Debian based Linux).



          Example use:



          setup-x86_64.exe -q --packages=bash,vim


          You can create an alias for easier use, for example:



          alias cyg-get="/cygdrive/d/path/to/cygwin/setup-x86_64.exe -q -P"



          Then you can, for example, install Vim package with:



          cyg-get vim






          share|improve this answer



















          • 2




            sage is a fork of apt-cyg by its most active contributors over the past year or two (Steven Penny). It appears that earlier this year he had some disagreement with the original apt-cyg author (Stephen Jungels) and issued the DMCA takedown when he forked the project. Since Jungels (aka Transcode) is verifiably the original author of the project, GitHub restored the original project soon after. Currently, both projects are available – though the original project hasn't had any new code updates since the split. It’s a messy situation, really.
            – Anthony Geoghegan
            Dec 9 '16 at 13:26










          • setup-x86_64.exe -q --packages=bash,vim. This approach has helped me in the past. Just run it from command line and it works smoothly.
            – TheWalkingData
            Jan 11 '17 at 21:13

















          up vote
          41
          down vote













          There exist some scripts, which can be used as simple package managers for Cygwin. But it’s important to know, that they always will be quite limited, because of...ehm...Windows.



          Installing or removing packages is fine, each package manager for Cygwin can do that. But updating is a pain since Windows doesn’t allow you to overwrite an executable, which is currently running. So you can’t update e.g. Cygwin DLL or any package which contains the currently running executable from the Cygwin itself. There is also this note on the Cygwin Installation page:




          "The basic reason for not having a more full-featured package manager is that
          such a program would need full access to all of Cygwin’s POSIX functionality.
          That is, however, difficult to provide in a Cygwin-free environment, such as
          exists on first installation. Additionally, Windows does not easily allow
          overwriting of in-use executables so installing a new version of the Cygwin
          DLL while a package manager is using the DLL is problematic."




          Cygwin’s setup uses Windows registry to overwrite executables which are in use
          and this method requires a reboot of Windows. Therefore, it’s better to close
          all Cygwin processes before updating packages
          , so you don’t have to reboot
          your computer to actually apply the changes. Installation of a new package
          should be completely without any hassles. I don’t think any of package managers
          except of Cygwin’s setup.exe implements any method to overwrite files in use,
          so it would simply fail if it cannot overwrite them.





          Some package managers for Cygwin:



          apt-cyg



          Update: the repository was disabled recently due to copyright issues (DMCA takedown). It looks like the owner of the repository issued the DMCA takedown on his own repository and created a new project called Sage (see bellow).



          The best one for me. Simply because it’s one of the most recent. It doesn’t use Cygwin’s setup.exe, it rather re-implements, what setup.exe does. It works correctly for both platforms - x86 as well as x86_64. There are a lot of forks with more or less additional features. For example, the kou1okada fork is one of the improved versions, which is really great.



          apt-cyg is just a shell script, there is no installation. Just download it (or clone the repository), make it executable and copy it somewhere to the PATH:



          chmod +x apt-cyg # set executable bit
          mv apt-cyg /usr/local/bin # move somewhere to PATH
          # ...and use it:
          apt-cyg install vim


          There is also bunch of forks with different features.





          sage



          Another package manager implemented as a shell script. I didn't try it but it actually looks good.



          It can search for packages in a repository, list packages in a category, check dependencies, list package files, and more. It has features which other package managers don't have.





          cyg-apt



          Fork of abandoned original cyg-apt with improvements and bugfixes. It has quite a lot of features and it's implemented in Python. Installation is made using make.





          Chocolatey’s cyg-get



          If you used Chocolatey to install Cygwin, you can install the package cyg-get, which is actually a simple wrapper around Cygwin’s setup.exe written in PowerShell.





          Cygwin’s setup.exe



          It also has a command line mode. Moreover, it allows you to upgrade all installed packages at once (as apt-get upgrade does on Debian based Linux).



          Example use:



          setup-x86_64.exe -q --packages=bash,vim


          You can create an alias for easier use, for example:



          alias cyg-get="/cygdrive/d/path/to/cygwin/setup-x86_64.exe -q -P"



          Then you can, for example, install Vim package with:



          cyg-get vim






          share|improve this answer



















          • 2




            sage is a fork of apt-cyg by its most active contributors over the past year or two (Steven Penny). It appears that earlier this year he had some disagreement with the original apt-cyg author (Stephen Jungels) and issued the DMCA takedown when he forked the project. Since Jungels (aka Transcode) is verifiably the original author of the project, GitHub restored the original project soon after. Currently, both projects are available – though the original project hasn't had any new code updates since the split. It’s a messy situation, really.
            – Anthony Geoghegan
            Dec 9 '16 at 13:26










          • setup-x86_64.exe -q --packages=bash,vim. This approach has helped me in the past. Just run it from command line and it works smoothly.
            – TheWalkingData
            Jan 11 '17 at 21:13















          up vote
          41
          down vote










          up vote
          41
          down vote









          There exist some scripts, which can be used as simple package managers for Cygwin. But it’s important to know, that they always will be quite limited, because of...ehm...Windows.



          Installing or removing packages is fine, each package manager for Cygwin can do that. But updating is a pain since Windows doesn’t allow you to overwrite an executable, which is currently running. So you can’t update e.g. Cygwin DLL or any package which contains the currently running executable from the Cygwin itself. There is also this note on the Cygwin Installation page:




          "The basic reason for not having a more full-featured package manager is that
          such a program would need full access to all of Cygwin’s POSIX functionality.
          That is, however, difficult to provide in a Cygwin-free environment, such as
          exists on first installation. Additionally, Windows does not easily allow
          overwriting of in-use executables so installing a new version of the Cygwin
          DLL while a package manager is using the DLL is problematic."




          Cygwin’s setup uses Windows registry to overwrite executables which are in use
          and this method requires a reboot of Windows. Therefore, it’s better to close
          all Cygwin processes before updating packages
          , so you don’t have to reboot
          your computer to actually apply the changes. Installation of a new package
          should be completely without any hassles. I don’t think any of package managers
          except of Cygwin’s setup.exe implements any method to overwrite files in use,
          so it would simply fail if it cannot overwrite them.





          Some package managers for Cygwin:



          apt-cyg



          Update: the repository was disabled recently due to copyright issues (DMCA takedown). It looks like the owner of the repository issued the DMCA takedown on his own repository and created a new project called Sage (see bellow).



          The best one for me. Simply because it’s one of the most recent. It doesn’t use Cygwin’s setup.exe, it rather re-implements, what setup.exe does. It works correctly for both platforms - x86 as well as x86_64. There are a lot of forks with more or less additional features. For example, the kou1okada fork is one of the improved versions, which is really great.



          apt-cyg is just a shell script, there is no installation. Just download it (or clone the repository), make it executable and copy it somewhere to the PATH:



          chmod +x apt-cyg # set executable bit
          mv apt-cyg /usr/local/bin # move somewhere to PATH
          # ...and use it:
          apt-cyg install vim


          There is also bunch of forks with different features.





          sage



          Another package manager implemented as a shell script. I didn't try it but it actually looks good.



          It can search for packages in a repository, list packages in a category, check dependencies, list package files, and more. It has features which other package managers don't have.





          cyg-apt



          Fork of abandoned original cyg-apt with improvements and bugfixes. It has quite a lot of features and it's implemented in Python. Installation is made using make.





          Chocolatey’s cyg-get



          If you used Chocolatey to install Cygwin, you can install the package cyg-get, which is actually a simple wrapper around Cygwin’s setup.exe written in PowerShell.





          Cygwin’s setup.exe



          It also has a command line mode. Moreover, it allows you to upgrade all installed packages at once (as apt-get upgrade does on Debian based Linux).



          Example use:



          setup-x86_64.exe -q --packages=bash,vim


          You can create an alias for easier use, for example:



          alias cyg-get="/cygdrive/d/path/to/cygwin/setup-x86_64.exe -q -P"



          Then you can, for example, install Vim package with:



          cyg-get vim






          share|improve this answer














          There exist some scripts, which can be used as simple package managers for Cygwin. But it’s important to know, that they always will be quite limited, because of...ehm...Windows.



          Installing or removing packages is fine, each package manager for Cygwin can do that. But updating is a pain since Windows doesn’t allow you to overwrite an executable, which is currently running. So you can’t update e.g. Cygwin DLL or any package which contains the currently running executable from the Cygwin itself. There is also this note on the Cygwin Installation page:




          "The basic reason for not having a more full-featured package manager is that
          such a program would need full access to all of Cygwin’s POSIX functionality.
          That is, however, difficult to provide in a Cygwin-free environment, such as
          exists on first installation. Additionally, Windows does not easily allow
          overwriting of in-use executables so installing a new version of the Cygwin
          DLL while a package manager is using the DLL is problematic."




          Cygwin’s setup uses Windows registry to overwrite executables which are in use
          and this method requires a reboot of Windows. Therefore, it’s better to close
          all Cygwin processes before updating packages
          , so you don’t have to reboot
          your computer to actually apply the changes. Installation of a new package
          should be completely without any hassles. I don’t think any of package managers
          except of Cygwin’s setup.exe implements any method to overwrite files in use,
          so it would simply fail if it cannot overwrite them.





          Some package managers for Cygwin:



          apt-cyg



          Update: the repository was disabled recently due to copyright issues (DMCA takedown). It looks like the owner of the repository issued the DMCA takedown on his own repository and created a new project called Sage (see bellow).



          The best one for me. Simply because it’s one of the most recent. It doesn’t use Cygwin’s setup.exe, it rather re-implements, what setup.exe does. It works correctly for both platforms - x86 as well as x86_64. There are a lot of forks with more or less additional features. For example, the kou1okada fork is one of the improved versions, which is really great.



          apt-cyg is just a shell script, there is no installation. Just download it (or clone the repository), make it executable and copy it somewhere to the PATH:



          chmod +x apt-cyg # set executable bit
          mv apt-cyg /usr/local/bin # move somewhere to PATH
          # ...and use it:
          apt-cyg install vim


          There is also bunch of forks with different features.





          sage



          Another package manager implemented as a shell script. I didn't try it but it actually looks good.



          It can search for packages in a repository, list packages in a category, check dependencies, list package files, and more. It has features which other package managers don't have.





          cyg-apt



          Fork of abandoned original cyg-apt with improvements and bugfixes. It has quite a lot of features and it's implemented in Python. Installation is made using make.





          Chocolatey’s cyg-get



          If you used Chocolatey to install Cygwin, you can install the package cyg-get, which is actually a simple wrapper around Cygwin’s setup.exe written in PowerShell.





          Cygwin’s setup.exe



          It also has a command line mode. Moreover, it allows you to upgrade all installed packages at once (as apt-get upgrade does on Debian based Linux).



          Example use:



          setup-x86_64.exe -q --packages=bash,vim


          You can create an alias for easier use, for example:



          alias cyg-get="/cygdrive/d/path/to/cygwin/setup-x86_64.exe -q -P"



          Then you can, for example, install Vim package with:



          cyg-get vim







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Aug 22 at 12:39









          ostergaard

          1,42211631




          1,42211631










          answered Apr 17 '14 at 21:45









          Dawid Ferenczy

          9,91674451




          9,91674451








          • 2




            sage is a fork of apt-cyg by its most active contributors over the past year or two (Steven Penny). It appears that earlier this year he had some disagreement with the original apt-cyg author (Stephen Jungels) and issued the DMCA takedown when he forked the project. Since Jungels (aka Transcode) is verifiably the original author of the project, GitHub restored the original project soon after. Currently, both projects are available – though the original project hasn't had any new code updates since the split. It’s a messy situation, really.
            – Anthony Geoghegan
            Dec 9 '16 at 13:26










          • setup-x86_64.exe -q --packages=bash,vim. This approach has helped me in the past. Just run it from command line and it works smoothly.
            – TheWalkingData
            Jan 11 '17 at 21:13
















          • 2




            sage is a fork of apt-cyg by its most active contributors over the past year or two (Steven Penny). It appears that earlier this year he had some disagreement with the original apt-cyg author (Stephen Jungels) and issued the DMCA takedown when he forked the project. Since Jungels (aka Transcode) is verifiably the original author of the project, GitHub restored the original project soon after. Currently, both projects are available – though the original project hasn't had any new code updates since the split. It’s a messy situation, really.
            – Anthony Geoghegan
            Dec 9 '16 at 13:26










          • setup-x86_64.exe -q --packages=bash,vim. This approach has helped me in the past. Just run it from command line and it works smoothly.
            – TheWalkingData
            Jan 11 '17 at 21:13










          2




          2




          sage is a fork of apt-cyg by its most active contributors over the past year or two (Steven Penny). It appears that earlier this year he had some disagreement with the original apt-cyg author (Stephen Jungels) and issued the DMCA takedown when he forked the project. Since Jungels (aka Transcode) is verifiably the original author of the project, GitHub restored the original project soon after. Currently, both projects are available – though the original project hasn't had any new code updates since the split. It’s a messy situation, really.
          – Anthony Geoghegan
          Dec 9 '16 at 13:26




          sage is a fork of apt-cyg by its most active contributors over the past year or two (Steven Penny). It appears that earlier this year he had some disagreement with the original apt-cyg author (Stephen Jungels) and issued the DMCA takedown when he forked the project. Since Jungels (aka Transcode) is verifiably the original author of the project, GitHub restored the original project soon after. Currently, both projects are available – though the original project hasn't had any new code updates since the split. It’s a messy situation, really.
          – Anthony Geoghegan
          Dec 9 '16 at 13:26












          setup-x86_64.exe -q --packages=bash,vim. This approach has helped me in the past. Just run it from command line and it works smoothly.
          – TheWalkingData
          Jan 11 '17 at 21:13






          setup-x86_64.exe -q --packages=bash,vim. This approach has helped me in the past. Just run it from command line and it works smoothly.
          – TheWalkingData
          Jan 11 '17 at 21:13












          up vote
          4
          down vote













          Old question, but still relevant. Here is what worked for me today (6/26/16).



          From the bash shell:



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





          share|improve this answer



















          • 1




            wget or curl is probably a better tool for this. (And personally, I'd install it in some other directory in my $PATH rather than in /bin.)
            – Keith Thompson
            Jul 22 '16 at 21:34















          up vote
          4
          down vote













          Old question, but still relevant. Here is what worked for me today (6/26/16).



          From the bash shell:



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





          share|improve this answer



















          • 1




            wget or curl is probably a better tool for this. (And personally, I'd install it in some other directory in my $PATH rather than in /bin.)
            – Keith Thompson
            Jul 22 '16 at 21:34













          up vote
          4
          down vote










          up vote
          4
          down vote









          Old question, but still relevant. Here is what worked for me today (6/26/16).



          From the bash shell:



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





          share|improve this answer














          Old question, but still relevant. Here is what worked for me today (6/26/16).



          From the bash shell:



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






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jul 22 '16 at 21:32









          Keith Thompson

          189k25273465




          189k25273465










          answered Jun 26 '16 at 23:24









          Steve Isenberg

          164210




          164210








          • 1




            wget or curl is probably a better tool for this. (And personally, I'd install it in some other directory in my $PATH rather than in /bin.)
            – Keith Thompson
            Jul 22 '16 at 21:34














          • 1




            wget or curl is probably a better tool for this. (And personally, I'd install it in some other directory in my $PATH rather than in /bin.)
            – Keith Thompson
            Jul 22 '16 at 21:34








          1




          1




          wget or curl is probably a better tool for this. (And personally, I'd install it in some other directory in my $PATH rather than in /bin.)
          – Keith Thompson
          Jul 22 '16 at 21:34




          wget or curl is probably a better tool for this. (And personally, I'd install it in some other directory in my $PATH rather than in /bin.)
          – Keith Thompson
          Jul 22 '16 at 21:34










          up vote
          3
          down vote













          I wanted a solution for this similar to apt-get --print-uris, but unfortunately apt-cyg doesn't do this. The following is a solution that allowed me to download only the packages I needed, with their dependencies, and copy them to the target for installation. Here is a bash script that parses the output of apt-cyg into a list of URIs:



          #!/usr/bin/bash

          package=$1
          depends=$(
          apt-cyg depends $package
          | perl -ne 'while ($x = /> ([^>s]+)/g) { print "$1n"; }'
          | sort
          | uniq)
          depends=$(echo -e "$dependsn$package")
          for curpkg in $depends; do
          if ! grep -q "^$curpkg " /etc/setup/installed.db; then
          apt-cyg show $curpkg
          | perl -ne '
          if ($x = /install: ([^s]+)/) {
          print "$1n";
          }
          if (/[prev]/) {
          exit;
          }'
          fi
          done


          The above will print out the paths of the packages that need downloading, relative to the cygwin mirror root, omitting any packages that are already installed. To download them, I wrote the output to a file cygwin-packages-list and then used wget:



          mirror=http://cygwin.mirror.constant.com/
          uris=$(for line in $(cat cygwin-packages-list); do echo "$mirror$line"; done)
          wget -x $uris


          The installer can then be used to install from a local cache directory. Note that for this to work I needed to copy setup.ini from a previous cygwin package cache to the directory with the downloaded files (otherwise the installer doesn't know what's what).






          share|improve this answer

























            up vote
            3
            down vote













            I wanted a solution for this similar to apt-get --print-uris, but unfortunately apt-cyg doesn't do this. The following is a solution that allowed me to download only the packages I needed, with their dependencies, and copy them to the target for installation. Here is a bash script that parses the output of apt-cyg into a list of URIs:



            #!/usr/bin/bash

            package=$1
            depends=$(
            apt-cyg depends $package
            | perl -ne 'while ($x = /> ([^>s]+)/g) { print "$1n"; }'
            | sort
            | uniq)
            depends=$(echo -e "$dependsn$package")
            for curpkg in $depends; do
            if ! grep -q "^$curpkg " /etc/setup/installed.db; then
            apt-cyg show $curpkg
            | perl -ne '
            if ($x = /install: ([^s]+)/) {
            print "$1n";
            }
            if (/[prev]/) {
            exit;
            }'
            fi
            done


            The above will print out the paths of the packages that need downloading, relative to the cygwin mirror root, omitting any packages that are already installed. To download them, I wrote the output to a file cygwin-packages-list and then used wget:



            mirror=http://cygwin.mirror.constant.com/
            uris=$(for line in $(cat cygwin-packages-list); do echo "$mirror$line"; done)
            wget -x $uris


            The installer can then be used to install from a local cache directory. Note that for this to work I needed to copy setup.ini from a previous cygwin package cache to the directory with the downloaded files (otherwise the installer doesn't know what's what).






            share|improve this answer























              up vote
              3
              down vote










              up vote
              3
              down vote









              I wanted a solution for this similar to apt-get --print-uris, but unfortunately apt-cyg doesn't do this. The following is a solution that allowed me to download only the packages I needed, with their dependencies, and copy them to the target for installation. Here is a bash script that parses the output of apt-cyg into a list of URIs:



              #!/usr/bin/bash

              package=$1
              depends=$(
              apt-cyg depends $package
              | perl -ne 'while ($x = /> ([^>s]+)/g) { print "$1n"; }'
              | sort
              | uniq)
              depends=$(echo -e "$dependsn$package")
              for curpkg in $depends; do
              if ! grep -q "^$curpkg " /etc/setup/installed.db; then
              apt-cyg show $curpkg
              | perl -ne '
              if ($x = /install: ([^s]+)/) {
              print "$1n";
              }
              if (/[prev]/) {
              exit;
              }'
              fi
              done


              The above will print out the paths of the packages that need downloading, relative to the cygwin mirror root, omitting any packages that are already installed. To download them, I wrote the output to a file cygwin-packages-list and then used wget:



              mirror=http://cygwin.mirror.constant.com/
              uris=$(for line in $(cat cygwin-packages-list); do echo "$mirror$line"; done)
              wget -x $uris


              The installer can then be used to install from a local cache directory. Note that for this to work I needed to copy setup.ini from a previous cygwin package cache to the directory with the downloaded files (otherwise the installer doesn't know what's what).






              share|improve this answer












              I wanted a solution for this similar to apt-get --print-uris, but unfortunately apt-cyg doesn't do this. The following is a solution that allowed me to download only the packages I needed, with their dependencies, and copy them to the target for installation. Here is a bash script that parses the output of apt-cyg into a list of URIs:



              #!/usr/bin/bash

              package=$1
              depends=$(
              apt-cyg depends $package
              | perl -ne 'while ($x = /> ([^>s]+)/g) { print "$1n"; }'
              | sort
              | uniq)
              depends=$(echo -e "$dependsn$package")
              for curpkg in $depends; do
              if ! grep -q "^$curpkg " /etc/setup/installed.db; then
              apt-cyg show $curpkg
              | perl -ne '
              if ($x = /install: ([^s]+)/) {
              print "$1n";
              }
              if (/[prev]/) {
              exit;
              }'
              fi
              done


              The above will print out the paths of the packages that need downloading, relative to the cygwin mirror root, omitting any packages that are already installed. To download them, I wrote the output to a file cygwin-packages-list and then used wget:



              mirror=http://cygwin.mirror.constant.com/
              uris=$(for line in $(cat cygwin-packages-list); do echo "$mirror$line"; done)
              wget -x $uris


              The installer can then be used to install from a local cache directory. Note that for this to work I needed to copy setup.ini from a previous cygwin package cache to the directory with the downloaded files (otherwise the installer doesn't know what's what).







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Nov 23 '15 at 12:52









              wakjah

              4,11911121




              4,11911121






















                  up vote
                  3
                  down vote













                  Dawid Ferenczy's answer is pretty complete but after I tried almost all of his options I've found that the Chocolatey’s cyg-get was the best (at least the only one that I could get to work).



                  I was wanting to install wget, the steps was this:



                  choco install cyg-get


                  Then:



                  cyg-get wget





                  share|improve this answer



























                    up vote
                    3
                    down vote













                    Dawid Ferenczy's answer is pretty complete but after I tried almost all of his options I've found that the Chocolatey’s cyg-get was the best (at least the only one that I could get to work).



                    I was wanting to install wget, the steps was this:



                    choco install cyg-get


                    Then:



                    cyg-get wget





                    share|improve this answer

























                      up vote
                      3
                      down vote










                      up vote
                      3
                      down vote









                      Dawid Ferenczy's answer is pretty complete but after I tried almost all of his options I've found that the Chocolatey’s cyg-get was the best (at least the only one that I could get to work).



                      I was wanting to install wget, the steps was this:



                      choco install cyg-get


                      Then:



                      cyg-get wget





                      share|improve this answer














                      Dawid Ferenczy's answer is pretty complete but after I tried almost all of his options I've found that the Chocolatey’s cyg-get was the best (at least the only one that I could get to work).



                      I was wanting to install wget, the steps was this:



                      choco install cyg-get


                      Then:



                      cyg-get wget






                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited Aug 22 at 10:31









                      ostergaard

                      1,42211631




                      1,42211631










                      answered Jul 22 '16 at 21:29









                      fabriciorissetto

                      5,54423443




                      5,54423443






















                          up vote
                          1
                          down vote













                          Usually before installing a package one has to know its exact name:



                          # define a string to search
                          export to_srch=perl

                          # get html output of search and pick only the cygwin package names
                          wget -qO- "https://cygwin.com/cgi-bin2/package-grep.cgi?grep=$to_srch&arch=x86_64" |
                          perl -l -ne 'm!(.*?)</a>s+-(.*?):(.*?)</li>!;print $2'

                          # and install
                          # install multiple packages at once, note the
                          setup-x86_64.exe -q -s http://cygwin.mirror.constant.com -P "<<chosen_package_name>>"





                          share|improve this answer



























                            up vote
                            1
                            down vote













                            Usually before installing a package one has to know its exact name:



                            # define a string to search
                            export to_srch=perl

                            # get html output of search and pick only the cygwin package names
                            wget -qO- "https://cygwin.com/cgi-bin2/package-grep.cgi?grep=$to_srch&arch=x86_64" |
                            perl -l -ne 'm!(.*?)</a>s+-(.*?):(.*?)</li>!;print $2'

                            # and install
                            # install multiple packages at once, note the
                            setup-x86_64.exe -q -s http://cygwin.mirror.constant.com -P "<<chosen_package_name>>"





                            share|improve this answer

























                              up vote
                              1
                              down vote










                              up vote
                              1
                              down vote









                              Usually before installing a package one has to know its exact name:



                              # define a string to search
                              export to_srch=perl

                              # get html output of search and pick only the cygwin package names
                              wget -qO- "https://cygwin.com/cgi-bin2/package-grep.cgi?grep=$to_srch&arch=x86_64" |
                              perl -l -ne 'm!(.*?)</a>s+-(.*?):(.*?)</li>!;print $2'

                              # and install
                              # install multiple packages at once, note the
                              setup-x86_64.exe -q -s http://cygwin.mirror.constant.com -P "<<chosen_package_name>>"





                              share|improve this answer














                              Usually before installing a package one has to know its exact name:



                              # define a string to search
                              export to_srch=perl

                              # get html output of search and pick only the cygwin package names
                              wget -qO- "https://cygwin.com/cgi-bin2/package-grep.cgi?grep=$to_srch&arch=x86_64" |
                              perl -l -ne 'm!(.*?)</a>s+-(.*?):(.*?)</li>!;print $2'

                              # and install
                              # install multiple packages at once, note the
                              setup-x86_64.exe -q -s http://cygwin.mirror.constant.com -P "<<chosen_package_name>>"






                              share|improve this answer














                              share|improve this answer



                              share|improve this answer








                              edited May 18 '16 at 5:49

























                              answered Apr 7 '15 at 13:16









                              Yordan Georgiev

                              2,48812839




                              2,48812839






















                                  up vote
                                  1
                                  down vote













                                  First, download installer at: https://cygwin.com/setup-x86_64.exe, then:



                                  # move installer to cygwin folder
                                  mv C:/Users/<you>/Downloads/setup-x86_64.exe C:/cygwin64/

                                  # add alias to bash_aliases
                                  echo "alias install='C:/cygwin64/setup-x86_64.exe -q -P'" >> ~/.bash_aliases

                                  # add bash_aliases to bashrc if missing
                                  echo "source ~/.bash_aliases" >> ~/.bashrc


                                  e.g.



                                  install vim





                                  share|improve this answer

























                                    up vote
                                    1
                                    down vote













                                    First, download installer at: https://cygwin.com/setup-x86_64.exe, then:



                                    # move installer to cygwin folder
                                    mv C:/Users/<you>/Downloads/setup-x86_64.exe C:/cygwin64/

                                    # add alias to bash_aliases
                                    echo "alias install='C:/cygwin64/setup-x86_64.exe -q -P'" >> ~/.bash_aliases

                                    # add bash_aliases to bashrc if missing
                                    echo "source ~/.bash_aliases" >> ~/.bashrc


                                    e.g.



                                    install vim





                                    share|improve this answer























                                      up vote
                                      1
                                      down vote










                                      up vote
                                      1
                                      down vote









                                      First, download installer at: https://cygwin.com/setup-x86_64.exe, then:



                                      # move installer to cygwin folder
                                      mv C:/Users/<you>/Downloads/setup-x86_64.exe C:/cygwin64/

                                      # add alias to bash_aliases
                                      echo "alias install='C:/cygwin64/setup-x86_64.exe -q -P'" >> ~/.bash_aliases

                                      # add bash_aliases to bashrc if missing
                                      echo "source ~/.bash_aliases" >> ~/.bashrc


                                      e.g.



                                      install vim





                                      share|improve this answer












                                      First, download installer at: https://cygwin.com/setup-x86_64.exe, then:



                                      # move installer to cygwin folder
                                      mv C:/Users/<you>/Downloads/setup-x86_64.exe C:/cygwin64/

                                      # add alias to bash_aliases
                                      echo "alias install='C:/cygwin64/setup-x86_64.exe -q -P'" >> ~/.bash_aliases

                                      # add bash_aliases to bashrc if missing
                                      echo "source ~/.bash_aliases" >> ~/.bashrc


                                      e.g.



                                      install vim






                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Nov 11 at 13:49









                                      Jason

                                      50659




                                      50659






























                                          draft saved

                                          draft discarded




















































                                          Thanks for contributing an answer to Stack Overflow!


                                          • Please be sure to answer the question. Provide details and share your research!

                                          But avoid



                                          • Asking for help, clarification, or responding to other answers.

                                          • Making statements based on opinion; back them up with references or personal experience.


                                          To learn more, see our tips on writing great answers.





                                          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                          Please pay close attention to the following guidance:


                                          • Please be sure to answer the question. Provide details and share your research!

                                          But avoid



                                          • Asking for help, clarification, or responding to other answers.

                                          • Making statements based on opinion; back them up with references or personal experience.


                                          To learn more, see our tips on writing great answers.




                                          draft saved


                                          draft discarded














                                          StackExchange.ready(
                                          function () {
                                          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f9260014%2fhow-do-i-install-cygwin-components-from-the-command-line%23new-answer', 'question_page');
                                          }
                                          );

                                          Post as a guest















                                          Required, but never shown





















































                                          Required, but never shown














                                          Required, but never shown












                                          Required, but never shown







                                          Required, but never shown

































                                          Required, but never shown














                                          Required, but never shown












                                          Required, but never shown







                                          Required, but never shown







                                          Popular posts from this blog

                                          Bressuire

                                          Vorschmack

                                          Quarantine