Btrfs 環境で apt に失敗したのを修正( not an ELF file )

最近何度か apt upgrade でエラーとなってしまいました.恐らくBtrfs 環境依存かつ disk full 時に起こるようです.
メモしておきます.

Btrfs 環境で apt upgrade 時に disk-full になると通常容量エラーになるところがファイルが壊れてしまうことがあるようです.透過圧縮等を使っているので容量がうまく取得できないせいだと思います.

apt upgrade で転ける
ldconfig: /lib/x86_64-linux-gnu/libexpect.so.5.45.4 is not an ELF file - it has the wrong magic bytes at the start.

ldconfig: /lib/x86_64-linux-gnu/libexpect.so.5 is not an ELF file - it has the wrong magic bytes at the start.

ldconfig: /lib/x86_64-linux-gnu/libexpect.so.5.45 is not an ELF file - it has the wrong magic bytes at the start.

以下のように壊れたファイルのパッケージをダウンロードして上書きインストールすることで治ったようです.

修正
$ apt-file search /usr/lib/x86_64-linux-gnu/libexpect.so.5 (1)
tcl-expect: /usr/lib/x86_64-linux-gnu/libexpect.so.5
tcl-expect: /usr/lib/x86_64-linux-gnu/libexpect.so.5.45
tcl-expect: /usr/lib/x86_64-linux-gnu/libexpect.so.5.45.4
$ apt download tcl-expect (2)
$ sudo dpkg -i ./tcl-expect_5.45.4-3_amd64.deb (3)
$ sudo ldconfig (4)
$ rm ./tcl-expect_5.45.4-3_amd64.deb (5)
  1. エラーの出ているファイルからパッケージを探す
  2. 該当パッケージをダウンロード( apt reinstall だとうまく行かなかった )
  3. パッケージインストール
  4. 動作確認
  5. パッケージファイル削除

disk 小さいので大きいのに載せ変えたりしたいですね.しかし m.2 SATA なので選択肢があまりなく値段も高めで手を出しづらいです…….

環境
$ dpkg-query -W apt btrfs* dpkg
apt     2.7.12
btrfs-progs     6.6.3-1.1
dpkg    1.22.6
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux trixie/sid
Release:        n/a
Codename:       trixie
$ arch
x86_64

コメントを残す

メールアドレスが公開されることはありません。 ※ が付いている欄は必須項目です

Your post must include a link to this post.

How does this work?
Write a response on your own website and include a link to this post. Then submit your response’s URL here. Your response may appear here after moderation. To update or remove it, edit or delete your original post and submit the same URL again. Learn more about Webmentions.