setokynet Blog (

Ubuntu OS update


Windows 10のWSL1で sudo do-release-upgrade -d を実行してUbuntu 18.04 LTSから20.04 LTSにOSをアップデートしたところ次のエラーが発生するようになりました。

User@PC-Name: $ sudo apt-get update
Hit:1 focal InRelease
Hit:2 focal-updates InRelease
Hit:3 focal-backports InRelease
Hit:4 focal-security InRelease
Reading package lists... Done
User@PC-Name: $ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libc-bin : Depends: libc6 (< 2.28) but 2.31-0ubuntu9 is installed
 locales : Depends: libc-bin (> 2.31) but 2.27-3ubuntu1 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

sudo apt –fix-broken install を実行しても依然として

Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)


cd /tmp

sudo dpkg --install libc6_2.31-0ubuntu8+lp1871129~1_amd64.deb
sudo apt-mark hold libc6
sudo apt --fix-broken install
sudo apt full-upgrade

再度sudo apt-get upgradeを実行すると次のエラーが発生する場合があります。

sleep: cannot read realtime clock: Invalid argument
dpkg: error processing package libc6:amd64 (--configure):
 installed libc6:amd64 package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:

Stuck with apt –fix-broken install (libc6:amd64 package post-installation)
sudo mv /var/lib/dpkg/info /var/lib/dpkg/info_old
sudo mkdir /var/lib/dpkg/info
sudo apt-get update && sudo apt-get -f install