apt-get update => dpkg ロックファイルを開けません。 (5:入出力エラー)

apt-get update => dpkg ロックファイルを開けません。 (5:入出力エラー)

「sudo apt-get update」を実行すると、次のエラーメッセージが表示されます。

E: Could not open lock file /var/lib/dpkg/lock - open (5: Input/output error)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

ここに似たものがありますaks-ubuntu:管理ディレクトリをロックできません。 var-lib-dpkgは別のプロセスです。 ロックファイルを削除して解決しました(ロックファイルを「ロックする」他のプロセスによって問題が発生していないことを確認した後)

他のプロセスにロックがないことを確認し、ロックファイルを削除してみました。

osmc@osmc:/var/lib/dpkg$ sudo rm lock
rm: cannot remove 'lock': Input/output error

また、すべてのファイルと権限をリストしてみました。

osmc@osmc:/var/lib/dpkg$ ls -la
ls: cannot access available: Input/output error
ls: cannot access lock: Input/output error
ls: cannot access diversions: Input/output error
ls: cannot access info: Input/output error
ls: cannot access updates: Input/output error
total 680
drwxr-xr-x  7 root root   4096 May 25 17:13 .
drwxr-xr-x 24 root root   4096 May 23 23:46 ..
drwxr-xr-x  2 root root   4096 May 23 23:48 alternatives
-?????????  ? ?    ?         ?            ? available
-rw-r--r--  1 root root      8 May 19 20:25 cmethopt
-?????????  ? ?    ?         ?            ? diversions
-rw-r--r--  1 root root    943 May 19 20:31 diversions-old
d?????????  ? ?    ?         ?            ? info
-?????????  ? ?    ?         ?            ? lock
drwxr-xr-x  2 root root   4096 Apr 15 10:23 parts
-rw-r--r--  1 root root     65 May 19 20:29 statoverride
-rw-r--r--  1 root root      0 May 19 20:24 statoverride-old
-rw-r--r--  1 root root 330290 May 25 17:13 status
-rw-r--r--  1 root root 330290 May 25 17:13 status-old
drwxr-xr-x  2 root root   4096 May 23 23:48 triggers
d?????????  ? ?    ?         ?            ? updates

おそらく疑問符のあるファイルは次のようになると思いました。施行不可能だから私はdpkgのすべてのファイルを実行可能にしようとしています。

osmc@osmc:/var/lib$ sudo chmod -R a+rX dpkg
chmod: cannot access 'dpkg/available': Input/output error
chmod: cannot access 'dpkg/lock': Input/output error
chmod: cannot access 'dpkg/diversions': Input/output error
chmod: cannot access 'dpkg/info': Input/output error
chmod: cannot access 'dpkg/alternatives/rcp': Input/output error
chmod: cannot access 'dpkg/alternatives/mt': Input/output error
chmod: cannot access 'dpkg/alternatives/editor': Input/output error
chmod: cannot access 'dpkg/alternatives/w': Input/output error
chmod: cannot access 'dpkg/alternatives/awk': Input/output error
chmod: cannot access 'dpkg/alternatives/rsh': Input/output error
chmod: cannot access 'dpkg/alternatives/pico': Input/output error
chmod: cannot access 'dpkg/alternatives/lzma': Input/output error
chmod: cannot access 'dpkg/alternatives/builtins.7.gz': Input/output error
chmod: cannot access 'dpkg/alternatives/pager': Input/output error
chmod: cannot access 'dpkg/updates': Input/output error

また、ディスクに書き込む一般的な問題をテストするために、そのディレクトリにテストファイルを作成しました。それでも動作します...

dmesg提供

  osmc@osmc:~$ dmesg | tail -n 30
[  313.069081] EXT4-fs error (device mmcblk0p2): ext4_iget:3921: inode #136661: comm gmain: bad extra_isize (23520 != 256)
[  317.069236] EXT4-fs error (device mmcblk0p2): ext4_iget:3921: inode #136661: comm gmain: bad extra_isize (23520 != 256)
[  317.921020] EXT4-fs error (device mmcblk0p2): ext4_iget:3921: inode #130830: comm kodi.bin: bad extra_isize (52864 != 256)
[  321.068403] EXT4-fs error (device mmcblk0p2): ext4_iget:3921: inode #136661: comm gmain: bad extra_isize (23520 != 256)
[  325.069286] EXT4-fs error (device mmcblk0p2): ext4_iget:3921: inode #136661: comm gmain: bad extra_isize (23520 != 256)
[  329.069371] EXT4-fs error (device mmcblk0p2): ext4_iget:3921: inode #136661: comm gmain: bad extra_isize (23520 != 256)
.... (further similar errors)

この問題を解決する方法についてのアイデアはありますか?

システム:SDカード付きRaspberry PiのOSMC

ベストアンサー1

システムをシャットダウンする前に、次の出力を記録またはコピーしてください。

cat /proc/version

その後、正しくシャットダウンしてSDカードを取り外し、e2fsckすべてのext4パーティションで実行する必要があります。 OSMCが複数のパーティションを使用しているかどうかはわかりませんが、これは保証されず、fdisk指を横切ることができます。修正。

なぜこれが起こるのか調べてみてください。ここで得られる情報は、/proc/version影響を受けるgccバージョンの1つで構築されたカーネルを使用しているかどうかを示します。

おすすめ記事