121

I'm a blind computer user that uses Cygwin.

The installation program isn't very accessible: upgrading, installing, and removing specific packages is quite hard to do since you have to use simulated mouse keystrokes to click and scroll.

Is there a way to either manually install/upgrade packages or install/upgrade them through the command-line?

Zombo
  • 1
Jared
  • 2,265

10 Answers10

123

Install apt-cyg:

lynx -source https://raw.githubusercontent.com/transcode-open/apt-cyg/master/apt-cyg > apt-cyg
install apt-cyg /bin

After that you'll be able to install say the package "lynx" including dependencies by running:

apt-cyg install lynx
gliptak
  • 239
knorv
  • 3,512
25

Old question, but for others that google and got here: Official setup has command line arguments which allowed me to prepare simple *.bat script - just put following line in e.g. "install-pkg.bat" and put that file into your root directory (e.g. C:\cygwin):

setup-x86.exe --no-desktop --no-shortcuts --no-startmenu --quiet-mode --root "%cd%" --packages %*

You need to download and put http://www.cygwin.com/setup-x86.exe (32bit) or http://www.cygwin.com/setup-x86_64.exe (64bit) into the same directory. Now all you have to do to install package is:

install-pkg packagename

Positive: official setup, should always work, for any package. Negative: current (june/2015) official setup requires administrator rights even though it actually does not need one (e.g. root directory outside system folders).

peenut
  • 389
  • 1
    nice answer, as it's a tool that you already have in any Cygwin installation; however, it seems that you can't keep it from updating all the already installed packages? it's quite annoying if you just want to install one new package; in other words, there is no command-line equivalent to the "Keep" option of the graphical setup.exe – golimar Mar 28 '12 at 22:26
  • 1
    note setup.exe is now called setup-x86.exe - or a variant depending on cpu bits. – ErichBSchulz Jan 18 '14 at 06:47
  • Link is broken, now is : https://cygwin.com/faq/faq.html#faq.setup.cli Can you edit that in your answer ? Thanks – Benj Jun 10 '15 at 08:59
  • You don't need administrator rights if you use the --no-admin switch (same as -B). – cdlvcdlv Jul 23 '19 at 08:13
  • I wonder what %* means 2) install-pkg seems to have been moved. Though given this answer is 13 years old I'm surprised how gracefully it's aged.
  • – Sridhar Sarnobat Feb 28 '24 at 18:06