pacman 패키지 삭제하기

우선.. 버전을 빼고 설치된 패키지 목록을 보기..

% pacman -Q|cut -f 1 -d " "
apr
apr-devel
apr-util
apr-util-devel
asciidoc
aspell
aspell-devel
autoconf
autoconf2.13
autogen
automake-wrapper
automake1.1
...

다음.. 의존성 걸린 패키지들까지 몽땅 삭제하기..

% pacman -Rcn mingw-w64-i686-SDL2 mingw-w64-i686-allegro mingw-w64-i686-boost mingw-w64-i686-cgal mingw-w64-i686-clblast mingw-w64-i686-doxygen mingw-w64-i686-eigen3 mingw-w64-i686-ffmpeg mingw-w64-i686-fftw mingw-w64-i686-fontconfig mingw-w64-i686-freealut mingw-w64-i686-freeimage mingw-w64-i686-ftgl mingw-w64-i686-glew mingw-w64-i686-glfw mingw-w64-i686-glm mingw-w64-i686-imagemagick mingw-w64-i686-intel-tbb mingw-w64-i686-liblas mingw-w64-i686-libmariadbclient mingw-w64-i686-libssh2 mingw-w64-i686-libzip mingw-w64-i686-magnum mingw-w64-i686-magnum-integration mingw-w64-i686-magnum-plugins mingw-w64-i686-oce mingw-w64-i686-pdcurses mingw-w64-i686-physfs mingw-w64-i686-pkg-config mingw-w64-i686-python2 mingw-w64-i686-qt-creator mingw-w64-i686-qt5 mingw-w64-i686-wxWidgets mingw-w64-i686-zeromq
checking dependencies...
:: mingw-w64-i686-harfbuzz optionally requires mingw-w64-i686-cairo: hb-view program
:: mingw-w64-i686-libde265 optionally requires mingw-w64-i686-ffmpeg: sherlock265
:: mingw-w64-i686-libde265 optionally requires mingw-w64-i686-qt5: sherlock265
warning: dependency cycle detected:
warning: mingw-w64-i686-ffms2 will be removed after its mingw-w64-i686-ffmpeg dependency

Packages (47) mingw-w64-i686-cairo-1.16.0-1  mingw-w64-i686-curl-7.69.1-2
              mingw-w64-i686-ffms2-2.23.1-1  mingw-w64-i686-flif-0.3-1
              mingw-w64-i686-gdal-3.0.4-2  mingw-w64-i686-libass-0.14.0-1
              mingw-w64-i686-libcaca-0.99.beta19-5
              mingw-w64-i686-libkml-1.3.0-8  mingw-w64-i686-netcdf-4.7.3-1
              mingw-w64-i686-poppler-0.86.1-1  mingw-w64-i686-qbs-1.15.0-1
              mingw-w64-i686-ttf-dejavu-2.37-2
              mingw-w64-i686-x264-git-r2991.1771b556-1
              mingw-w64-i686-SDL2-2.0.12-1  mingw-w64-i686-allegro-5.2.6.0-1
              mingw-w64-i686-boost-1.72.0-1  mingw-w64-i686-cgal-5.0-1
              mingw-w64-i686-clblast-1.5.1-1  mingw-w64-i686-doxygen-1.8.17-1
              mingw-w64-i686-eigen3-3.3.7-1  mingw-w64-i686-ffmpeg-4.2.2-2
              mingw-w64-i686-fftw-3.3.8-1  mingw-w64-i686-fontconfig-2.13.1-1
              mingw-w64-i686-freealut-1.1.0-1
              mingw-w64-i686-freeimage-3.18.0-3  mingw-w64-i686-ftgl-2.4.0-1
              mingw-w64-i686-glew-2.1.0-1  mingw-w64-i686-glfw-3.3.2-1
              mingw-w64-i686-glm-0.9.9.7-1
              mingw-w64-i686-imagemagick-7.0.9.17-1
              mingw-w64-i686-intel-tbb-1~2020.2-1
              mingw-w64-i686-liblas-1.8.1-1
              mingw-w64-i686-libmariadbclient-2.3.7-1
              mingw-w64-i686-libssh2-1.9.0-1  mingw-w64-i686-libzip-1.6.1-1
              mingw-w64-i686-magnum-2019.10-1
              mingw-w64-i686-magnum-integration-2019.01-2
              mingw-w64-i686-magnum-plugins-2019.10-1
              mingw-w64-i686-oce-0.18.3-3  mingw-w64-i686-pdcurses-4.1.0-3
              mingw-w64-i686-physfs-3.0.2-1  mingw-w64-i686-pkg-config-0.29.2-1
              mingw-w64-i686-python2-2.7.17-1
              mingw-w64-i686-qt-creator-4.11.1-1  mingw-w64-i686-qt5-5.14.1-3
              mingw-w64-i686-wxWidgets-3.0.4-3  mingw-w64-i686-zeromq-4.3.2-1

Total Removed Size:  2425.99 MiB

:: Do you want to remove these packages? [Y/n]
...

msys2 – gcc/g++ 업데이트 및 설치

msys2 를 처음 설치하고 아래와 같이 기본 gcc/g++ 컴파일러와 필요한 유용한 라이브러리들을 설치한다.

pacman -Syu

pacman -S base-devel
pacman -S gcc
pacman -S development
pacman -S compression

pacman -S mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain

pacman -Sy git
pacman -Sy cmake

아래와 같이 설치된 컴파일러를 확인한다.

$ pacman -Ss gcc
mingw32/mingw-w64-i686-gcc 9.1.0-3 (mingw-w64-i686-toolchain)
GNU Compiler Collection (C,C++,OpenMP) for MinGW-w64
mingw32/mingw-w64-i686-gcc-ada 9.1.0-3 (mingw-w64-i686-toolchain)
GNU Compiler Collection (Ada) for MinGW-w64
...
mingw64/mingw-w64-x86_64-gcc 9.1.0-3 (mingw-w64-x86_64-toolchain) [설치함]
GNU Compiler Collection (C,C++,OpenMP) for MinGW-w64
mingw64/mingw-w64-x86_64-gcc-ada 9.1.0-3 (mingw-w64-x86_64-toolchain) [설치함]
GNU Compiler Collection (Ada) for MinGW-w64
...
msys/mingw-w64-cross-gcc 9.1.0-1 (mingw-w64-cross-toolchain mingw-w64-cross)
Cross GCC for the MinGW-w64

내가 자주사용하는 개발 패키지들도 설치한다.

pacman -Sy mingw-w64-i686-fontconfig mingw-w64-x86_64-fontconfig
pacman -Sy mingw-w64-i686-freeimage mingw-w64-x86_64-freeimage
pacman -Sy mingw-w64-i686-gl2ps mingw-w64-x86_64-gl2ps
pacman -Sy mingw-w64-i686-freetype mingw-w64-x86_64-freetype
pacman -Sy mingw-w64-i686-libpng mingw-w64-x86_64-libpng
pacman -Sy mingw-w64-i686-libtiff mingw-w64-x86_64-libtiff

pacman -Sy mingw-w64-i686-tcl mingw-w64-x86_64-tcl
pacman -Sy mingw-w64-i686-tk mingw-w64-x86_64-tk
pacman -Sy mingw-w64-i686-python2 mingw-w64-x86_64-python2
pacman -Sy mingw-w64-i686-python3 mingw-w64-x86_64-python3

pacman -Sy mingw-w64-i686-qt-creator mingw-w64-x86_64-qt-creator
pacman -Sy mingw-w64-i686-qtbinpatcher mingw-w64-x86_64-qtbinpatcher
# dynamic 버전이 필요하면 아래를 설치..
pacman -Sy mingw-w64-i686-qt5 mingw-w64-x86_64-qt5
# static 버전이 필요하면 아래를 설치..
pacman -Sy mingw-w64-i686-qt5-static mingw-w64-x86_64-qt5-static

pacman -Sy mingw-w64-i686-mpfr mingw-w64-x86_64-mpfr
pacman -Sy mingw-w64-i686-gmp mingw-w64-x86_64-gmp

pacman -Sy mingw-w64-i686-SDL2 mingw-w64-x86_64-SDL2
pacman -Sy mingw-w64-i686-allegro mingw-w64-x86_64-allegro

pacman -Sy mingw-w64-i686-boost mingw-w64-x86_64-boost
pacman -Sy mingw-w64-i686-cgal mingw-w64-x86_64-cgal
pacman -Sy mingw-w64-i686-freeglut mingw-w64-x86_64-freeglut
pacman -Sy mingw-w64-i686-glm mingw-w64-x86_64-glm
pacman -Sy mingw-w64-i686-glfw mingw-w64-x86_64-glfw
pacman -Sy mingw-w64-i686-oce mingw-w64-x86_64-oce
pacman -Sy mingw-w64-i686-glew mingw-w64-x86_64-glew

pacman -Sy mingw-w64-i686-ffmpeg mingw-w64-x86_64-ffmpeg

pacman -Sy mingw-w64-i686-zlib mingw-w64-x86_64-zlib
pacman -Sy mingw-w64-i686-readline mingw-w64-x86_64-readline
pacman -Sy mingw-w64-i686-pdcurses mingw-w64-x86_64-pdcurses

pacman -Sy mingw-w64-i686-libmariadbclient mingw-w64-x86_64-libmariadbclient

참고로 저장소에서 제공하는 패키지는 무엇이 잇는지는 아래의 싸이트에서 검색..
https://packages.msys2.org/search?t=binpkg

만약 옛 버전을 설치 해야 하는 경우는 pacman 은 버전을 지정하여 설치를 할 수 없다.
아래의 페이지에서 옛 버전을 받아서..
http://repo.msys2.org/mingw/x86_64/
다음과 같이 설치한다.

pacman -U mingw-w64-x86_64-qt5-5.10.0-1-any.pkg.tar.xz

이미 상위 버전이 설치되어 있는 경우 자동으로 다운그레이드를 함.. 굿!!

참고로 설치된 패키지의 정보들은 아래의 폴더에 위치해있음.

/var/lib/pacman/local

또.. 다운 받아진 원본 패키지들은 아래에 있음.

/var/cache/pacman/pkg

msys2 개발 환경으로 인해서 개발이 편해지고 개발 비용도 줄일수있긴하지만..
편해진 만큼 개발자들이 게을러지지 않을까.. 생각이든다. -_-;;