또 한번 뻘짓. build-essential, 그리고 libc6/libc6-dev.

이 모든 문제는 nnn 으로부터 비롯됐다. nnn 은 mc 와는 달리, 복사/이동 등등 명령을 외부 명령어(cp, mv 등)에 의존하고 있다. 따라서, 복사 진행 과정을 볼 수가 없다. 파일이 작으면 전혀 문제될 게 없지만, 그렇지 않을 땐 꽤 불편하고, 살짝 불안(?)하기까지 할 때도 있다.

이를 해결하고자, 제작자는 다소 격한(?) 방법을 제안했는데..
cp, mv 를 살짝 바꿔서(patch), 진행 상황을 볼 수 있게 개조해버렸다. 이름하여 Advanced CP, MV(advcpmv).

이 작업을 하려면, 우분투 기준 build-essential 이 필요하다. 설치돼 있나 확인해보니 없어서, 명령을 내렸는데..

$ sudo apt install build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 build-essential : Depends: libc6-dev but it is not going to be installed or
                            libc-dev
                   Depends: g++ (>= 4:9.2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

그렇다면 그걸 설치해주면 되겠지 생각했으나! 뭔가가 꼬여버렸는지 계속 설치가 되지 않았다.

$ apt-cache policy libc6-dev
libc6-dev:
  Installed: (none)
  Candidate: 2.31-0ubuntu9.9
  Version table:
     2.31-0ubuntu9.9 500
        500 https://linux.yz.yamagata-u.ac.jp/ubuntu focal-updates/main amd64 Packages
     2.31-0ubuntu9.7 500
        500 https://linux.yz.yamagata-u.ac.jp/ubuntu focal-security/main amd64 Packages
     2.31-0ubuntu9 500
        500 https://linux.yz.yamagata-u.ac.jp/ubuntu focal/main amd64 Packages

이번엔 판본을 지정해서 설치를 시도했다.

$ sudo apt install libc6-dev=2.31-0ubuntu9.9
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libc6-dev : Depends: libc6 (= 2.31-0ubuntu9.9) but 2.33-0ubuntu5 is to be installed
             Depends: libc-dev-bin (= 2.31-0ubuntu9.9) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

libc6-dev 은 저장소에 2.31 만 존재한다. 이와 조화를 이루려면 libc6 와 libc-dev-bin 모두 2.31 이 필요한데, 2.33 이 설치돼 있기에, apt 는 더 이상 진행할 수가 없다는 오류를 뿜어냈다.
왜?? 왜 얘만 2.33 일까? (원인을 찾았다. 이 글 맨 끝에.)

$ apt-cache policy libc6
libc6:
  Installed: 2.33-0ubuntu5
  Candidate: 2.33-0ubuntu5
  Version table:
 *** 2.33-0ubuntu5 100
        100 /var-dpkg/status
     2.31-0ubuntu9.9 500
        500 https://linux.yz.yamagata-u.ac.jp/ubuntu focal-updates/main amd64 Packages
     2.31-0ubuntu9.7 500
        500 https://linux.yz.yamagata-u.ac.jp/ubuntu focal-security/main amd64 Packages
     2.31-0ubuntu9 500
        500 https://linux.yz.yamagata-u.ac.jp/ubuntu focal/main amd64 Packages

저 명령을 내렸을 땐 사실 몰랐었다. 근데 지금 보니 알겠다. 뭔 문제가 있었는지.
2.33-0ubuntu5 의 출처(?)는 /var-dpkg/status 로 돼 있다. 이 문제는 아마도.. 예전에 했던 짓과 연관된 듯도 한데..
아무튼, 어딘가에서 꼬여버렸다. 현재 여기는, 우분투 18.04 에서 시작하여 20.04 로 판올림한 상태인데, 아마도 18.04 때 뭔가 PPA 등을 설치했었는지도 모르겠다. 그 잔재가 남아있다가 지금에 와서야 내 골치를 아프게 만들어 버렸다.

아…

그렇다고 저걸 지울 수는 없다. 의존성이 강하게 붙어있는 놈이기에, 사실 상 삭제도 불가능하다.


이젠 다소 강하게 나가는 수밖엔 없다.

$ sudo apt install libc6=2.31-0ubuntu9.9
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  glibc-doc locales
The following packages will be REMOVED:
  btrfs-progs libc-bin locales ubuntu-minimal ubuntu-server
The following packages will be DOWNGRADED:
  libc6
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
  libc-bin
0 upgraded, 0 newly installed, 1 downgraded, 5 to remove and 0 not upgraded.
Need to get 2,722 kB of archives.
After this operation, 25.5 MB disk space will be freed.
You are about to do something potentially harmful.
To continue type in the phrase 'Yes, do as I say!'
 ?] Yes, do as I say!

저 명령을 내렸을 때, 위에 있는 ‘무시무시한‘ 문구는 눈에 들어오지 않았었다. 그저, 확인 요구가 좀 집요하네? 라고 느꼈을 뿐이다.
진행하려면, 정확히 ‘Yes, do as I say!‘ 를 입력하라고??? 뭐 해주지, 그게 어렵나?

그런데.. 난 이 문구를 무시했었다.

The following packages will be REMOVED:
  btrfs-progs libc-bin locales ubuntu-minimal ubuntu-server

이런… 이미 엎질러진 물.

Removing ubuntu-server (1.450.2) ...
Removing btrfs-progs (5.10.1-1build1) ...
Removing ubuntu-minimal (1.450.2) ...
Removing locales (2.33-0ubuntu5) ...

아…

지워진 거, 다시 설치하면 되겠지?

$ sudo apt install btrfs-progs libc-bin locales ubuntu-minimal ubuntu-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 btrfs-progs : Depends: libblkid1 (>= 2.17.2) but it is not going to be installed
               Depends: libcom-err2 (>= 1.43.9) but it is not going to be installed
               Depends: libext2fs2 (>= 1.42) but it is not going to be installed
               Depends: liblzo2-2 (>= 2.02) but it is not going to be installed
               Depends: libuuid1 (>= 2.16) but it is not going to be installed
               Depends: libzstd1 (>= 1.3.2) but it is not going to be installed
               Depends: zlib1g (>= 1:1.2.0) but it is not going to be installed
 libc-bin : Depends: libc6 (< 2.32) but 2.33-0ubuntu5 is to be installed
 libc6 : Breaks: locales (< 2.33) but 2.31-0ubuntu9.9 is to be installed
         Recommends: libidn2-0 (>= 2.0.5~) but it is not going to be installed
         Recommends: libnss-nis but it is not installable
         Recommends: libnss-nisplus but it is not installable
 locales : Depends: debconf (>= 0.5) but it is not going to be installed or
                    debconf-2.0
 ubuntu-minimal : Depends: adduser but it is not going to be installed
                  Depends: apt but it is not going to be installed
                  Depends: apt-utils but it is not going to be installed
                  Depends: bzip2 but it is not going to be installed
                  Depends: console-setup but it is not going to be installed
                  Depends: debconf but it is not going to be installed
                  Depends: debconf-i18n but it is not going to be installed
                  Depends: e2fsprogs but it is not going to be installed
                  Depends: eject but it is not going to be installed
                  Depends: init but it is not going to be installed
                  Depends: iproute2 but it is not going to be installed
                  Depends: iputils-ping but it is not going to be installed
                  Depends: isc-dhcp-client but it is not going to be installed
                  Depends: kbd but it is not going to be installed
                  Depends: kmod but it is not going to be installed
                  Depends: less but it is not going to be installed
                  Depends: lsb-release but it is not going to be installed
                  Depends: mawk but it is not going to be installed
                  Depends: mount but it is not going to be installed
                  Depends: netcat-openbsd but it is not going to be installed
                  Depends: netplan.io but it is not going to be installed
                  Depends: passwd but it is not going to be installed
                  Depends: procps but it is not going to be installed
                  Depends: python3 but it is not going to be installed
                  Depends: sudo
                  Depends: tzdata but it is not going to be installed
                  Depends: ubuntu-advantage-tools but it is not going to be installed
                  Depends: udev but it is not going to be installed
                  Depends: vim-tiny but it is not going to be installed
                  Depends: whiptail but it is not going to be installed
                  Recommends: rsyslog but it is not going to be installed
 ubuntu-server : Depends: apport but it is not going to be installed
                 Depends: at but it is not going to be installed
                 Depends: bcache-tools but it is not going to be installed
                 Depends: byobu but it is not going to be installed
                 Depends: cloud-guest-utils but it is not going to be installed
                 Depends: cloud-initramfs-copymods but it is not going to be installed
                 Depends: cloud-initramfs-dyn-netconf but it is not going to be installed
                 Depends: curl but it is not going to be installed
                 Depends: dirmngr but it is not going to be installed
                 Depends: ethtool but it is not going to be installed
                 Depends: git but it is not going to be installed
                 Depends: gnupg but it is not going to be installed
                 Depends: htop but it is not going to be installed
                 Depends: lvm2 but it is not going to be installed
                 Depends: mdadm but it is not going to be installed
                 Depends: multipath-tools but it is not going to be installed
                 Depends: overlayroot but it is not going to be installed
                 Depends: patch but it is not going to be installed
                 Depends: pollinate but it is not going to be installed
                 Depends: screen but it is not going to be installed
                 Depends: software-properties-common but it is not going to be installed
                 Depends: sosreport but it is not going to be installed
                 Depends: tmux but it is not going to be installed
                 Depends: update-notifier-common but it is not going to be installed
                 Depends: vim
                 Depends: xfsprogs but it is not going to be installed
                 Recommends: fwupd but it is not going to be installed
                 Recommends: landscape-common but it is not going to be installed
                 Recommends: open-iscsi but it is not going to be installed
                 Recommends: open-vm-tools but it is not going to be installed
                 Recommends: snapd but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

안된다. 설치를 할 수가 없다.

하나씩 설치해보자고 맘을 먹고, locales 부터 시작해봤다. 역시 libc-bin 의존성 문제로 불가능.

야구도 틀어놓고 있었고, 또 맘 속엔 저녁 준비도 해야 하는데.. 하는 부담감도 쌓여가면서 집중이 어려웠다. 그렇다고 여기서 서버를 꺼버릴 수는 없다. 그러면 부팅이 불가능해진다. 그걸 되살리려면 일단 USB 드라이브로 부팅해서 chroot 을 하거나, 지금와 생각났지만 snapper 를 이용하거나 해야 한다. 모두, 손쉬운 방법은 아니다.

일단 여기서 손을 털고 일어섰다. 밥 챙겨 드리고, 설겆이 끝내고, 맘을 비우고 다시 왔다. 내가 응원하던 팀은 이기다가 역전까지 당한 상황. 야구엔 신경 쓸 일이 없어졌다.


문제는 여전히 libc6 였다.

$ apt-cache policy libc6
libc6:
  Installed: 2.33-0ubuntu5
  Candidate: 2.33-0ubuntu5
  Version table:
 *** 2.33-0ubuntu5 100
        100 /var-dpkg/status
     2.31-0ubuntu9.9 500
        500 https://linux.yz.yamagata-u.ac.jp/ubuntu focal-updates/main amd64 Packages
     2.31-0ubuntu9.7 500
        500 https://linux.yz.yamagata-u.ac.jp/ubuntu focal-security/main amd64 Packages
     2.31-0ubuntu9 500
        500 https://linux.yz.yamagata-u.ac.jp/ubuntu focal/main amd64 Packages

강제로 2.31 을 설치하려고 했는데, 그게 되지 않는다. 그 와중에 시스템은 날아가 버렸고.

이러면, 강제로 설치하는 수밖에 없다.

$ apt download libc6-dev libc6 locales libc-bin

이러고 나면, 다음과 같은 파일들이 디스크에 저장된다.

libc-bin_2.31-0ubuntu9.9_amd64.deb
libc6_2.31-0ubuntu9.9_amd64.deb
locales_2.31-0ubuntu9.9_all.deb
libc6-dev_2.31-0ubuntu9.9_amd64.deb

그리고 이 파일들을 설치한다. 이런 식으로 한번에 할 수도 있고.. 하나씩 해도 된다.

$ sudo dpkg --force-all -i l*.deb

그리고 나니, 문제의 원흉이 모두 사라졌다. 헌데, locale 문제는 여전히 남았다. 이건 재 생성해주면 된다.

$ sudo dpkg-reconfigure locales

자.. 이제야 돌아왔다. 아까 지워졌던 꾸러미들(btrfs-progs ubuntu-minimal ubuntu-server)을 apt 로 설치하면, 뻘짓 이전으로 돌아갈 수가 있다.

그리고, 이제 build-essential 도 문제없이 설치할 수 있게 됐다.


이젠 재부팅이 무섭지 않게 됐다!

그렇긴 한데.. 언제부턴가 부팅 시간도 꽤 길어지고, apt update 때도 시간이 꽤 걸리곤 한다.
설치한지 3년이 넘어가는 듯 하니, 한번쯤 재설치할 때가 되긴 한 듯. (올 해가 가기 전에.. 할 수 있으려나. 꼭 돌아온다고.. 32일이라고, 33일이라고..)


Downloads 디렉토리를 보니, 이런 파일들이 있었다.

btrfs-progs_5.10.1-1build1_amd64.deb
libbtrfs0_5.10.1-1build1_amd64.deb
libbtrfsutil1_5.10.1-1build1_amd64.deb
libc6_2.33-0ubuntu5_amd64.deb
libc-bin_2.33-0ubuntu5_amd64.deb
locales-all_2.33-0ubuntu5_amd64.deb
locales_2.33-0ubuntu5_all.deb
python3-btrfsutil_5.10.1-1build1_amd64.deb

내려받은 날짜는 21년 4월 10일. Hirsute(21.04)용 파일이었는데.. 이걸 왜 받았었을까? 혹시나 여기에 흔적이 있을까 찾아봤지만, 아무 것도 없었다. 아마도 Snapper 와 관련이 있지 않을까 생각해보지만..

아무래도 조만간 밀어버리고, Snapper 는 해제해야겠다. 굳이 쓸 일도 없고, 그냥 보관만 잘 해놓는 편이 더 나은 선택일 듯 하다. (아.. 그러나 재설치하는 그 작업이 보통 일이 아니라서 말이지.)

Author: 아무도안

안녕하세요. 글 남겨주셔서 고맙습니다.