Как установить cygwin на windows 10

Get that Linux feeling - on Windows

Get that Linux feeling — on Windows

Installing and Updating Cygwin Packages

Installing and Updating Cygwin for 64-bit versions of Windows

Run setup-x86_64.exe any time you want to
update or install a Cygwin package for 64-bit windows.

The signature
for setup-x86_64.exe can be used to verify the
validity of this binary using the public
key here.

General installation notes

When installing packages for the first time, the setup program
does not install every package. Only the minimal base packages
from the Cygwin distribution are installed by default, which takes up about 100 MB.

Clicking on categories and packages in the setup program package installation
screen allows you to select what is installed or updated.

Individual packages like bash, gcc, less, etc.
are released independently of the Cygwin DLL, so the Cygwin DLL version is not
useful as a general Cygwin release number. The setup program
tracks the versions of all installed components and provides the mechanism
for installing or updating everything available from this site for
Cygwin.

Once you’ve installed your desired subset of the Cygwin distribution,
the setup program will remember what you selected, so re-running it
will update your system with any new package releases.

The setup program will check by default if it runs with administrative
privileges and, if not, will try to elevate the process. If you want to avoid
this behaviour and install under an unprivileged account just for your own
usage, run setup with the --no-admin option.

Q: How do I add a package to my existing Cygwin installation?

A: Run the setup program and select the package you want to add.

Tip: if you don’t want to also upgrade existing packages, select ‘Keep’ at the
top-right of the package chooser page.

Q: Is there a command-line installer?

A: Yes and no. The setup program understands
command-line
arguments which allow you to control its behavior and choose
individual packages to install. While this provides some functionality
similar to such tools as apt-get or yum it is not as
full-featured as those package managers.

Q: Why not use apt, yum, my
favourite package manager, etc.?

A: The basic reason for not using 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.

Q: How do I install everything?

A: You do not want to do this! This will install an enormous number of packages
that you will never use, including debuginfo and source for every package.

If you really must do this, clicking on the «Default» label next to the
«All» category to change it to «Install» will mark every Cygwin package for
installation. Be advised that this will download and install tens of gigabytes
of files to your computer.

Q: How do I verify the signature of setup?

A: e.g.

$ gpg --recv-key 1A698DE9E2E56300
gpg: requesting key 1A698DE9E2E56300 from hkp server keys.gnupg.net
gpg: key 1A698DE9E2E56300: "Cygwin <cygwin@cygwin.com>" imported
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0  valid:   8  signed:   2  trust: 0-, 0q, 0n, 0m, 0f, 8u
gpg: depth: 1  valid:   2  signed:   0  trust: 2-, 0q, 0n, 0m, 0f, 0u
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)

$ gpg --keyid-format=long --with-fingerprint --verify setup-x86_64.exe.sig setup-x86_64.exe
[...]
gpg: Signature made 12 Mar 2020 16:26:58 GMT
gpg:                using RSA key 1A698DE9E2E56300
gpg: Good signature from "Cygwin <cygwin@cygwin.com>"
Primary key fingerprint: 5640 5CF6 FCC8 1574 682A  5D56 1A69 8DE9 E2E5 6300

Q: What’s the hash of setup?

A: See here

Q: How can I do an offline install?

A1: Install without access to the internet, using a local package
repository

  • Create a local copy of the package repository e.g. by
    using rsync on one
    of the mirrors.
  • Move that copy to an accessible location, or copy it to removable media.
  • Run setup, and enter the URL, path or UNC path of that repository when
    prompted to «Choose A Download Site».

A2: Install without access to the internet, using setup’s separate download
and install actions.

  • Run setup in «Download without installing» mode somewhere it can access a
    mirror, with the desired packages selected.
  • Run setup again in «Install from local directory» mode, with the same «Local
    package directory», and set of packages selected.

Q: How can I install the last Cygwin
version for an old, unsupported Windows?

A: Run setup with the options --allow-unsupported-windows
--site circa_URL
:

Windows version Setup version Cygwin DLL version circa URL
Windows Vista
Windows Server 2008
(NT 6.0)

All 32-bit Windows

current 3.3.6

32-bit: http://ctm.crouchingtigerhiddenfruitbat.org/pub/cygwin/circa/2022/11/23/063457
The URL for any sourceware mirror, followed by cygwin-archive/20221123

64-bit: http://ctm.crouchingtigerhiddenfruitbat.org/pub/cygwin/circa/64bit/2022/11/23/063529

Windows XP SP3
Windows Server 2003
(NT 5.1)
current 2.5.2 32-bit: http://ctm.crouchingtigerhiddenfruitbat.org/pub/cygwin/circa/2016/08/30/104223
64-bit: http://ctm.crouchingtigerhiddenfruitbat.org/pub/cygwin/circa/64bit/2016/08/30/104235

Also use --no-verify with these URLs.

Windows 2000
(NT 5.0)
Windows XP SP2
2.774 1.7.18 32-bit: http://ctm.crouchingtigerhiddenfruitbat.org/pub/cygwin/circa/2013/06/04/121035

Also use --no-verify with these URLs.
Use --only-site rather than --allow-unsupported-windows with this setup version.

Thanks to
the Cygwin
Time Machine for providing this archive.

A note about 32-bit Cygwin

The limited address space of 32-bit Windows means that
random
failures in the fork(2) system call are more likely. Therefore, we
recommend using 32-bit Cygwin only in limited scenarios, with only a minimum
of necessary packages installed, and only if there’s no way to run 64-bit
Cygwin instead.

You have been warned. If you’re still sure you really need a 32-bit
Cygwin, and there’s absolutely no way around it, you may use
the setup-x86.exe installer, following the
instructions above. The signature can be
used to verify the validity of this binary.

Q: How do I help improve setup?

A: See the setup
project page for more information.

Installing Cygwin on Windows 10

Burden: ~45 minutes

Before Installation

Cygwin is available in 32- and 64-bit versions. You’ll want to determine if you’re running a 64-bit version of Windows before proceeding. To find out, do the following:

  1. Press the Windows key, then type “about”
  2. Click “About your PC”
  3. Find the value to the item marked “System type”

Installation

The installation should take about 30 minutes, depending on which mirror you choose in step 9 and network congestion.

  1. Visit Cygwin’s web site.
  2. Find the heading marked “Installing Cygwin”.
  3. Choose the 64- or 32-bit version of the .exe file and run it.
  4. This initial dialog box tells you some important information. For example, you are advised to “remember” where you save the installation files (from a subsequent step). It also says that you run this program if you want to “add, remove, or upgrade packages as necessary.”

The initial Cygwin setup dialog box

  1. In this step (“Choose Installation Type”), you have three choices: “Install from Internet”, which downloads the packages into a folder you choose, then runs the installer; “Download Without Installing”, which downloads the packages and does nothing more; and, “Install from Local Directory”, which runs the installer after you direct it to a folder that contains all the packages. Take the default (“Install from Internet”) for an initial installation.

Choose the type of installation

  1. In the “Choose Installation Directory”, you choose where to install Cygwin and for which users.

Choose where and for whom to install Cygwin

  1. The “Select Local Package Directory” step asks you for the directory in which to download Cygwin’s packages. This is the folder you need to “remember,” per the initial Cywgin setup window.

Choose where to download Cygwin’s packages

  1. In the “Select Connection Type” dialog box, choose the default, which tends to work fine.

Choose how to connect to The Internet

  1. Now, choose a mirror from where to download the packages. For the fastest download, visit the Mirror Sites page and locate a mirror closest to you.

Choose the closest mirror from which to download the Cygwin packages

  1. This next step is important, so read carefully. From the “Select Packages” dialog box, you need to choose Admin, Archive, Base, Devel, Editors, Utils, and Web. This is done by clicking the arrow to the right of each package entry, then choose “Install”.

Select the packages to install

  1. You can review and confirm the changes in this window. On an initial install, there will be myriad files listed here. However, when carrying out an update, fewer files will appear for review.

Review and confirm the changes that will be made by the Cygwin installation

  1. And, finally, a dialog box asking for the creation of useful shortcuts and confirmation of a successful installation.

Shortcuts confirmation

You can read more about the installation configuration at https://www.cygwin.com/cygwin-ug-net/setup-net.html.

If you’re taking a class with me in which I advise you to install Cygwin, continue reading.

Configure Your Cygwin Environment

Assuming you installed the 64-bit version of Cygwin, you should now have a Cygwin home folder at C:cygwin64homeUSERNAME, where USERNAME is your Cygwin username. Note: This is your Cygwin home folder, not your Windows home folder, which should still be at C:UsersUSERNAME.

  1. Download https://github.com/code-warrior/web-dev-env-config-files/archive/master.zip.
  2. Context-click, then choose to “Extract All…”
  3. Open the folder web-dev-env-config-files-master and place it in the top right section of your screen.
  4. Open your Cygwin home folder in Windows Explorer by typing Windows key + R then, in the text prompt, typing C:cygwin64homeUSERNAME.
  5. Place this opened folder in the top left section of your screen.
  6. Drag .editorconfig from web-dev-env-config-files-master on the right to C:cygwin64homeUSERNAME on the left.
  7. On the right, open the terminal folder then the git-env-for-mac-and-windows folder.
  8. Move all the files in git-env-for-mac-and-windows on the right to C:cygwin64homeUSERNAME on the left.
  9. In the right folder, go up to the parent, then open the windows folder. Move all the files in the windows folder to the left. When you’re presented with the “Replace or Skip Files” dialog box, check “Replace the files in the destination.”
  10. Close all the windows.
  11. Go to Cygwin and type “exit”.

Edit .bash_aliases and .bashrc

  • Open Cygwin and type whoami to find your exact Cygwin username.
  • Open .bash_aliases, which is in your Cygwin home folder, then replace WINDOWS-USERNAME with your Cygwin username.
  • Do the same for the file .bashrc, which is also in your Cygin home folder.

This guide was tested under Windows 10. It should be work with other supported Windows Versions too.

Install Cygwin (without admin rights)¶

This documentation is based on Oliver Doepner’s IT blog. Thank you for your work Oliver.

  1. Download setup-x86_64.exe.
  2. Open command line window (WIN+R and type cmd).
  3. Go to the download directory, e. g.:
    cd %USERPROFILE%Downloads
    
  4. Run setup-x86_64.exe with the --no-admin option:
    setup-x86_64.exe --no-admin
    
  5. During installation select the wget package.
  6. After installation open a Cygwin Terminal via Windows desktop shortcut.
  7. If you are behind an internet proxy (for example on a company environment) create /etc/profile.d/proxy.sh for internet access:
    #!/usr/bin/env bash
    
    export http_proxy=http://your.proxy.server:proxy_port
    export https_proxy=http://your.proxy.server:proxy_port
    export ftp_proxy=http://your.proxy.server:proxy_port
    export no_proxy=localhost,.example.com
    
  8. Now you need a file called /usr/local/bin/cyg-get. Downlaod it via
    wget -O /usr/local/bin/cyg-get https://gitlab.com/cogline.v3/cygwin/raw/master/cyg-get?inline=false
    

    Alternatively, you can also create the file yourself.

    #!/usr/bin/env bash
    
    # import proxy definition
    [[ -r /etc/profile.d/proxy.sh ]] && . /etc/profile.d/proxy.sh
    
    readonly SUCCESS=0
    readonly ERROR=1
    readonly E_WRONG_ARGS=2
    
    get_current_version()
    {
      cd /usr/local/bin
    
      [[ -e setup-x86_64.exe ]] && rm setup-x86_64.exe
      wget -q http://cygwin.com/setup-x86_64.exe
      chmod u+x setup-x86_64.exe
    }
    
    main()
    {
      local all_parameters="$@"
      local params="--no-admin"
      local packages=
    
      while :; do
        case "$1" in
          install)
            params="${params} -q -P"
            shift
            # list of comma separated packages
            packages=$(echo $@|sed -e 's/s+/,/g')
            params="${params} ${packages}"
            ;;
          remove)
            params="${params} -q -x"
            shift
            packages=$(echo $@|sed -e 's/s+/,/g')
            params="${params} ${packages}"
            ;;
          update)
            params="${params} -q -g"
            get_current_version
            ;;
          # Unknonw option
          -?*)
            echo "unknown option: $1"
            exit $E_WRONG_ARGS
            ;;
          # Default case: If no more options then break out of the loop.
          *)
            get_current_version
            break
        esac
        shift
      done
    
      run /usr/local/bin/setup-x86_64.exe ${params}
      exit $SUCCESS
    }
    
    main "$@"
    
  9. Make the script executable:
    chmod ugo+x /usr/local/bin/cyg-get
    
  10. On the Windows desktop create a copy of the Cygwin terminal shortcut, rename it Cygwin Setup.
  11. Edit the shortcut target, replace:
    mintty.exe -i /Cygwin-Terminal.ico -
    

    with

    mintty.exe -i /Cygwin-Terminal.ico /bin/bash -l -c 'cyg-get'
    
  12. Now test it and execute the desktop shortcut or run cyg-get from the Cygwin command
    prompt.

Cygwin Package Management¶

With the created script /usr/local/bin/cyg-get you can do package management on command line like in a linux environment. Alternatively, you could also use the pure command-line tool apt-cyg.

Install packages¶

cyg-get install package_1 package_2 ... package_n

Remove packages¶

cyg-get remove package_1 package_2 ... package_n

Update all packages¶

Note

The update option will first download a new version of setup-x86_64.exe and after that all packages will be updated.

12
Посты

2
Пользователи

0
Likes

17 Тыс.
Просмотры

SuperUser

(@superuser)

Eminent Member

Присоединился: 4 года назад

Сообщения: 36

Topic starter
15/07/2019 6:36 дп  

Я знаю про виртуальные машины и про то, что Microsoft что-то там реализовала с поддержкой ядра Linux. Виртуальная машина требует ресурсов (не подходит для совсем слабых компьютеров). Другие варианты тоже не особо простые.

Cygwin устанавливается как обычное портативное приложение. После установки на рабочий стол добавляется ярлык при клике по которому открывается консоль Linux. При том это не просто эмулятор — здесь самые настоящие программы Linux — то есть как они будут работать точно также и в настоящей ОС Linux.

У такого подхода есть ограничения — в первую очередь, нет доступа к железу (к Wi-Fi картами, сетевым картам, видеокарте). Также отсутствует как таковой менеджер пакетов — пакеты для установки можно выбрать в установщике Cygwin. То есть установить то, что не входит в стандартную поставку Linux (например, sqlmap, WPScan и т. д.) будет проблематично.

То есть с одной стороны использовать как полноценный Linux не получится. Но с другой стороны здесь предостаточно программ на знакомства с командной строкой. Например, cURL, grep, wget, sed, vim и многие другие.

Например, можно тренироваться в парсинге (в этом окружении будут работать практически все примеры из «Парсинг сайтов: азы, продвинутые техники, сложные случаи»).

Пример запуска команды в Cygwin:

curl -s  https://hackware.ru/  | grep -E -o '<h3 class=ftitle>.*</h3>' | sed 's/<h3 class=ftitle>//' | sed 's/</h3>//'

В Cygwin имитирована структура директорий Linux, то есть вы также сможете начать знакомство с устройством этой операционной системы.

Для начала обучения работе в консоли Linux рекомендуется ознакомиться со статьями:

  • Азы работы в командной строке Linux (часть 1)
  • Азы работы в командной строке Linux (часть 2)
  • Азы работы в командной строке Linux (часть 3)
  • Азы работы в командной строке Linux (часть 4)

Как установить Cygwin

Перейдите на сайт https://www.cygwin.com/ , найдите там файл setup-x86_64.exe, скачайте и запустите его.

В процессе установки программа предложит выбрать зеркало для скачивания, папку для сохранения и программы для установки — всё это можно оставить без изменений.

После установки на рабочем столе появится ярлык.

SSH, Python, Vim, инструменты компиляции

Не надо воспринимать Cygwin как простую игрушку. Это весьма продвинутая среда, которая содержит множество инструментов Linux, в том числе для продвинутых пользователей

В Cygwin имеется полноценный SSH клиент, который позволяет подключаться к удалённым системам и даже генерировать SSH ключи. То есть вы можете использовать Cygwin для подключения к вашим удалённым серверам или другим системам Linux — Cygwin может заменить сторонние клиенты SSH, которые не всегда удобны

В Cygwin уже присутствует Python — вы можете начать осваивать данный язык без установки в Windows.

Консольный текстовый редактор, например, Vim — обязательный инструмент при редактировании конфигураций на удалённых системах — здесь вы можете в спокойной обстановке начать с ним знакомство.

Имеется Git — обновления своих репозиториев Git, либо можно использовать просто для скачивания (клонирования) репозиториев других разработчиков.

Совсем продвинутые пользователи могут даже воспользоваться инструментами компиляции.

В пакетах можно увидеть PHP, веб-сервер и многое другое.

Итак

Cygwin — это отличный вариант начать знакомство с Linux. Работает даже на слабых компьютерах и поддерживает очень многие возможности ОС Linux.

В этой теме будем рассматривать простые и сложные примеры использовании Cygwin, в том числе компиляцию и установку инструментов.

MiAl

(@mial)

Участник Admin

Присоединился: 4 года назад

Сообщения: 267

14/10/2019 9:57 дп  

Как получить доступ к дискам в Cygwin

Если при установке Cygwin вы оставили путь по умолчанию, то Cygwin храниться в папке C:cygwin64. Именно эта папка является для Cygwin корнем файловой системы выше которой подняться невозможно.

В ОС Linux другие диски (если они есть) подключаются в выбранные точки монтирования ниже по дереву файловой системы. То есть в Cygwin можно просматривать список файлов, создавать новые файлы, редактировать и удалять существующие файлы на всех дисках ОС Windows (если позволяют права записи). Но нужно знать, куда они смонтированы.

Чтобы просмотреть список физических дисков в системе:

ls -l /dev/s*

Пример вывода:

brw-rw-rw- 2 MiAl Отсутствует 11, 0 окт 14 10:23 /dev/scd0
brw-rw-rw- 1 MiAl Отсутствует 8, 0 окт 14 10:23 /dev/sda
brw-rw-rw- 1 MiAl Отсутствует 8, 1 окт 14 10:23 /dev/sda1
brw-rw-rw- 1 MiAl Отсутствует 8, 2 окт 14 10:23 /dev/sda2
brw-rw-rw- 1 MiAl Отсутствует 8, 3 окт 14 10:23 /dev/sda3
brw-rw-rw- 1 MiAl Отсутствует 8, 4 окт 14 10:23 /dev/sda4
brw-rw-rw- 2 MiAl Отсутствует 11, 0 окт 14 10:23 /dev/sr0
lrwxrwxrwx 1 MiAl Отсутствует 15 июл 12 23:41 /dev/stderr -> /proc/self/fd/2
lrwxrwxrwx 1 MiAl Отсутствует 15 июл 12 23:41 /dev/stdin -> /proc/self/fd/0
lrwxrwxrwx 1 MiAl Отсутствует 15 июл 12 23:41 /dev/stdout -> /proc/self/fd/1

Как можно понять из предыдущего вывода, диск /dev/sda разделён на четыре раздела: /dev/sda1, /dev/sda2, /dev/sda3 и /dev/sda4.

Но здесь размещены диски как устройства — то есть к этим устройствам в Linux можно обращаться при форматировании, создании и удалении томов (возможно, Cygwin не может взаимодействовать с дисками на таком уровне). Для доступа к файлам дисков, их нужно смонтировать, то есть подключить к дереву файловой системы (подробности смотрите в статье «Структура директорий Linux. Важные файлы Linux»).

Чтобы просмотреть информацию о смонтированных дисках и точках монтирования, выполним команду:

mount

Пример вывода:

C:/cygwin64/bin on /usr/bin type ntfs (binary,auto)
C:/cygwin64/lib on /usr/lib type ntfs (binary,auto)
C:/cygwin64 on / type ntfs (binary,auto)
C: on /cygdrive/c type ntfs (binary,posix=0,user,noumount,auto)
Z: on /cygdrive/z type vboxsharedfolderfs (binary,posix=0,user,noumount,auto)

Из этой информации следует, что диск C смонтирован в директорию /cygdrive/c. Диск Z: (это сетевой диск) смонтирован в директорию /cygdrive/z.

Запись C:/cygwin64 on / означает, что в качестве корневой файловой системы (/) смонтирована папка C:/cygwin64.

Чтобы увидеть все диски системы, включая сетевые и включая флешки и другие внешние диски выполните команду:

ls -l /cygdrive/

Итак, к любому диску в Windows из Cygwin можно получить доступ через папку /cygdrive/. К примеру, для просмотра файлов и папок на диске C:

ls -l /cygdrive/c

MiAl

(@mial)

Участник Admin

Присоединился: 4 года назад

Сообщения: 267

29/08/2020 1:58 пп  

Как установить пакеты (программы) в Cygwin

Рассмотрим ситуацию, как в Cygwin установить дополнительные пакеты

Рассмотрим на примере: нам нужно установить ряд зависимостей, а именно следующие пакеты (они нужны для компиляции):

  • libssl-devel
  • ibbz2-devel
  • libgmp-devel
  • zlib-devel
  • libOpenCL-devel
  • libcrypt-devel

Это можно сделать двумя разными способами.

Первый способ установки программ в Cygwin

Во-первых, вы можете запустить установщик ещё раз, и на этапе выбора пакетов переключитесь в список «Full», введите имя пакета и дважды кликните на слово «Skip»:

 Чтобы вместо него появился номер версии:

Сразу после этого введите имя второго пакета (первый пакет как бы пропадёт — не надо об этом беспокоится), кликните на слово «Skip».

Повторите это для всех пакетов.

Когда закончите, очистите поле поиска и переключитесь на список «Pending» чтобы увидеть список пакетов для установки:

Нажмите далее и завершите установку выбранных пакетов. 

Второй способ установки программ в Cygwin

Возможно, вам больше понравится другой способ: переместите установочный файл setup-x86_64.exe в папку C:cygwin64 и затем откройте командную строку Windows (PowerShell) и просто выполните команду вида:

C:cygwin64setup-x86_64.exe -q -P ПАКЕТ1 -P ПАКЕТ2 -P ПАКЕТ3

К примеру, для моего примера по установке шести пакетов команда выглядит так:

C:cygwin64setup-x86_64.exe -q -P libssl-devel -P libbz2-devel -P libgmp-devel -P zlib-devel -P libOpenCL-devel -P libcrypt-devel

Сразу после запуска команды начнётся скачивание и установка требуемых пакетов CygWin.

 Выберите любой из этих способов.

SuperUser

(@superuser)

Eminent Member

Присоединился: 4 года назад

Сообщения: 36

Topic starter
21/05/2021 12:39 пп  

apt-cyg — apt для Cygwin

Как установить apt-cyg

 Кроме показанного выше способа установки пакетов в Cygwin с помощью установщика самого Cygwin, имеется аналог программы apt (apt-get) для Cygwin, он называется apt-cyg.

 Чтобы установить apt-cyg выполните следующие команды:

wget  https://raw.githubusercontent.com/transcode-open/apt-cyg/master/apt-cyg 
install apt-cyg /bin

Если появится ошибка

-bash: wget: command not found

то сделайте так:

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

Для нормальной работы apt-cyg нужны пакеты lynx и wget. Если они у вас отсутствуют, то может потребоваться установить их обычным способом, с помощью установщика Cygwin.

Теперь для установки новых пакетов вы можете использовать команду вида:

apt-cyg install ПАКЕТ

Например:

apt-cyg install libxml2

Справка по команде apt-cyg

НАЗВАНИЕ

apt-cyg — утилита управления пакетами

ИСПОЛЬЗОВАНИЕ

apt-cyg [операция] [опции] [цели]

ОПИСАНИЕ

apt-cyg — это утилита управления пакетами, которая отслеживает установленные пакеты в системе Cygwin. Вызов apt-cyg включает в себя указание операции с любыми потенциальными параметрами и целями для работы. Целью обычно является имя пакета, имя файла, URL-адрес или строка поиска. Цели могут быть предоставлены как аргументы командной строки.

ОПЕРАЦИИ

install

Установить пакет(ы).

remove

Удалить пакет(ы) из системы.

update

Загрузить новую копию главного списка пакетов (setup.ini) с сервера, определённого в setup.rc.

download

Получить пакет(ы) с сервера, но ничего не устанавливать/не обновлять.

show

Показать информацию о данном пакете(ах).

depends

Создать дерево зависимостей для пакета.

rdepends

Создать дерево пакетов, зависящих от названного пакета.

list

Найти в каждом локально установленном пакете имена, соответствующие регулярному выражению. Если в командной строке не указаны имена пакетов, будут опрошены все установленные пакеты.

listall

Будет искать каждый пакет в главном списке пакетов (setup.ini) на предмет имён, соответствующих регулярному выражению.

category

Отобразить все пакеты, входящие в указанную категорию.

listfiles

Список всех файлов, принадлежащих данному пакету. В командной строке можно указать несколько пакетов.

search

Найти загруженные пакеты, которым принадлежат указанные файлы. Путь может быть относительным или абсолютным, можно указать один или несколько файлов.

searchall

Поиск по cygwin.com, чтобы получить информацию о файлах о пакетах. Предоставленная цель считается именем файла, и поисковая система вернёт пакет(ы), содержащий этот файл.

mirror

Установить зеркало; полный URL-адрес места, где можно найти базу данных, пакеты и подписи для этого репозитория. Если URL-адрес не указан, отобразит текущее зеркало.

cache

Установит каталог кэша пакетов. Если файл не найден в каталоге кеша, он будет загружен. Принимаются пути в формах Unix и Windows, а также абсолютные или обычные пути. Если каталог не указан, отобразить текущий кеш.

ОПЦИИ

—nodeps

Укажите этот параметр, чтобы пропустить все проверки зависимостей.

—version

Вывести версию и выйти. 

Ошибка «apt-cyg: command not found»

Если при запуске

apt-cyg

Вы получили ошибку

-bash: apt-cyg: command not found

то это означает, что вам нужно установить скрипт apt-cyg как это показано в начале данного поста.

SuperUser

(@superuser)

Eminent Member

Присоединился: 4 года назад

Сообщения: 36

Topic starter
21/05/2021 12:42 пп  

Как обновить Cygwin

Обновление пакетов Cygwin выполняется также, как и установка.

Для обновления всех компонентов Cygwin и установленных пакетов, перейдите на сайт https://www.cygwin.com/ , найдите там файл setup-x86_64.exe, скачайте и запустите его.

Далее следуйте всех шагам установщика, при завершении его работы, Cygwin будет обновлён.

SuperUser

(@superuser)

Eminent Member

Присоединился: 4 года назад

Сообщения: 36

Topic starter
21/05/2021 1:15 пп  

Как из Cygwin запустить программу в Windows

С помощью утилиты cygstart вы можете запустить программу в Windows прямо из Cygwin:

cygstart notepad

Если запускаемая программа не включена в PATH, то вам нужно указать полный путь до неё.

При желании, вы можете передать аргументы в запускаемую программу, например:

cygstart notepad C:file.txt

SuperUser

(@superuser)

Eminent Member

Присоединился: 4 года назад

Сообщения: 36

Topic starter
21/05/2021 1:33 пп  

Как конвертировать пути Windows и UNIX

С помощью утилиты cygpath вы можете конвертировать пути Windows и UNIX между собой.

Например:

Путь в формате Windows с указанием относительного пути до файла:

cygpath --windows ~/.bashrc
C:cygwin64homeMiAl.bashrc

Путь в формате Linux для файла в смешанной записи:

cygpath --unix C:/cygwin/bin/ls.exe
/cygdrive/c/cygwin/bin/ls.exe

Путь до файла в директории Cygwin в формате Linux с указанием абсолютного пути до файла:

cygpath --unix C:\cygwin\bin\ls.exe
/cygdrive/c/cygwin/bin/ls.exe

Обратите внимание, что bash интерпретирует обратную косую черту «» как escape-символ (экранирование), поэтому вы должны ввести его дважды в оболочке bash, если хотите, чтобы он распознавался как буквальная обратная косая черта.

Вывод в смешанной записи:

cygpath --mixed ~/.bashrc
C:/cygwin64/home/MiAl/.bashrc

Чтобы показать путь до директории Desktop и выйти:

cygpath -D
/cygdrive/c/Users/MiAl/Desktop

Чтобы показать путь до директории Profiles и выйти:

cygpath -H
/cygdrive/c/Users

Чтобы показать путь до директории My Documents и выйти:

cygpath -O
/cygdrive/c/Users/MiAl/Documents

Чтобы показать путь до директории Programs в Start Menu и выйти:

cygpath -P
/cygdrive/c/Users/MiAl/AppData/Roaming/Microsoft/Windows/Start Menu/Programs

Чтобы показать путь до системной директории и выйти:

cygpath -S
/cygdrive/c/Windows/System32

Чтобы показать путь до директории Windows и выйти:

cygpath -W
/cygdrive/c/Windows

SuperUser

(@superuser)

Eminent Member

Присоединился: 4 года назад

Сообщения: 36

Topic starter
21/05/2021 1:44 пп  

Вывод системной информации о Cygwin (cygcheck)

Утилита cygcheck выводит системную информацию, проверяет установленные пакеты или делает запросы к базе данных пакетов.

Использование:

cygcheck [-v] [-h] PROGRAM
cygcheck -c [-d] [PACKAGE]
cygcheck -s [-r] [-v] [-h]
cygcheck -k
cygcheck -f FILE [FILE]...
cygcheck -l [PACKAGE]...
cygcheck -p REGEXP
cygcheck --delete-orphaned-installation-keys
cygcheck -h

Требуется хотя бы одна опция команды или ПРОГРАММА, как показано выше.

Опции:

  ПРОГРАММА            список зависимостей библиотеки (DLL) ПРОГРАММЫ
  -c, --check-setup    показать установленную версию ПАКЕТА и проверить целостность
                       (или для всех установленных пакетов, если не указан)
  -d, --dump-only      просто перечислить пакеты, не проверять (с -c)
  -s, --sysinfo        производить диагностическую информацию о системе (подразумевает -c)
  -r, --registry       также просканировать реестр на предмет настроек Cygwin (с -s)
  -k, --keycheck       выполнить сеанс проверки клавиатуры (должен запускаться
                       только с простой консоли, а не с pty/rxvt/xterm)
  -f, --find-package   найти пакет, которому принадлежит ФАЙЛ
  -l, --list-package   перечислить содержимое ПАКЕТА (или всех пакетов, если они не указаны)
  -p, --package-query  поиск REGEXP во всем репозитории пакетов cygwin.com
                       (требуется подключение к Интернету)
  --delete-orphaned-installation-keys
                       Удалите установочные ключи старых, теперь неиспользуемых
                       установок из реестра. Требуется право вносить изменения в
                       реестр.
  -v, --verbose        производить более подробный вывод
  -h, --help           аннотировать вывод пояснительными комментариями, если он задан
                       другой командой, в противном случае распечатать эту справку
  -V, --version        распечатать версию cygcheck и выйти

Примечание: -c, -f и -l сообщают только об установленных в данный момент пакетах. Вместо этого для поиска во всех официальных пакетах Cygwin используйте -p. Параметр -p REGEXP сопоставляет имена пакетов, описания и имена файлов/путей во всех пакетах.

SuperUser

(@superuser)

Eminent Member

Присоединился: 4 года назад

Сообщения: 36

Topic starter
26/05/2021 8:04 дп  

Зеркала репозиториев Cygwin

Cygwin имеет ряд зеркал FTP серверов для своих репозиториев. Полный список актуальных зеркал вы найдёте по ссылке https://cygwin.com/mirrors.html . Список автоматически обновляется и поддерживается.

Чтобы вывести текущее зеркало, выполните команду:

apt-cyg mirror

Чтобы установить новое зеркало, выполните команду вида:

apt-cyg mirror URL

Например:

apt-cyg mirror  https://cygwin.cu.be/ 

SuperUser

(@superuser)

Eminent Member

Присоединился: 4 года назад

Сообщения: 36

Topic starter
26/05/2021 8:12 дп  

32-битный Cygwin

На первый взгляд, на главной странице Cygwin имеется только один установщик, это setup-x86_64.exe — установщик 64-битной версии. На самом деле, внизу страницы всё же присутствует и установщик 32-битного Cygwin, но авторы настоятельно не рекомендуют его использовать, вот что сказано об этом на официальном сайте:

Адресное пространство — очень ограничивающий фактор для Cygwin. В наши дни полноценный 32-битный дистрибутив Cygwin больше невозможен и, по всей вероятности, выйдет из строя в случайных местах из-за проблемы с системным вызовом fork(2).

Поэтому мы рекомендуем использовать 32-битный Cygwin только в ограниченных сценариях, с установленным минимумом необходимых пакетов и только в том случае, если вместо этого нет возможности запустить 64-битный Cygwin.

Вы были предупреждены. Если вы все еще уверены, что вам действительно нужен 32-битный Cygwin, и нет никакого способа обойтись без него, вы можете запустить установщик setup-x86.exe.

SuperUser

(@superuser)

Eminent Member

Присоединился: 4 года назад

Сообщения: 36

Topic starter
26/05/2021 9:36 дп  

Запуск программ с графическим интерфейсом в Cygwin

В Cygwin возможно запускать программы с графическим интерфейсом, а также менеджеры окон и даже графические окружения рабочего стола.

Пакеты Cygwin/X в категории X11.

  • xorg-server (требуется, X сервер Cygwin/X)
  • xinit (требуется, скрипты для запуска X сервера: xinit, startx, startwin (и ссылки на Start Menu для его запуска), startxdmcp.bat )
  • xorg-docs (опциональный, man страницы)
  • xlaunch (опциональный, мастер для запуска X сессий)

Пример запуска программы с графическим интерфейсом в Cygwin.

Установите apt-cyg, если не сделали это ранее:

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

Установите X сервер и необходимый скрипты:

apt-cyg install xorg-server xinit

Запустите X сервер:

startxwin &

Нажмите Enter, чтобы увидеть приглашение командной строки.

Установите значение переменной DISPLAY:

export DISPLAY=:0.0

Запустите желаемую программу с графическим интерфейсом:

~/johnny/johnny

Смотрите также: Chapter 3. Using Cygwin/X

Ошибка «Could not connect to any X display.» в Cygwin

Если при запуске программы с графическим интерфейсом вы получили ошибку вроде следующей:

QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to ‘/tmp/runtime-MiAl’

qt.qpa.screen: QXcbConnection: Could not connect to display

Could not connect to any X display.

То она означает, что вы не запустили X сервер и/или не установили значение переменной DISPLAY. Для исправления ошибки, выполните шаги, показанные выше.

SuperUser

(@superuser)

Eminent Member

Присоединился: 4 года назад

Сообщения: 36

Topic starter
26/05/2021 10:15 дп  

Как перезагрузить Cygwin

Вы можете обратить внимание, что даже после закрытия консоли, а затем её открытия, некоторые процессы, запущенные в Cygwin, продолжают работать. Вы можете проверить их с помощью команд

ps -e

Или

top

В Менеджере задач Windows вы можете увидеть процесс conhost.exe, принадлежащий Cygwin, даже после закрытия всех терминалов.

Программы, запущенные с X сервером, также не отключаются при закрытии терминалов Cygwin.

Поскольку Cygwin не является полным ядром Linux, некоторые мелкие вещи, такие как выключение машины, не будут работать так, как на Linux. 

Единственные способы, которыми удаётся закрыть эти процессы — перезагрузить Windows или снять задачи вручную.

Установка Cygwin для Windows Печать

Добавил(а) microsin

  

Для того, чтобы в среде Eclipse можно было компилировать C/C++ приложения для Android, понадобится среда окружения Cygwin [1], где есть необходимая утилита make.

[Установка CygWin]

Запустите на выполнение setup-x86.exe или setup-x86_64.exe [1] в зависимости от версии Вашей Windows. На скриншотах показаны шаги выбора в мастере установки. Выберите Install from Internet, каталог установки c:cygwin, папку для сохранения временных файлов c:temp, тип подключения к Интернет, адрес сервера, откуда будут скачиваться пакеты.

Выберите для установки пакеты Devel/make и Shells/bash.

Запустите установку и дождитесь её окончания.

[Проверка работоспособности CygWin]

Выполните в командной строке команду:

Cygwin-install12-check-Cygwin

В Вашей операционной системе может быть установлено несколько программ, которые могут использовать утилиту make. К примеру, это могут быть Atmel Studio 6, Visual Studio, MinGW, WinAVR и другие тулчейны. Какая из утилит make запустится в ответ на ввод команды make, зависит от переменной окружения PATH, где указаны пути поиска запускаемых программ. Утилита make из пакета Cygwin находится в папке c:cygwinbin, поэтому если хотите, чтобы запускалась именно эта версия make, то проверьте наличие пути c:cygwinbin в составе переменной PATH. Содержимое переменной PATH можно посмотреть командой консоли set PATH. На скриншоте показан пример такого вывода.

Cygwin-install13-SET-PATH

Как можете увидеть на примере этого скриншота, в данном случае переменная PATH не содержит пути c:cygwinbin, поэтому будет запускаться утилита make из каталога c:Program FilesAtmelAVR ToolsAVR Toolchainbin (этот путь присутствует в переменной PATH, и стоит первым по порядку). Поэтому будьте внимательны!

Переменную PATH можно настроить через Мой компьютер -> Свойства -> Дополнительно -> Переменные среды.

При запуске make из окна терминала Cygwin Terminal запустится утилита make из каталога c:cygwinbin:

Cygwin-terminal-make-version

[Настройка переменных окружения bash-шелла Cygwin]

Все переменные окружения Windows автоматически импортируются в переменные окружения bash. Однако есть некоторая проблема, связанная с пробелами в именах путей Windows. Такие пути требуют особого внимания, и для их корректного преобразования в пути cygwin требуется специальная настройка.

Для разработки под Android нужно, чтобы были доступны утилиты JDK, SDK, NDK, Ant, которые находятся обычно в путях, обозначенных переменными окружения Windows: JAVA_HOME, ANDROID_SDK, ANDROID_NDK, ANT_HOME соответственно. Если в путях переменных окружения есть пробелы, то такие переменные требуют специального экспорта в окружение bash.

В каталоге c:cygwinhomeимя_пользователя находится файл .bash_profile, в котором делаются основные настройки рабочего окружения среды bash Cygwin. Для настройки переменных окружения, связанных с путями поиска утилит JDK, SDK, NDK, Ant, добавьте в конец файла .bash_profile следующие строки:

export ANT_HOME=`cygpath -u "$ANT_HOME"`
export JAVA_HOME=`cygpath -u "$JAVA_HOME"`
export ANDROID_SDK=`cygpath -u "$ANDROID_SDK"`
export ANDROID_NDK=`cygpath -u "$ANDROID_NDK"`

Команда export назначает указанное значение строковой переменной окружения. Это значение вырабатывает утилита cygpath, которая принимает в качестве параметра значение старой переменной окружения Windows. Обратите внимание, что строка с опциями для запуска команды cygpath обрамлена символом `, который служит для выделения запускаемой команды в конфиге. Не переgутайте ` с другими символами ‘ и «», это очень важно.

Если после внесения указанных изменений в файл .bash_profile запустить окно терминала Cygwin, то в переменных окружения bash появятся переменные $JAVA_HOME, $ANDROID_SDK, $ANDROID_NDK, $ANT_HOME, которые будут иметь корректные пути cygwin. Вот пример такого пути для переменной $JAVA_HOME:

JAVA_HOME='/cygdrive/c/Program Files/Java/jdk1.7.0_45'

[Ссылки]

1. Installing and Updating Cygwin Packages site:cygwin.com.


Download Article


Download Article

Cygwin is a free command line interface that allows programs that were written for things like Linux and Unix to run on Windows. In other words, it provides an environment where Windows applications and tools can run alongside those from Unix or Linux and, for someone familiar with Unix environments, it can mitigate the need to learn a whole new set of skills to perform simple terminal commands when in a Windows environment. While it may be alien to first time users, the apparently complex nature of Cygwin can become second nature with a little practice.

  1. Image titled Use Cygwin Step 1

    1

    Install Cygwin. Go to http://cygwin.com and click on «Install Cygwin» in the left column. This will allow you to download a setup.exe file and choose «Install from Internet.» Click «Next.»

  2. Image titled Use Cygwin Step 2

    2

    Choose your settings. For most users, it is fine to leave the default installation directory, which is «c:cygwin and the other default settings.

  3. Image titled Use Cygwin Step 3

    3

    Choose a temporary directory. This is where Cygwin will store the packages you download. Any temporary directory will work.

  4. Image titled Use Cygwin Step 4

    4

    Download through a «Direct Connection.» You will now be presented with a list of Cygwin mirrors. Either select the default, or, if that is running to slowly, choose a random option. Click «Next.»

  5. Image titled Use Cygwin Step 5

    5

    Choose your software packages. You will be presented with a long list of packages that will seem daunting in their scope if you are new to Cygwin. If you are new to Cygwin, stick with the default packages and click «Next.» Wait for the loading bar to complete, which may take a few minutes.[1]

  6. Image titled Use Cygwin Step 6

    6

    Use Cygwin as you would UNIX. It might require a bit of customization. For example, adding your user name to «/etc/password.» Make sure you allow it to put an icon on your desktop during setup. When you double-click that icon, it will open up a shell window.

  7. Image titled Use Cygwin Step 7

    7

    Wait for the first few lines to appear. These will only appear the first time you use Cygwin. After the initial setup phase, you will instead be greeted with yourusername@yourcomputer'sname~ $ in green text. This is where you will input your commands.

  8. Image titled Use Cygwin Step 8

    8

    Update Cygwin programs. If you would like to update or download more Cygwin compatible programs, simply return to Cygwin’s homepage and click «Update.» This will take you back to settings options from when you first downloaded Cygwin.

  1. Image titled Use Cygwin Step 9

    1

    Find a file. Some of the most basic commands you can use in Cygwin are the search and comparison tools. To find a file you can input the following command: $ find . -name EXAMPLE. This will show you all of your files with that name, however, it is case sensitive.[2]

  2. Image titled Use Cygwin Step 10

    2

    Find a keyword within a file. If you would like to find certain text within a file, you need to incorporate the «grep» command. Thus, to find all instances of «EXAMPLE» you would need to input $ grep 'EXAMPLE' EXAMPLE.txt. This will provide you with all of the instances of the text «EXAMPLE» within the EXAMPLE.txt file. However, this particular command is case sensitive. To find all instances of «EXAMPLE» regardless of case, continue to the next step.

  3. Image titled Use Cygwin Step 11

    3

    Find text regardless of case. To find text regardless of text, simply add -i after the grep command. It should look something like this: $ grep -i 'EXAMPLE' EXAMPLE.txt.

  4. Image titled Use Cygwin Step 12

    4

    Compare two files. If you would like to compare two files, you can easily do so by entering the diff command. Simply input the command followed by the names of the two files you wish to compare: diff EXAMPLE.txt PRACTICE.txt. This will then present you with the two files, one after another.[3]

  5. Image titled Use Cygwin Step 13

    5

    Explore the basic commands. Some of the basic commands are listed in the table below alongside their corresponding command in Windows.

    Action Windows Cygwin
    list directory dir ls
    clear console cls clear
    copy file(s) copy cp
    move file(s) move mv
    delete file(s) del rm
    create directory md mkdir
    remove directory rd rm -rf
    change current directory cd cd
    current directory cd, chdir pwd
    search find grep
    concatenate cat cat
    permissions chmod chmod
    display/output text echo echo

Add New Question

  • Question

    How do I launch a program?

    Fouzi Bounezef

    Fouzi Bounezef

    Community Answer

    To start a program as an administrator, you must right click the window with the option to run as administrator.

  • Question

    How can I use micro for writing program in Cygwin?

    Arrogance

    The syntax of a program varies by language, so that’s not directly possible to answer. As far as micro goes, the only thing you need to know is to press Ctrl and S to save a new file, and Ctrl and Q to exit. Use the «arrow» keys on your keyboard to navigate through a file.

  • Question

    How to save the section of my work in Cygwin and restore it to continue?

    Arrogance

    Cygwin is just an API compatibility layer and environment. An answer to your question is very application-dependent.

See more answers

Ask a Question

200 characters left

Include your email address to get a message when this question is answered.

Submit

  • If you are not familiar with UNIX, think twice before trying Cygwin.

References

About This Article

Article SummaryX

1. Download the installer from http://cygwin.com.
2. Run the installer.
3. Select software packages to install.
4. Follow the on-screen instructions.
5. Enter Unix commands at the prompt.

Did this summary help you?

Thanks to all authors for creating a page that has been read 175,873 times.

Is this article up to date?


Download Article


Download Article

Cygwin is a free command line interface that allows programs that were written for things like Linux and Unix to run on Windows. In other words, it provides an environment where Windows applications and tools can run alongside those from Unix or Linux and, for someone familiar with Unix environments, it can mitigate the need to learn a whole new set of skills to perform simple terminal commands when in a Windows environment. While it may be alien to first time users, the apparently complex nature of Cygwin can become second nature with a little practice.

  1. Image titled Use Cygwin Step 1

    1

    Install Cygwin. Go to http://cygwin.com and click on «Install Cygwin» in the left column. This will allow you to download a setup.exe file and choose «Install from Internet.» Click «Next.»

  2. Image titled Use Cygwin Step 2

    2

    Choose your settings. For most users, it is fine to leave the default installation directory, which is «c:cygwin and the other default settings.

  3. Image titled Use Cygwin Step 3

    3

    Choose a temporary directory. This is where Cygwin will store the packages you download. Any temporary directory will work.

  4. Image titled Use Cygwin Step 4

    4

    Download through a «Direct Connection.» You will now be presented with a list of Cygwin mirrors. Either select the default, or, if that is running to slowly, choose a random option. Click «Next.»

  5. Image titled Use Cygwin Step 5

    5

    Choose your software packages. You will be presented with a long list of packages that will seem daunting in their scope if you are new to Cygwin. If you are new to Cygwin, stick with the default packages and click «Next.» Wait for the loading bar to complete, which may take a few minutes.[1]

  6. Image titled Use Cygwin Step 6

    6

    Use Cygwin as you would UNIX. It might require a bit of customization. For example, adding your user name to «/etc/password.» Make sure you allow it to put an icon on your desktop during setup. When you double-click that icon, it will open up a shell window.

  7. Image titled Use Cygwin Step 7

    7

    Wait for the first few lines to appear. These will only appear the first time you use Cygwin. After the initial setup phase, you will instead be greeted with yourusername@yourcomputer'sname~ $ in green text. This is where you will input your commands.

  8. Image titled Use Cygwin Step 8

    8

    Update Cygwin programs. If you would like to update or download more Cygwin compatible programs, simply return to Cygwin’s homepage and click «Update.» This will take you back to settings options from when you first downloaded Cygwin.

  1. Image titled Use Cygwin Step 9

    1

    Find a file. Some of the most basic commands you can use in Cygwin are the search and comparison tools. To find a file you can input the following command: $ find . -name EXAMPLE. This will show you all of your files with that name, however, it is case sensitive.[2]

  2. Image titled Use Cygwin Step 10

    2

    Find a keyword within a file. If you would like to find certain text within a file, you need to incorporate the «grep» command. Thus, to find all instances of «EXAMPLE» you would need to input $ grep 'EXAMPLE' EXAMPLE.txt. This will provide you with all of the instances of the text «EXAMPLE» within the EXAMPLE.txt file. However, this particular command is case sensitive. To find all instances of «EXAMPLE» regardless of case, continue to the next step.

  3. Image titled Use Cygwin Step 11

    3

    Find text regardless of case. To find text regardless of text, simply add -i after the grep command. It should look something like this: $ grep -i 'EXAMPLE' EXAMPLE.txt.

  4. Image titled Use Cygwin Step 12

    4

    Compare two files. If you would like to compare two files, you can easily do so by entering the diff command. Simply input the command followed by the names of the two files you wish to compare: diff EXAMPLE.txt PRACTICE.txt. This will then present you with the two files, one after another.[3]

  5. Image titled Use Cygwin Step 13

    5

    Explore the basic commands. Some of the basic commands are listed in the table below alongside their corresponding command in Windows.

    Action Windows Cygwin
    list directory dir ls
    clear console cls clear
    copy file(s) copy cp
    move file(s) move mv
    delete file(s) del rm
    create directory md mkdir
    remove directory rd rm -rf
    change current directory cd cd
    current directory cd, chdir pwd
    search find grep
    concatenate cat cat
    permissions chmod chmod
    display/output text echo echo

Add New Question

  • Question

    How do I launch a program?

    Fouzi Bounezef

    Fouzi Bounezef

    Community Answer

    To start a program as an administrator, you must right click the window with the option to run as administrator.

  • Question

    How can I use micro for writing program in Cygwin?

    Arrogance

    The syntax of a program varies by language, so that’s not directly possible to answer. As far as micro goes, the only thing you need to know is to press Ctrl and S to save a new file, and Ctrl and Q to exit. Use the «arrow» keys on your keyboard to navigate through a file.

  • Question

    How to save the section of my work in Cygwin and restore it to continue?

    Arrogance

    Cygwin is just an API compatibility layer and environment. An answer to your question is very application-dependent.

See more answers

Ask a Question

200 characters left

Include your email address to get a message when this question is answered.

Submit

  • If you are not familiar with UNIX, think twice before trying Cygwin.

References

About This Article

Article SummaryX

1. Download the installer from http://cygwin.com.
2. Run the installer.
3. Select software packages to install.
4. Follow the on-screen instructions.
5. Enter Unix commands at the prompt.

Did this summary help you?

Thanks to all authors for creating a page that has been read 175,873 times.

Is this article up to date?

Profile picture for user Олег

Cygwin

Cygwin — UNIX-подобная среда и оболочка командной строки для Microsoft Windows.

Cygwin связывает ресурсы Windows с ресурсами UNIX-подобной среды. Из среды Cygwin можно запускать приложения Windows, также в Windows можно использовать инструменты Cygwin.

https://www.cygwin.com

Я использую Cygwin для компиляции приложений Linux под Windows, поскольку Cygwin позволяет переносить утилиты UNIX в Windows без особых изменений исходного кода.

В Windows уже есть такая штука как WSL, в некоторых случаях можно использовать привычную Linux среду в виртуальных машинах. Однако, Cygwin имеет некоторые преимущества.

  • Предоставляет оболочку UNIX для Windows с готовым набором утилит UNIX/Linux и Windows.
  • Нет нужды разворачивать виртуальную машину и настраивать её, просто используем инсталлятор.
  • Тратит меньше ресурсов чем виртуальная машина.
  • Подходит для тестирования и разработки приложений UNIX/Linux в Windows.
  • Совместима со старыми версиями Windows.

soft

Установка Cygwin

Скачиваем инсталлятор. Есть 32-битная и 64-битная версии.

setup-x86.exe

setup-x86_64.exe

Запускаем инсталлятор.

soft

Далее.

soft

Есть три варианта установки. По умолчанию выбрана установка из Интернет, оставляю её. Продвинутые пользователи могут воспользоваться другими вариантами, если у них есть локальный репозиторий или просто требуется скачать пакеты без установки. Далее.

soft

Выбираем путь установки. Я оставляю значение по умолчанию C:cygwin64. Буду устанавливать для всех пользователей. Далее.

soft

Папка для скачиваемых файлов. Далее.

soft

В большинстве случаев для загрузки пакетов следует использовать параметр Using System Proxy Settings. Если требуется использовать другие параметры подключения к Интернет, то указываем их. Далее.

soft

Выбираем зеркало для загрузки пакетов. Желательно выбирать ближнее с географической точки зрения, это влияет на время установки. Далее.

soft

Инсталлятор предоставляет множество утилит на базе UNIX/Linux, работающих под управлением Windows. Не все пакеты устанавливаются по умолчанию. Нужно ответственно подойти к задаче и установить то, что требуется именно вам. Мне нужны пакеты для разработки, указываю Devel — Install. Далее.

soft

Далее.

soft

Инсталлятор начинает скачивать с зеркала пакеты. Процесс может быть долгим.

soft

После загрузки пакетов они устанавливаются.

soft

После завершения установки можно создать значок на рабочем столе и в меню Пуск. Готово.

soft

Теперь можно запустить Cygwin.

soft

Если пакетов не хватает не работает, можно повторно запустить программу установки и выбрать отсутствующий пакет. Документация доступна здесь:

https://cygwin.com/docs.html

https://ru.wikipedia.org/wiki/Cygwin

If you are a Linux or Unix user, I am sure you will miss the terminal (and all the wonderful things you can do with command lines) in a Windows environment. Most of the time you won’t need to use the command prompt in Windows, and its user-interface is not as friendly either. However, if you have the need to use a terminal, Cygwin is the best tool for you. Let us see how to install and configure Cygwin in the Windows environment.

What is Cygwin

Cygwin is a free and open source software with tons of optional packages which lets you run and execute the age-old Unix-like commands right in your Windows system. Do note that it can’t be used to run any Linux/Unix software though.

Installing Cygwin

To install Cygwin, head to the official site of Cygwin and download the executable depending on your system preference (32-bit or 64-bit). The executable itself is small as it downloads all the required packages while installing the software.

install-cygwin-select-installer

Once you have downloaded the Cygwin installer, launch the installer as the Administrator. You will be greeted with the welcome screen,;just click on the “Next” button to continue. Here in this screen, select the radio button “Install from Internet” and click on the “Next” button. This option will download all the required packages for the installation and will store them in the local directory for future use.

install-cygwin-install-from-internet

Here you can select the root directory for the Cygwin installation. The default settings are fine unless you want to customize the installation directory and user access. Click on the “Next” button to continue.

install-cygwin-select-install-directory

In this screen, you can select the local package directory where the downloaded files are stored. If you want to change it, go ahead and change the directory location by click on the “browser” button. Otherwise, click on the “Next” button to continue.

install-cygwin-download-directory

Unless you are using some sort of HTTP proxy to access the internet, just leave the default option and click on the “Next” button to continue.

install-cygwin-connection-type

Here you can select the download site from which you wish to download the required packages. Unfortunately, Cygwin doesn’t provide any additional details like site location. So just select a random site and click on the “Next” button.

install-cygwin-download-source

As soon as you click on the “Next” button, Cygwin will show you all the available packages in categories. At this point, you can keep them at the default settings and click the “Next” button. If you ever want to add packages to your Cygwin installation, you can do so by running the installer as needed.

install-cygwin-packages

Now Cygwin will download all the default packages and install them. The downloading and installing may take some time depending on your Internet speed and the selected server speed.

install-cygwin-download-progress

Once the installation is complete, you can start using Cygwin by launching it using the desktop shortcut or from the start menu.

install-cygwin-working-cygwin

Alternatively, you can configure Cygwin to work with the normal Windows command prompt so you don’t have to launch Cygwin specifically. To do that, open up your Start menu, type “system” and select the option “System” in the control panel section. If you are using Windows 8, you can access the same section by pressing “Win + X” and selecting “System” from the power user menu.

install-cygwin-open-system

Click on the “Advanced System Settings” located on the left pane to open “System properties.”

install-cygwin-open-advanced-system-settings

Click on the “Environmental Variables” button.

install-cygwin-click-environment-variables

Scroll down and select the variable “path” under the “system variables” and click on the “Edit” button.

install-cygwin-select-path

Now add the below location (variable value) at the end of the line. Don’t forget to separate it using ;. If you have chosen a different installation directory while installing the Cygwin, then change the below location variable accordingly. Once you have added it, click on the “Ok” button to save the changes.

install-cygwin-add-variable-value

From this point onward, you can use Linux commands right in your regular Windows command prompt.

install-cygwin-integrated-into-command-prompt

Hopefully that helps, and do comment below if you face any difficulties while installing and configuring Cygwin.

Vamsi Krishna

Vamsi is a tech and WordPress geek who enjoys writing how-to guides and messing with his computer and software in general. When not writing for MTE, he writes for he shares tips, tricks, and lifehacks on his own blog Stugon.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Понравилась статья? Поделить с друзьями:
  • Как установить curl на windows 10
  • Как установить cudnn в windows 10
  • Как установить cubase 10 на windows 10
  • Как установить crysis 3 на windows 10 64 bit
  • Как установить cry of fear на windows 10