树莓派4b 对于 Failed to execute command 的解决方案

前言

因为 树莓派4b 是特例,到目前为止官方并没有提供可以直接安装在树莓派 4b 的系统镜像,而以前发布的版本对于 4b 这个新的型号也没有提供较好的支持。

所以在 更新插件 或者 更新系统 可能会出现以下问题:

Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; apt-get update 2>&1' with exit code '100':

本文就这个问题提供解决方法。

具体问题

具体错误代码,可以与你的代码比较一下:

Server.java
  
Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; apt-get update 2>&1' with exit code '100': Get:1 file:/var/cache/openmediavault/archives InRelease Ign:1 file:/var/cache/openmediavault/archives InRelease Get:2 file:/var/cache/openmediavault/archives Release Ign:2 file:/var/cache/openmediavault/archives Release Get:3 file:/var/cache/openmediavault/archives Packages Ign:3 file:/var/cache/openmediavault/archives Packages Get:4 file:/var/cache/openmediavault/archives Translation-en Ign:4 file:/var/cache/openmediavault/archives Translation-en Get:3 file:/var/cache/openmediavault/archives Packages Ign:3 file:/var/cache/openmediavault/archives Packages Get:4 file:/var/cache/openmediavault/archives Translation-en Ign:4 file:/var/cache/openmediavault/archives Translation-en Get:3 file:/var/cache/openmediavault/archives Packages Ign:3 file:/var/cache/openmediavault/archives Packages Get:4 file:/var/cache/openmediavault/archives Translation-en Ign:4 file:/var/cache/openmediavault/archives Translation-en Get:3 file:/var/cache/openmediavault/archives Packages Ign:3 file:/var/cache/openmediavault/archives Packages Get:4 file:/var/cache/openmediavault/archives Translation-en Ign:4 file:/var/cache/openmediavault/archives Translation-en Get:3 file:/var/cache/openmediavault/archives Packages Ign:3 file:/var/cache/openmediavault/archives Packages Get:4 file:/var/cache/openmediavault/archives Translation-en Ign:4 file:/var/cache/openmediavault/archives Translation-en Get:3 file:/var/cache/openmediavault/archives Packages Ign:3 file:/var/cache/openmediavault/archives Packages Get:4 file:/var/cache/openmediavault/archives Translation-en Ign:4 file:/var/cache/openmediavault/archives Translation-en Get:3 file:/var/cache/openmediavault/archives Packages [1069 B] Get:4 file:/var/cache/openmediavault/archives Translation-en Ign:4 file:/var/cache/openmediavault/archives Translation-en Get:5 http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian buster InRelease [15.0 kB] Hit:6 http://mirrors.tuna.tsinghua.edu.cn/raspberrypi buster InRelease Get:7 http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian buster/main Sources [11.4 MB] Err:7 http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian buster/main Sources File has unexpected size (11350904 != 11350828). Mirror sync in progress? [IP: 183.222.102.76 80] Hashes of expected file: - Filesize:11350828 [weak] - SHA256:2080fdd5bfa43842d350f338f920c1bc537aa7f40a9095504772a7241ba52753 - SHA1:b6a1b284c7512b8ad0eea2618b2058bfcae1cb8b [weak] - MD5Sum:32b82c8547daaff00d223c8cb462acea [weak] Release file created at: Fri, 27 Mar 2020 22:51:18 +0000 Ign:9 https://dl.bintray.com/openmediavault-plugin-developers/usul buster InRelease Hit:10 https://download.docker.com/linux/debian buster InRelease Get:11 https://dl.bintray.com/openmediavault-plugin-developers/usul buster Release [4363 B] Hit:13 http://packages.openmediavault.org/public usul InRelease Fetched 4363 B in 13s (327 B/s) Reading package lists... E: Failed to fetch http://183.222.102.76/cache/mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/dists/buster/main/source/Sources.xz?ich_args2=392-28124503039578_574e8b1e35a7d749e734ef3666544963_10001002_9c896c29d4c4f1d6953a518939a83798_4a770034bf2db31bc5e0861b958e4fa3 File has unexpected size (11350904 != 11350828). Mirror sync in progress? [IP: 183.222.102.76 80] Hashes of expected file: - Filesize:11350828 [weak] - SHA256:2080fdd5bfa43842d350f338f920c1bc537aa7f40a9095504772a7241ba52753 - SHA1:b6a1b284c7512b8ad0eea2618b2058bfcae1cb8b [weak] - MD5Sum:32b82c8547daaff00d223c8cb462acea [weak] Release file created at: Fri, 27 Mar 2020 22:51:18 +0000 E: Failed to fetch http://183.222.102.65/cache/mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/dists/buster/main/binary-armhf/Packages.xz?ich_args2=392-28124513039608_af3257cb9619ae1550a259fa412a8924_10001002_9c896c29d4c4f1d6953a518939a83798_60c5e3374eaa05658ba5bf091e3e49ad E: Some index files failed to download. They have been ignored, or old ones used instead.
  

解决方法

现在找到的方法就是更新内核。

sudo apt-get install --reinstall raspberrypi-bootloader raspberrypi-kernel

更新内核后,就可以 更新插件 或者 更新系统 。但是这种方法并不是一劳永逸的,下次依然可能会出现相同的问题,就要再次更新内核。

posted @ 2020-03-28 12:55  Yogile  阅读(6744)  评论(0编辑  收藏  举报