Install Cygwin

xiaoxiao2021-03-06  40

Install Cygwin

What's cygwin?

Building a UNIX environment on a Windows job system, performing UNIX instructions and a wide range of applications.

Cygwin installation method

Cygwin has two installation methods, the first is to install from the Internet, the second is from the local disk installation. No matter where you use that way, you need to get the setup.exe installation program. Please since the Cygwin website http: // Cygwin.com or nearly Mirror Site, download Setup.exe.

file

File name

use

Setup.execygwin's setup program

If you want to install from a local disk, you must download the Cygwin installation kit from the Cygwin's website http://cygwin.com or near Mirror Site.

file

File name

use

Latestcygwin installation kit

Setup.exe has the function of downloading the Cygwin installation kit, but with other FTP programs downloaded from Mirror Site, it may be more convenient. In addition to the more GNU Utilities, Cygwin has RPM packaging applications, please self-Cygwin-rpm This http://cygwin-rpm.sourceforge.net is downloaded in accordance with the functional requirements.

file

File name

use

Cygwin-rpmcygwin's RPM Suite

For convenience, I have done the following hypothesis

Assume

project

content

Cygwin Directoryd: / cygwinLocal Package Directoryc: / tmp / cygwinCygwin RPM Package Directoryc: / tmp / cygwin-rpmWindows Directoryc: / Windows (Windows 95/98 / Me) c: / WinNT (Windows NT / 2K) Windows System Directoryc: / Windows / System (Windows 95/98 / ME) C: / Winnt / System32 (Windows NT / 2K)

Install Cygwin from Internet

If you have a high-speed Internet connection, you can consider this method, otherwise you don't recommend using the execution setup.exe

CYGWIN SETUP screen, press the NEXT. CYGWIN SETUP screen, select Install from Internet, press Next. Local Package Directory screen, enter C: / TMP / Cygwin, press Next. Cygwin Setup screen, Select Install Root Directory field input D: / cygwin , The default text file type field selection unix, the install for field selection all, press Next. Cygwin Setup screen, select the download method

Use IE5 settings: If you have IE5, you can choose this, press Next. Direct Connection: If you have a connection to the Internet, you can choose this. Use http / ftp proxy: If you have to pass proxy to access to the Internet, It is necessary to use this. You must fill in the proxy's FQDN or IP Address and Port Number. Cygwin Setup screen, show Downloading ... mirrors.lst, indicating that the mirror list. Cygwin Setup screen, Select Download Site, please Select the downloaded website, press Next, Cygwin Setup screen, display Download ... setup.ini, indicating that you are getting the installation information. Cygwin setup screen, Select Packages to install, select the required suite download, press Next. Cygwin Setup screen , Download ... xxx.tar.gz, indicating that the installation kit is being acquired. Cygwin setup screen, installing / uninstalling / upgrading ... xxx.tar.gz, indicating in the installation kit. Cygwin setup screen, Create Desktop icon column Bit tick, add to start menu field tick, press Next. Cygwin Setup screen, installation completion, indicating that the installation is complete, press OK. Setup.exe will generate the Latest directory in C: / TMP / Cygwin, and each layer is Directory and file of the kit. Execute Setup.exe Download Cygwin Installation Suite

If you have a high-speed Internet connection, you can consider this method, otherwise you don't recommend using the execution setup.exe

CYGWIN SETUP screen, press Next, Cygwin Setup screen, select Download from Internet, press Next. Local Package Directory screen, enter C: / TMP / CYGWIN, press Next. Cygwin Setup screen, select the download method

Use IE5 settings: If you have IE5, you can choose this, press Next. Direct Connection: If you have a connection to the Internet, you can choose this. Use http / ftp proxy: If you have to pass proxy to access to the Internet, It is necessary to use this. You must fill in the proxy's FQDN or IP Address and Port Number. Cygwin Setup screen, show Downloading ... mirrors.lst, indicating that the mirror list. Cygwin Setup screen, Select Download Site, please Select the downloaded website, press Next, Cygwin Setup screen, display Download ... setup.ini, indicating that you are getting the installation information. Cygwin setup screen, Select Packages to install, select the required suite download, press Next. Cygwin Setup screen , Downloading ... xxx.tar.gz, indicating that the installation kit is getting the installation kit. The Download Complete appears, and the download is complete, press OK. Setup.exe will generate the LateSt directory in C: / TMP / Cygwin, the lower layer There are directory and files of each kit.

Download Cygwin Installation Suite with other FTP

The general user recommends using this method commonly used free FTP program with links such as LeechFTP to one of the following URLs, get the CYGWIN installation kit, placed in a C: / TMP / Cygwin directory. Profile

Website

use

Cygwin.com ftp.Freesoftware.com ftp.nas.nasa.gov ftp1.sinica.edu.twcygwin installation kit

Install Cygwin from a local disk

The general user recommends using this method to perform setup.exe

CYGWIN SETUP screen, press Next. Cygwin Setup screen, select Install from Local Directory, press Next. Local Package Directory screen, enter C: / TMP / Cygwin, press Next. Cygwin Setup screen, Select Install root Directory field input D: / Cygwin, default text file type selection Unix, install for field selection all, press Next. Cygwin Setup screen, select the download method

Use IE5 settings: If you have IE5, you can choose this, press Next. Direct Connection: If you have a connection to the Internet, you can choose this. Use http / ftp proxy: If you have to pass proxy to access to the Internet, It is necessary to use this. You must fill in the proxy's FQDN or IP Address and Port Number. Cygwin Setup screen, show Downloading ... mirrors.lst, indicating that the mirror list. Cygwin Setup screen, Select Download Site, please Select the downloaded website, press Next, Cygwin Setup screen, display Download ... setup.ini, indicating that you are getting the installation information. Cygwin setup screen, Select Packages to install, select the required suite download, press Next. Cygwin Setup screen , Download ... xxx.tar.gz, indicating that the installation kit is being acquired. Cygwin setup screen, installing / uninstalling / upgrading ... xxx.tar.gz, indicating in the installation kit. Cygwin setup screen, Create Desktop icon column Bit tick, add to start menu field tick, press Next. CYGWIN SETUP screen, installation completion, indicating that the installation is complete, press OK.

Test Cygwin

Click on the Cygwin icon, or execute according to the following steps.

The start program set The Cygnus Solutions Cygwin Bash Shell screen will perform the Bash window, and all Cygwin instructions must be entered by this window. Execution

Whoami

Will print your account on Windows. Execution

Uname -a

Cygwin version information will be printed.

Echo $ PATH

The execution program is printed.

PWD

Will print the current directory location, if the / home / account appears, it is your personal directory location. Execution

CD /

You will switch the current directory to the root directory. Cygwin's root directory is Windows D: / Cygwin directory, don't make a mistake. Cygwin's directory format is the same as UNIX, with / as a separator symbol.

LS

The current content of the current directory will be printed.

CD

Will switch the current directory to your personal directory. Execution

PS AX

Process List will be printed, you can see what processs are executing, of which

Process List

Bar Description PidProcess IDPIDParent Process IDPGIDPROCESS Group IDWINPIDWINDOWS Process IDTTY Terminal number UIDUSER IDSTIMEPROCESS Start TimeCommand executes command Press Control-D or execution

Exit

Will end the Bash window.

Install CYGWIN RPM Suite

Turn on the Bash window. Install the RPM program. Before installing the RPM suite, you must install the RPM program first.

carried out

EXPORT A =

/ cygdrive / c / tmp / cygwin-rpm

There is an environment variable A in the directory location of Cygwin-RPM, pay attention to = no blank before and after. Execution

CD /

Switch to the root directory. Execution

TAR ZXVF $ A / RPM / RPM-X.x.x-x.tar.gz

Unzip the RPM program. Execute

RPM --Version

The RPM version is printed.

RPM -QA

The installed RPM kit is printed, and now you should be blank. Install the RPM kit. There are many suits available, please select the need to install, for example.

carried out

CD $ A / PACKAGES

Switch to the RPM Suite Directory. Install the Perl program language, execute

RPM-IVH - IGNOREOS - Nodeps Perl / Perl-X.x-x.i386-Cygwin.rpm

Install the NCURSES Terminal Control Certificate, Execution

RPM-IVH --IGNOREOS NCURS / NCURS-X.X-X.I386-Cygwin.rpm

Install the Readline program library, execute

RPM-IVH --IGNOREOS Readline / Readline-x.x-x.i386-cygwin.rpm

Install NCFTP FTP program, execution

RPM-IVH --IGNOREOS NCFTP / NCFTP-X.X-X.I386-Cygwin.rpm

Install MC Midnight Commander file management program, execution

RPM-IVH --IGNOREOS MC / MC-X.X-X.I386-Cygwin.rpm

Install the Lynx text mode network browser, execution

RPM-IVH --IGNOREOS LYNX / LYNX-X.X-X.I386-Cygwin.rpm

Install zip / unzip compression / decompression process, execution

RPM-IVH --IGNOREOS ZIP / ZIP-X.X-X.I386-Cygwin.rpm

RPM -IVH --IGNOREOS UNZIP / UNZIP-X.X-X.I386-Cygwin.rpm

Install wget network grabber program, execution

RPM-IVH --IGNOREOS WGET / WGET-X.X-X.I386-Cygwin.rpm

Press Control-D or execution

Exit

End the Bash window.

Archive system

Cygwin's archive system is basically similar to general Unix, starting with / root directory, divided into different catalogs, different disks hanging on different directories. No disk numbers, Windows C: Disc hanging in / cygdrive / C Directory, Windows D: Disc Hang in / CygDrive / D Directory, so on.

Concept of account

Windows 95/98 / me account

Without multiple users, Cygwin has only one user, that is, the user account library currently logged in to Windows is the same as UNIX, ie / etc / passwd is the user data file, / etc / group is group data file. Cygwin Without an account management program, you must manually manage these data file user data file / etc / passwd each line of one user, its format is as follows

Account: Password: Uid: GID: Gecos: Directory: shell

The columns describe the following table:

/ etc / passwd format

Field

Description

Account user name, 8 lowercase character PasswordDes encoded password, please write a crypt code in the BASH window, then copy the DES password to this field UID user code, 0 is root, 1 ~ 99 to the system Use, 100 ~ 999 to use the application system, 1000 ~ 29999 gives the general user with GID primary group code, allocation method and UID the same GECOS user description, Name / Phone / etc ... Directory user's directory, general Set as / Home / Account Name Shell user's shell, usually login users set to / bin / bash, can not log in to the user set to / bin / NOLOGIN group data file / etc / group each line of each line Group, its format is as follows

/ etc / group format

The column will illustrate the group name of the group_name group, the lowercase of the lowercase, the password of the user, which is not used, can blank GID group code, allocation method and UID the same USER_LIST user name list, with a comma separated by different uses By

Windows NT / 2K account

Cygwin can have multiple users and groups that keep blank with Windows's same Password field. Cygwin automatically uses Windows passwords to perform the following instructions from the Windows account to generate Cygwin / etc / passwd

Mkpasswd -l> / etc / passwd

Execute the following instructions from the Windows account to generate Cygwin / etc / passwd from the Windows account

Mkpasswd -g> / etc / group

Please remember to delete the line of Guest in the file, otherwise it may be inexplicably logged in, then ~! @ # $% $

Software

You can perform Windows software, which is the same as that of Windows. You can perform many UNIX software, this is the purpose of using Cygwin, otherwise why you want to compile and execute on Cygwin.

inetd, Internet Super Server

inetd is a server server server that can control many servo software, so it is called Super Server. Use inetd, the job system can automatically start the required servo software, saving the standby servo software resources. Due to a part of inetd The function is similar to Windows NT / 2K Simple TCP / IP Protocol, so if you want to execute inetd on Windows NT / 2K, you may have to deactivate SIMPLE TCP / IP Protocol, otherwise it will be twisted. Support INETD server software In / usr / sbin directory, the file has been in front of the file. * The execution file is probably, and there are FTP and Telnet, which is commonly used. Open the Bash window to make subsequent setting INETD to use the network protocol / etc / ETC / Protocols records the number and code of various network protocols.

Execute the following instructions from Windows from Windows Cygwin in the Bash Window

CP -P / Cygdrive /

C / Windows / Protocol / etc / procotols

inetd uses network service file / etc / protocols, records the number and code of various network services.

Execute the following instructions from Windows from Windows Cygwin in the Bash Window

CP -P / Cygdrive /

C / Windows / Services / etc / services

The setup file of inetd is /etc/inetd.conf, and the settings to start those services, and the permissions that can be used.

You can get a template from a general UNIX host, of course, can also be generated with a text editor, and its content is as follows:

#

# #

# Echo, discard, daytime, and chargen is used primrily for testing.

#

Echo Street TCP NOWAIT ROOT INTERNAL

Echo Dgram Udp WAIT ROOT INTERNAL

Discard Stream TCP NOWAIT ROOT INTERNAL

Discard Dgram Udp Wait Root Internal

Daytime Street TCP NOWAIT ROOT Internal

Daytime Dgram UDP WAIT ROOT INTERNAL

Chargen Stream TCP NOWAIT ROOT Internal

Chargen Dgram Udp Wait Root Internal

Time Street TCP NOWAIT ROOT INTERNAL

Time Dgram UDP WAIT ROOT INTERNAL

#

# Tse Cene Standard Services.

#

FTP stream tcp noait root /usr/sbin/in.ftpd ftpd

Telnet Stream TCP NOWAIT ROOT /USR/SBIN/IN.TELNETD TELNETD

Start and stop inetd

Start inetd, please execute on the BASH window

/ usr / sbin / inetd

Inetd becomes a program executed on the background. You can execute

PS AX

See if inetd is executing. You can do

Kill PID

Stop inetd. Inetd's internal service

The echo service is recovered. Test Echo service, please execute it on the Bash window

Telnet Localhost Echo

Then enter a string at will, press Enter, you can see the string of the just entered on the screen. To stop the test, press Control-], press Enter, then enter the Quit Directive. Discard Service Discard Received String. Test Discard service, please execute on the Bash window

Telnet Localhost Discard

Then enter a string at will, press Enter, no message is printed on the screen. To stop the test, press Control-], press Enter, then enter the Quit Directive. DateTime Service Broken String String Format Time. Test the Daytime service, please execute on the Bash window

Telnet Localhost Daytime

You can see the date and time on the screen. Chargen service back to the ASCII character table. Test Chargen service, please execute it on the Bash window

Telnet Localhost Chargen

You can see a lot of ASCII character on the screen. To stop the test, press Control-C, press Control-], press Enter, then enter the Quit Directive. TIME Service Retrieves the binary Unix Time System Services of Stamp. Windows NT / 2K

Execute the following instructions in the BASH window to register inetd as service

/ usr / sbin / inetd --install-as-service

Execute the following instructions in the BASH window to cancel registration

/ usr / sbin / inetd --Remove-as-service

Execute the following instructions in the BASH window to start inetd service

Net Start inetd

Execute the following instructions in the BASH window to stop inetd service

NET STOP inetd

Telnetd, Telnet daemon

Telnet deamon on UNIX can accept the Telnet terminal connection to reach the remote management. Unfortunately, in Windows to Win 2K to attach Telnet Service, which is very difficult. Telnet Daemon included in Cygwin Replenishing the shortcoming of the Windows system. Please create an account database first, and start inetd, and then perform Telnet localhost to try Cygwin's Telnet deamon on a Windows NT / 2K system.

Telnet window appears

Cygwin_nt-x.x x.x.x (xxxxx) (TTYX)

Login:

Please enter the user name, press ENTER, etc.

PASSWORD:

Please enter your password, press Enter, then Bash Prompt. Congratulations! You have already telnet login in the Windows system! On the Windows 95/98 / ME system

Telnet window does not appear login:, and directly appear

PASSWORD:

This time the user is Windows user, you can enter Password directly to log in, or press ENTER directly

Login incorrect

Login:

The following steps are the same as the Windows NT / 2K because Windows 95/98 / ME is a single user's system. No matter what the user name login, the actual user is now Windows users, please pay special attention

Syslogd, System Logger deamon

Syslogd will write records to c: /cygwin_syslog.txt, you can see what is going on.

转载请注明原文地址:https://www.9cbs.com/read-76193.html

New Post(0)