YU2TA7KA's BLOG ~take one step at a time~

派生開発、組み込み開発周りのこと。

apt-get updateで「ハッシュサムが適合しません」エラー

ラズパイOS環境

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.19.42-v7+ #1219 SMP Tue May 14 21:20:58 BST 2019 armv7l GNU/Linux

エラー内容

ラズパイでapt-get updateをしようとしたら、「ハッシュサムが適合しません」とのエラー。

エラー:3 http://raspbian.raspberrypi.org/raspbian stretch/main armhf Packages
  ハッシュサムが適合しません
  Hashes of expected file:
   - Filesize:11662904 [weak]
   - SHA256:c2255c9c9a80d7adb8d4616733eec23c1ff5ffa6072906bb2d76f55e464b8496
   - SHA1:c45d10ed07aedabe546d40bbe65e71b28b078949 [weak]
   - MD5Sum:8e4f7711bef320ff4f7a6297f9650db5 [weak]
  Hashes of received file:
   - SHA256:70e69bcb8c046ab0bd08c832672ca66a493a996bc28d4ca61a07e289c74dae36
   - SHA1:47fccc81a218e9f8a2e6b5413835bcf78045da1f [weak]
   - MD5Sum:12da7865072bd815dfc98f4a64d52d82 [weak]
   - Filesize:3232749 [weak]
  Last modification reported: Sat, 22 Jun 2019 04:26:58 +0000
  Release file created at: Sat, 22 Jun 2019 04:29:03 +0000

対応

updateの接続サーバーをミラーサーバーに変更する。

deb http://ftp.jaist.ac.jp/raspbian/ stretch main contrib non-free rpi
deb http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian/ stretch main contrib non-free rpi
# deb http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi

Raspberry Pi 3 初期設定まとめ(7) aptミラーサーバ | ReTaX

その他参考にさせていただいたけども、本件とは無関係だった内容

Ubuntuのapt-get updateで「ハッシュサムが適合しません」と出た時の対処法