apt-get for Cygwin?

后端 未结 7 1361
说谎
说谎 2020-12-22 15:30

Is there any apt-get-like program for use with Cygwin?

I already tried cyg-apt but when I try I get this error:

cyg-apt: do         


        
相关标签:
7条回答
  • 2020-12-22 15:37

    No. The only officially supported tool for downloading and updating Cygwin packages is the setup.exe file you used for the initial install, although that can be invoked with command line arguments to help the process.

    From that same 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.

    0 讨论(0)
  • 2020-12-22 15:38

    Update: you can read the more complex answer, which contains more methods and information.

    There exists a couple of scripts, which can be used as simple package managers. But as far as I know, none of them allows you to upgrade packages, because it’s not an easy task on Windows since there is not possible to overwrite files in use. So you have to close all Cygwin instances first and then you can use Cygwin’s native setup.exe (which itself does the upgrade via “replace after reboot” method, when files are in use).


    apt-cyg

    The best one for me. Simply because it’s one of the most recent. It works correctly for both platforms - x86 and x86_64. There exists a lot of forks with some additional features. For example the kou1okada fork is one of improved versions.


    Cygwin’s setup.exe

    It has also command line mode. Moreover it allows you to upgrade all installed packages at once.

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

    Example use:

    setup.exe-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 the Vim package with:

    cyg-get vim

    0 讨论(0)
  • 2020-12-22 15:46

    Best I have ever used:

    apt-cyg package manager

    0 讨论(0)
  • 2020-12-22 15:51

    You can do this using Cygwin’s setup.exe from Windows command line. Example:

    cd C:\cygwin64
    setup-x86_64 -q -P wget,tar,qawk,bzip2,subversion,vim
    

    For a more convenient installer, you may want to use the apt-cyg 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 rawgit.com/transcode-open/apt-cyg/master/apt-cyg
    install apt-cyg /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
    
    0 讨论(0)
  • 2020-12-22 15:52

    This got it working for me:

    curl https://raw.githubusercontent.com/transcode-open/apt-cyg/master/apt-cyg > \
    apt-cyg && install apt-cyg /bin
    
    0 讨论(0)
  • 2020-12-22 16:00

    You can use Chocolatey to install cyg-get and then install your packages with it.

    For example:

    choco install cyg-get
    

    Then:

    cyg-get install my-package
    
    0 讨论(0)
提交回复
热议问题