Is there a tool in the Cygwin package similar to apt-get
on Debian or yum
on redhat that allows me to install components from the command line?
相关问题
- softlinks atime and mtime modification
- Get unexpanded argument from bash command line
- Include and Execute EXE in C# Command Line App
- Batch - Set variables in for loop
- Rails gem update not working (version 4.1.1 to 4.2
相关文章
- Compile and build with single command line Java (L
- How to update command line output?
- How to execute another python script from your scr
- git.exe: error while loading shared libraries: ?:
- ffmpeg run from shell runs properly, but does not
- Python file keyword argument?
- Interactively merge files tracked with git and unt
- Lauch default editor (like 'webbrowser' mo
There exist some scripts, which can be used as simple package managers for Cygwin. But it’s important to know, that they always will be quite limited, because of...ehm...Windows.
Installing or removing packages is fine, each package manager for Cygwin can do that. But updating is a pain since Windows doesn’t allow you to overwrite an executable, which is currently running. So you can’t update e.g. Cygwin DLL or any package which contains the currently running executable from the Cygwin itself. There is also this note on the Cygwin Installation page:
Cygwin’s setup uses Windows registry to overwrite executables which are in use and this method requires a reboot of Windows. Therefore, it’s better to close all Cygwin processes before updating packages, so you don’t have to reboot your computer to actually apply the changes. Installation of a new package should be completely without any hassles. I don’t think any of package managers except of Cygwin’s
setup.exe
implements any method to overwrite files in use, so it would simply fail if it cannot overwrite them.Some package managers for Cygwin:
apt-cyg
Update: the repository was disabled recently due to copyright issues (DMCA takedown). It looks like the owner of the repository issued the DMCA takedown on his own repository and created a new project called Sage (see bellow).
The best one for me. Simply because it’s one of the most recent. It doesn’t use Cygwin’s
setup.exe
, it rather re-implements, whatsetup.exe
does. It works correctly for both platforms - x86 as well as x86_64. There are a lot of forks with more or less additional features. For example, the kou1okada fork is one of the improved versions, which is really great.apt-cyg is just a shell script, there is no installation. Just download it (or clone the repository), make it executable and copy it somewhere to the PATH:
There is also bunch of forks with different features.
sage
Another package manager implemented as a shell script. I didn't try it but it actually looks good.
It can search for packages in a repository, list packages in a category, check dependencies, list package files, and more. It has features which other package managers don't have.
cyg-apt
Fork of abandoned original
cyg-aptwith improvements and bugfixes. It has quite a lot of features and it's implemented in Python. Installation is made usingmake
.Chocolatey’s cyg-get
If you used Chocolatey to install Cygwin, you can install the package cyg-get, which is actually a simple wrapper around Cygwin’s
setup.exe
written in PowerShell.Cygwin’s setup.exe
It also has a command line mode. Moreover, it allows you to upgrade all installed packages at once (as
apt-get upgrade
does on Debian based Linux).Example use:
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 Vim package with:
cyg-get vim
I wanted a solution for this similar to
apt-get --print-uris
, but unfortunately apt-cyg doesn't do this. The following is a solution that allowed me to download only the packages I needed, with their dependencies, and copy them to the target for installation. Here is a bash script that parses the output ofapt-cyg
into a list of URIs:The above will print out the paths of the packages that need downloading, relative to the cygwin mirror root, omitting any packages that are already installed. To download them, I wrote the output to a file
cygwin-packages-list
and then used wget:The installer can then be used to install from a local cache directory. Note that for this to work I needed to copy
setup.ini
from a previous cygwin package cache to the directory with the downloaded files (otherwise the installer doesn't know what's what).Old question, but still relevant. Here is what worked for me today (6/26/16).
From the bash shell: