Ubuntu で The following packages have unmet dependencies: エラー
現象
Ubuntu 22.04 コンテナで git をインストールしようすると下記のエラーとなりました。
# docker run -dit --name test -h test ubuntu:22.04 # docker exec -it test /bin/bash root@test:/# apt update root@test:/# apt -y install git : The following packages have unmet dependencies: perl : Depends: perl-base (= 5.34.0-3ubuntu1) but 5.34.0-3ubuntu1.1 is to be installed Recommends: netbase but it is not going to be installed E: Unable to correct problems, you have held broken packages.
原因
perl-base の 5.34.0-3ubuntu1 が必要だけど 5.34.0-3ubuntu1.1 がインストールされているというエラーのようです。
回避策
とりあえず、perl-base をバージョンダウンしてみました。
# apt -y --allow-downgrades reinstall perl-base=5.34.0-3ubuntu1 # apt -y install git
Copyright (C) 2023 杜甫々
初版:2023年6月11日 最終更新:2023年6月11日
https://www.tohoho-web.com/tr/20230611_1.html