Msys2 Installation notes

Source: Internet
Author: User
Tags arch linux

Msys has been used before, and recently found there is a msys2, and msys2 supporting compiler is MinGW-w64. I tried to use it. It feels pretty good. Here I will record the installation process.

To put it simply, msys2 is an upgraded version of msys that provides bash shell, autotools, versioning software, and MinGW-w64 tool chains. The biggest difference with msys is that the software package management system Pacman of arch Linux is transplanted. It is much easier to upgrade the system with pacman, install new software packages, and solve the dependency problem between software packages.

Here you can view the software packages included in msys2:

Https://github.com/Alexpux/MSYS2-packages

Install

Home address of msys2:

Http://sourceforge.net/projects/msys2/

 

First download the installation file. My system is 32-bit, so download the 32-bit installation package:

Msys2-i686-20140910.exe

 

Msys2 requires that the installation directory contain only ASCII characters and no spaces. I chose to install it on:

C:/msys32

In this way, only the most basic system is installed without the GCC development environment. Run the following command to open a bash shell:

Msys2_shell.bat

The rest of the work is done in this bash shell.

Msys2 has transplanted the software package management system Pacman on arch Linux. With the package management system, it is easy to upgrade and install new software. However, I have been using Linux in the RedHat system and have never been familiar with Pacman. It takes some time to learn new commands. Here we record some common Pacman commands.

Update local software package

Update the local software package database:

Pacman-s -- refresh

It can be abbreviated as Pacman-Sy.

Then upgrade the software package:

Pacman-s -- refresh -- sysupgrade

It can be abbreviated as Pacman-syu.

 

Note:

Pacman-su

The reasons are as follows:

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 shoshould 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;

First, update the msys2 core package:

Pacman-s -- needed filesystem msys2-runtime bash libreadline libiconv libarchive libgpgme libcurl Pacman ncurses libintl

 

If some software packages are updated in this step, you need to disable msys2 and re-run the following two batch files:

Autorebase. bat

Msys2_shell.bat

Otherwise, an error is returned when other software packages are updated. (It seems that msys2 is still a little weak. I hope this problem can be changed in the future)

Then you can use:

Pacman-su

Update other software packages of the system.

List all installed software

Pacman-Q -- explicit

Or

Pacman-Q-e

Install a new software package

Pacman-S <package_names | package_groups>

For example, I want to install GCC. Then execute:

Pacman-s gcc

Then follow the prompts to install it.

Search for software packages

Most of the time, we do not know the exact name of the software to be followed. In this case, we need to first query the name of the software package.

Pacman-SS <name_pattern>

 

For example, if you want to install software related to GCC, you can search

Pacman-SS gcc

 

Pacman-Q -- Groups

All the software groups can be listed. The result is as follows:

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 Z

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 MCM

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

 

Delete a software package

Pacman-r <package_names | package_groups>


Msys2 Installation notes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.