msys2 安装笔记(可以按照这个关键字搜索)
2017-03-14 02:07
399 查看
以前一直在用 msys,最近发现还有个 msys2,并且msys2 配套的编译器是MinGW-w64。 就试着用了用,感觉还不错,这里把安装过程记录一下。
简单的说,MSYS2 是MSYS的一个升级版, 提供了bash shell, Autotools, 版本控制软件和MinGW-w64 工具链。与MSYS最大的区别是移植了 Arch Linux的软件包管理系统 Pacman。有了 Pacman 升级系统,安装新软件包,还有解决软件包间的依赖问题就变得简单多了。
可以在这里查看MSYS2包括了哪些软件包:
https://github.com/Alexpux/MSYS2-packages
http://sourceforge.net/projects/msys2/
首先下载安装文件,我的系统是32位的,所以下载32位的安装包:
msys2-i686-20140910.exe
msys2 要求安装目录只能有 ascii 字符并且不能有空格。我选择安装在:
C:/msys32
这样安装完后只有最基本的系统,没有gcc开发环境。运行如下命令可以打开一个bash shell:
msys2_shell.bat
剩下的工作都在这个bash shell下进行。
msys2 移植了Arch Linux 上的软件包管理系统 Pacman,有了包管理系统,升级、安装新的软件就很简单了。 不过我一直在用redhat 系的linux,没有接触过 Pacman,学习新命令还是花了些时间。这里把一些常见的Pacman命令记录一下。
pacman -S --refresh
可以缩写为:pacman -Sy
然后升级软件包:
pacman -S --refresh --sysupgrade
可以缩写为:pacman -Syu
这里需要特别注意,不能写为:
pacman -Su
给出的理由如下,我水平太低,没完全理解是啥意思:
because all MSYS2 programs share the same address space for DLLs due to how MSYS2 (well, Cygwin) implements 'fork', and because any Pacman package (both MSYS2 and MinGW-w64 ones) may use MSYS2's bash to run a post-install script, issuing this command can cause these scripts to fail to run should any updated, core MSYS2 DLLs end up in a different location to where they were. For this reason, the safest procedure for updating MSYS2 is to do it in two stages;
首先更新MSYS2核心程序包:
pacman -S --needed filesystem msys2-runtime bash libreadline libiconv libarchive libgpgme libcurl pacman ncurses libintl
如果这一步更新了一些软件包,那么就需要关闭 msys2 然后再重新运行如下两个批处理文件:
autorebase.bat
msys2_shell.bat
否则更新其他软件包是会报错。(看来MSYS2 还是有点弱,希望以后能够把这个问题改好了)
之后就可以用:
pacman -Su
更新系统的其他软件包了。
或者
pacman -Q -e
比如我要安装 gcc。那么执行:
pacman -S gcc
然后按照提示安装就可以了。
pacman -Ss <name_pattern>
比如我想安装gcc相关的软件,那么可以这样搜索
pacman -Ss gcc
pacman -Q --groups
可以列出所有的软件组,在我这里执行的结果如下:
base bash
base bash-completion
base bsdcpio
base bsdtar
base bzip2
base catgets
base coreutils
base crypt
base curl
base dash
base file
base filesystem
base findutils
base flex
base gawk
base gcc-libs
base getopt
base grep
base gzip
base less
base lndir
base man-db
base mintty
base msys2-runtime
base ncurses
base pacman
base pacman-mirrors
base pkgfile
base rebase
base sed
base texinfo
base tzcode
base which
msys2-devel binutils
msys2-devel gcc
msys2-devel msys2-w32api-headers
msys2-devel msys2-w32api-runtime
compression bzip2
compression gzip
compression liblzo2
compression xz
libraries cloog
libraries gmp
libraries heimdal-libs
libraries icu
libraries isl
libraries libarchive
libraries libasprintf
libraries libbz2
libraries libcares
libraries libcatgets
libraries libcrypt
libraries libcurl
libraries libdb
libraries libexpat
libraries libffi
libraries libgdbm
libraries libgettextpo
libraries libgpg-error
libraries libgpgme
libraries libiconv
libraries libidn
libraries libintl
libraries liblzma
libraries liblzo2
libraries libmetalink
libraries libnettle
libraries libopenssl
libraries libp11-kit
libraries libpcre
libraries libpipeline
libraries libreadline
libraries libsqlite
libraries libssh2
libraries libtasn1
libraries libxml2
libraries mpc
libraries mpfr
libraries zlib
Database db
Database gdbm
base-devel file
base-devel flex
base-devel gawk
base-devel gettext
base-devel grep
base-devel groff
base-devel m4
base-devel pacman
base-devel perl
base-devel pkgfile
base-devel sed
base-devel texinfo
MSYS2-devel msys2-runtime-devel
http://blog.csdn.net/liyuanbhu/article/details/39397931
简单的说,MSYS2 是MSYS的一个升级版, 提供了bash shell, Autotools, 版本控制软件和MinGW-w64 工具链。与MSYS最大的区别是移植了 Arch Linux的软件包管理系统 Pacman。有了 Pacman 升级系统,安装新软件包,还有解决软件包间的依赖问题就变得简单多了。
可以在这里查看MSYS2包括了哪些软件包:
https://github.com/Alexpux/MSYS2-packages
安装
msys2 的主页地址:http://sourceforge.net/projects/msys2/
首先下载安装文件,我的系统是32位的,所以下载32位的安装包:
msys2-i686-20140910.exe
msys2 要求安装目录只能有 ascii 字符并且不能有空格。我选择安装在:
C:/msys32
这样安装完后只有最基本的系统,没有gcc开发环境。运行如下命令可以打开一个bash shell:
msys2_shell.bat
剩下的工作都在这个bash shell下进行。
msys2 移植了Arch Linux 上的软件包管理系统 Pacman,有了包管理系统,升级、安装新的软件就很简单了。 不过我一直在用redhat 系的linux,没有接触过 Pacman,学习新命令还是花了些时间。这里把一些常见的Pacman命令记录一下。
更新本地软件包
更新本地软件包数据库:pacman -S --refresh
可以缩写为:pacman -Sy
然后升级软件包:
pacman -S --refresh --sysupgrade
可以缩写为:pacman -Syu
这里需要特别注意,不能写为:
pacman -Su
给出的理由如下,我水平太低,没完全理解是啥意思:
because all MSYS2 programs share the same address space for DLLs due to how MSYS2 (well, Cygwin) implements 'fork', and because any Pacman package (both MSYS2 and MinGW-w64 ones) may use MSYS2's bash to run a post-install script, issuing this command can cause these scripts to fail to run should any updated, core MSYS2 DLLs end up in a different location to where they were. For this reason, the safest procedure for updating MSYS2 is to do it in two stages;
首先更新MSYS2核心程序包:
pacman -S --needed filesystem msys2-runtime bash libreadline libiconv libarchive libgpgme libcurl pacman ncurses libintl
如果这一步更新了一些软件包,那么就需要关闭 msys2 然后再重新运行如下两个批处理文件:
autorebase.bat
msys2_shell.bat
否则更新其他软件包是会报错。(看来MSYS2 还是有点弱,希望以后能够把这个问题改好了)
之后就可以用:
pacman -Su
更新系统的其他软件包了。
列出所有安装了的软件
pacman -Q --explicit或者
pacman -Q -e
安装新的软件包
pacman -S <package_names|package_groups>比如我要安装 gcc。那么执行:
pacman -S gcc
然后按照提示安装就可以了。
搜索软件包
很多时候,我们不知道要按照的软件的准确名称,这时就要先查询软件包的名称。pacman -Ss <name_pattern>
比如我想安装gcc相关的软件,那么可以这样搜索
pacman -Ss gcc
pacman -Q --groups
可以列出所有的软件组,在我这里执行的结果如下:
base bash
base bash-completion
base bsdcpio
base bsdtar
base bzip2
base catgets
base coreutils
base crypt
base curl
base dash
base file
base filesystem
base findutils
base flex
base gawk
base gcc-libs
base getopt
base grep
base gzip
base less
base lndir
base man-db
base mintty
base msys2-runtime
base ncurses
base pacman
base pacman-mirrors
base pkgfile
base rebase
base sed
base texinfo
base tzcode
base which
msys2-devel binutils
msys2-devel gcc
msys2-devel msys2-w32api-headers
msys2-devel msys2-w32api-runtime
compression bzip2
compression gzip
compression liblzo2
compression xz
libraries cloog
libraries gmp
libraries heimdal-libs
libraries icu
libraries isl
libraries libarchive
libraries libasprintf
libraries libbz2
libraries libcares
libraries libcatgets
libraries libcrypt
libraries libcurl
libraries libdb
libraries libexpat
libraries libffi
libraries libgdbm
libraries libgettextpo
libraries libgpg-error
libraries libgpgme
libraries libiconv
libraries libidn
libraries libintl
libraries liblzma
libraries liblzo2
libraries libmetalink
libraries libnettle
libraries libopenssl
libraries libp11-kit
libraries libpcre
libraries libpipeline
libraries libreadline
libraries libsqlite
libraries libssh2
libraries libtasn1
libraries libxml2
libraries mpc
libraries mpfr
libraries zlib
Database db
Database gdbm
base-devel file
base-devel flex
base-devel gawk
base-devel gettext
base-devel grep
base-devel groff
base-devel m4
base-devel pacman
base-devel perl
base-devel pkgfile
base-devel sed
base-devel texinfo
MSYS2-devel msys2-runtime-devel
删除一个软件包
pacman -R <package_names|package_groups>http://blog.csdn.net/liyuanbhu/article/details/39397931
相关文章推荐
- 这个网站可以搜索过期的域名:http://www.dotcenter.com/
- libcurl在vc6下的安装(这个狂赞的,按照以下步骤使用libcurl绝对没有问题)
- 花生壳域名解析更新代码(C#),不想安装花生壳客户端的可以用这个
- 注意IAR的关键字,这个可以简化程序
- msys2 安装笔记
- 用yahoo搜索一下工大后院竟然可以找到这个blog
- 【Mac技巧】mac自带的safari游览器默认百度可以输入关键字无法正常搜索了
- 介绍一个在线的Linux,没有安装Linux或者虚拟机不喜欢用的童鞋可以简单的用这个jslinux测试各种命令
- 谷歌面试题:给定一个数据流,其中包含无穷尽的搜索关键字(比如,人们在谷歌搜索时不断输入的关键字) 。如何才能从这个无穷尽的流中随机的选取 1000 个关键字?
- myeclipse10.0 安装svn 插件步骤 不是TortoiseSVN服务器安装哦(当然这个也可以百度到)
- 不用安装也能运行linux,硬盘上有一个还可以运行这个。没有的也可以运行这个
- XenServer没有自己的文件系统,也就没有自己的ISO Libery,给我们创建虚拟机带来了不少困扰,使用正文这个方法可以不用先安装FileServer
- c#实验笔记- params关键字可以指定可变数目的变量 for循环可以初始化多个参数
- 源码搜索。缺少的函数可以在这个搜索引擎上找到~
- 我的php学习笔记(三十七) PHP站内搜索:多关键字、加亮显示
- 〔转帖〕 在windows命令行将Subversion 安装为windows的服务 〔不需要第三方工具了,安装卸载其他服务也可以用这个命令 sc〕
- 批处理安装JDK等文件,这里只是写了一个JDK的,其他的按照相同原理写就可以了
- 图片分享公司Flickr更新了其IOS应用,用户可以对自己上传的图片添加标签,描述和搜索关键字
- msys2 安装笔记
- 1 Lucene笔记(一):创建索引库、根据关键字搜索