2017-07-24 88 views
3

采取的形式here - 解释如何安装apt-cyg如何为Cygwin安装apt-cyg?

Install apt-cyg

You may have heard of programs like apt-get (Ubuntu), yum/dnf (Fedora), pacman (Arch), or brew (Mac OS X)... .. .The analogous program for Cygwin is called apt-cyg.

Installing apt-cyg is simple. First, save this file: https://raw.githubusercontent.com/transcode-open/apt-cyg/master/apt-cyg . Then, use File Explorer to find the file in your Downloads folder and move it into C:\cygwin\bin. Then, open Cygwin and enter "chmod +x /bin/apt-cyg". This tells Cygwin that you want to be able to execute the apt-cyg command. Lastly, enter "apt-cyg mirror ftp://sourceware.org/pub/cygwin ". This sets up apt-cyg to use the official repository when downloading programs.

听起来很简单。但我有一个错误。

本教程没有指定使用什么名称和扩展名来保存该文件

我把它保存为apt-cyg.txt,并将其移到C:\cygwin64\bin

这是行不通的。当运行apt-cyg,我得到的错误:bad interpreter: No such file or directory

how to install apt-cyg for Cygwin? - error

我的猜测是,扩展名或文件名是坏的。我应该使用什么名字和扩展名?

这个过程还有其他步骤吗?

注意:我刚在Windows 10上安装了cygwin。请不要假设我已安装其他工具。

+0

看来你已经下载了带有CRLF行结束符的文本文件。尝试使用'd2u/bin/apt-cyg'或者下载没有扩展名的文件,并保存为文件类型'All file *。*' – matzeri

回答

5

请记住,从https://www.cygwin.com/下载的setup-x86.exesetup-x86_64.exe是安装cygwin的官方方法。如果您使用其他方法进行安装并遇到问题,您可能得不到官方支持或很少。只需使用官方的gui安装程序来安装和更新软件包。

+0

要回答你的问题,使用左键点击保存链接下载apt-cyg文件...名称为“apt-cyg”,没有扩展名。您可能需要提供分隔文件名和扩展名的点。该文件是一个bash shell脚本。使用'head apt-cyg |猫-A'。如果你在行尾看到'^ M',使用'd2u apt-cyg'将行结束符从'\ m \ n'转换为'\ n'。然后'chmod + x apt-cyg'。现在你可以执行apt-cyg了。 –

2

你安装它是这样的:

1 - 确保lynx安装

2 - 运行lynx -source rawgit.com/transcode-open/apt-cyg/master/apt-cyg > apt-cyg

3 - 运行install apt-cyg /bin

这就是它!

4

看起来好像扩展没有问题,但在脚本中有行结尾(请参阅部分^ M)。当你在几个平台上使用git并将unix结尾改为结束clrf等等的窗口时,会发生类似的情况。

考虑改变CLRF通过命令LF(除去CR):

sed -i 's/\r//g' apt-cyg 

应该有命令,没有扩展名的,所以不要将其下载到/bin后的任何扩展名添加到的apt-CYG。