본문으로 바로가기

현재 msys2의 pacman 으로 업데이트 된 gcc 버전이 문제가 많다.. (mingw-w64-x86_64-gcc-11.2.0-10)
그래서 잘 사용하던 바로 전 버전으로 다운그레이드 하고자 한다.

먼저 gcc 관련 패키지들을 전부 삭제한다..

$ pacman -Rcn mingw-w64-x86_64-gcc
checking dependencies...
 
Packages (6) mingw-w64-x86_64-gcc-ada-11.2.0-10  mingw-w64-x86_64-gcc-fortran-11.2.0-10  mingw-w64-x86_64-gcc-objc-11.2.0-10
             mingw-w64-x86_64-msmpi-10.1.1-7  mingw-w64-x86_64-uasm-2.53.r668.8f8feb7-2  mingw-w64-x86_64-gcc-11.2.0-10
 
Total Removed Size:  362.27 MiB
 
:: Do you want to remove these packages? [Y/n]
:: Processing package changes...
(1/6) removing mingw-w64-x86_64-uasm                                            [############################################] 100%
(2/6) removing mingw-w64-x86_64-msmpi                                           [############################################] 100%
(3/6) removing mingw-w64-x86_64-gcc-objc                                        [############################################] 100%
(4/6) removing mingw-w64-x86_64-gcc-fortran                                     [############################################] 100%
(5/6) removing mingw-w64-x86_64-gcc-ada                                         [############################################] 100%
(6/6) removing mingw-w64-x86_64-gcc                                             [############################################] 100%


다음 아래와 같이 캐시 폴더에 이전 버전의 패키지가 있는지 본다.

$ ls /var/cache/pacman/pkg/*gcc* | grep 11.2.0.9 | grep zst
/var/cache/pacman/pkg/mingw-w64-i686-gcc-11.2.0-9-any.pkg.tar.zst
/var/cache/pacman/pkg/mingw-w64-i686-gcc-11.2.0-9-any.pkg.tar.zst.sig
/var/cache/pacman/pkg/mingw-w64-i686-gcc-ada-11.2.0-9-any.pkg.tar.zst
/var/cache/pacman/pkg/mingw-w64-i686-gcc-ada-11.2.0-9-any.pkg.tar.zst.sig
/var/cache/pacman/pkg/mingw-w64-i686-gcc-fortran-11.2.0-9-any.pkg.tar.zst
/var/cache/pacman/pkg/mingw-w64-i686-gcc-fortran-11.2.0-9-any.pkg.tar.zst.sig
/var/cache/pacman/pkg/mingw-w64-i686-gcc-libgfortran-11.2.0-9-any.pkg.tar.zst
/var/cache/pacman/pkg/mingw-w64-i686-gcc-libgfortran-11.2.0-9-any.pkg.tar.zst.sig
/var/cache/pacman/pkg/mingw-w64-i686-gcc-libs-11.2.0-9-any.pkg.tar.zst
/var/cache/pacman/pkg/mingw-w64-i686-gcc-libs-11.2.0-9-any.pkg.tar.zst.sig
/var/cache/pacman/pkg/mingw-w64-i686-gcc-objc-11.2.0-9-any.pkg.tar.zst
/var/cache/pacman/pkg/mingw-w64-i686-gcc-objc-11.2.0-9-any.pkg.tar.zst.sig
/var/cache/pacman/pkg/mingw-w64-x86_64-gcc-11.2.0-9-any.pkg.tar.zst
/var/cache/pacman/pkg/mingw-w64-x86_64-gcc-11.2.0-9-any.pkg.tar.zst.sig
/var/cache/pacman/pkg/mingw-w64-x86_64-gcc-ada-11.2.0-9-any.pkg.tar.zst
/var/cache/pacman/pkg/mingw-w64-x86_64-gcc-ada-11.2.0-9-any.pkg.tar.zst.sig
/var/cache/pacman/pkg/mingw-w64-x86_64-gcc-fortran-11.2.0-9-any.pkg.tar.zst
/var/cache/pacman/pkg/mingw-w64-x86_64-gcc-fortran-11.2.0-9-any.pkg.tar.zst.sig
/var/cache/pacman/pkg/mingw-w64-x86_64-gcc-libgfortran-11.2.0-9-any.pkg.tar.zst
/var/cache/pacman/pkg/mingw-w64-x86_64-gcc-libgfortran-11.2.0-9-any.pkg.tar.zst.sig
/var/cache/pacman/pkg/mingw-w64-x86_64-gcc-libs-11.2.0-9-any.pkg.tar.zst
/var/cache/pacman/pkg/mingw-w64-x86_64-gcc-libs-11.2.0-9-any.pkg.tar.zst.sig
/var/cache/pacman/pkg/mingw-w64-x86_64-gcc-objc-11.2.0-9-any.pkg.tar.zst
/var/cache/pacman/pkg/mingw-w64-x86_64-gcc-objc-11.2.0-9-any.pkg.tar.zst.sig


이제 sig 파일은 빼고 전부 설치한다.

$ pacman -U /var/cache/pacman/pkg/mingw-w64-x86_64-gcc-11.2.0-9-any.pkg.tar.zst /var/cache/pacman/pkg/mingw-w64-x86_64-gcc-ada-11.2.0-9-any.pkg.tar.zst /var/cache/pacman/pkg/mingw-w64-x86_64-gcc-fortran-11.2.0-9-any.pkg.tar.zst /var/cache/pacman/pkg/mingw-w64-x86_64-gcc-libgfortran-11.2.0-9-any.pkg.tar.zst /var/cache/pacman/pkg/mingw-w64-x86_64-gcc-libs-11.2.0-9-any.pkg.tar.zst /var/cache/pacman/pkg/mingw-w64-x86_64-gcc-objc-11.2.0-9-any.pkg.tar.zst
loading packages...
warning: mingw-w64-x86_64-gcc-libgfortran-11.2.0-9 is up to date -- reinstalling
warning: mingw-w64-x86_64-gcc-libs-11.2.0-9 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...
 
Packages (6) mingw-w64-x86_64-gcc-11.2.0-9  mingw-w64-x86_64-gcc-ada-11.2.0-9  mingw-w64-x86_64-gcc-fortran-11.2.0-9
             mingw-w64-x86_64-gcc-libgfortran-11.2.0-9  mingw-w64-x86_64-gcc-libs-11.2.0-9  mingw-w64-x86_64-gcc-objc-11.2.0-9
 
Total Installed Size:  382.68 MiB
Net Upgrade Size:      377.13 MiB
 
:: Proceed with installation? [Y/n]
(6/6) checking keys in keyring                                                  [############################################] 100%
(6/6) checking package integrity                                                [############################################] 100%
(6/6) loading package files                                                     [############################################] 100%
(6/6) checking for file conflicts                                               [############################################] 100%
(6/6) checking available disk space                                             [############################################] 100%
:: Processing package changes...
(1/6) reinstalling mingw-w64-x86_64-gcc-libs                                    [############################################] 100%
(2/6) installing mingw-w64-x86_64-gcc                                           [############################################] 100%
(3/6) installing mingw-w64-x86_64-gcc-ada                                       [############################################] 100%
(4/6) reinstalling mingw-w64-x86_64-gcc-libgfortran                             [############################################] 100%
(5/6) installing mingw-w64-x86_64-gcc-fortran                                   [############################################] 100%
(6/6) installing mingw-w64-x86_64-gcc-objc                                      [############################################] 100%