1. 程式人生 > >sudo apt-get update執行失敗問題解決

sudo apt-get update執行失敗問題解決

錯誤

在執行sudo apt-get update命令時,執行結果失敗,錯誤資訊如下:

獲取:1 http://repo.mysql.com trusty InRelease [33.5 kB]
100% [1 InRelease gpgv 33.5 kB] [正在等待報頭] [正在等待報頭] [正�Couldn't create tempfiles for splitting up /var/lib/apt/lists/partial/repo.m忽略 http://repo.mysql.com trusty InRelease
忽略 http://archive.ubuntu.com trusty InRelease
獲取:2 http://security.ubuntu.com trusty-security InRelease [65.9 kB]
命中 http://ppa.launchpad.net trusty InRelease
48% [InRelease gpgv 15.5 kB] [正在等待報頭] [2 InRelease 14.2 kB/65.9 kB Couldn't create tempfiles for splitting up /var/lib/apt/lists/ppa.lau忽略 http://ppa.launchpad.net trusty InRelease
獲取:3 https://download.docker.com trusty InRelease
命中 https://apt.dockerproject.org ubuntu-trusty InRelease
55% [InRelease gpgv 48.7 kB] [正在等待報頭] [2 InRelease 14.2 kB/65.9 kB Couldn't create tempfiles for splitting up /var/lib/apt/lists/apt.doc忽略 https://apt.dockerproject.org ubuntu-trusty InRelease
59% [3 InRelease gpgv 26.5 kB] [正在等待報頭] [2 InRelease 14.2 kB/65.9 kCouldn't create tempfiles for splitting up /var/lib/apt/lists/partial錯誤 https://download.docker.com trusty InRelease

命中 http://nginx.org trusty InRelease
59% [InRelease gpgv 3,593 B] [正在等待報頭] [2 InRelease 14.2 kB/65.9 kB Couldn't create tempfiles for splitting up /var/lib/apt/lists/nginx.o忽略 http://nginx.org trusty InRelease
獲取:4 http://archive.ubuntu.com trusty-updates InRelease [65.9 kB]
忽略 http://nginx.org trusty/nginx Sources/DiffIndex
獲取:5 https://apt.dockerproject.org ubuntu-trusty/main amd64 Packages/DiffIndex
忽略 https://apt.dockerproject.org ubuntu-trusty/main amd64 Packages/DiffIndex
忽略 http://ppa.launchpad.net trusty/main amd64 Packages/DiffIndex
忽略 http://nginx.org trusty/nginx amd64 Packages/DiffIndex
85% [2 InRelease gpgv 65.9 kB] [4 InRelease 37.4 kB/65.9 kB 57%] [正在等待�Couldn't create tempfiles for splitting up /var/lib/apt/lists/parti錯誤 http://security.ubuntu.com trusty-security InRelease

忽略 http://repo.mysql.com trusty/mysql-5.7 Sources/DiffIndex
忽略 http://nginx.org trusty/nginx i386 Packages/DiffIndex
100% [4 InRelease gpgv 65.9 kB] [正在等待報頭] [正在等待報頭] [正�Couldn't create tempfiles for splitting up /var/lib/apt/lists/partial/archiv錯誤 http://archive.ubuntu.com trusty-updates InRelease

忽略 https://apt.dockerproject.org ubuntu-trusty/main i386 Packages/DiffIndex
命中 http://archive.ubuntu.com trusty-backports InRelease
100% [InRelease gpgv 65.9 kB] [正在等待報頭] [正在等待報頭] [正在Couldn't create tempfiles for splitting up /var/lib/apt/lists/archive.ubuntu.忽略 http://archive.ubuntu.com trusty-backports InRelease
忽略 http://ppa.launchpad.net trusty/main i386 Packages/DiffIndex
忽略 http://repo.mysql.com trusty/mysql-apt-config amd64 Packages/DiffIndex
命中 http://archive.ubuntu.com trusty Release.gpg
命中 https://apt.dockerproject.org ubuntu-trusty/main amd64 Packages
忽略 http://archive.ubuntu.com trusty-backports/main Sources/DiffIndex
命中 https://apt.dockerproject.org ubuntu-trusty/main i386 Packages
獲取:6 https://apt.dockerproject.org ubuntu-trusty/main Translation-zh_CN
忽略 http://repo.mysql.com trusty/mysql-5.7 amd64 Packages/DiffIndex
忽略 http://archive.ubuntu.com trusty-backports/restricted Sources/DiffIndex
忽略 http://archive.ubuntu.com trusty-backports/universe Sources/DiffIndex
忽略 http://archive.ubuntu.com trusty-backports/multiverse Sources/DiffIndex

▽
meserver 8.8.8.8
忽略 http://repo.mysql.com trusty/mysql-tools amd64 Packages/DiffIndex
忽略 http://archive.ubuntu.com trusty-backports/main amd64 Packages/DiffIndex
命中 http://ppa.launchpad.net trusty/main Translation-en
忽略 http://archive.ubuntu.com trusty-backports/restricted amd64 Packages/DiffIndex
忽略 http://repo.mysql.com trusty/mysql-apt-config i386 Packages/DiffIndex
忽略 http://archive.ubuntu.com trusty-backports/universe amd64 Packages/DiffIndex
命中 http://ppa.launchpad.net trusty/main amd64 Packages
忽略 http://archive.ubuntu.com trusty-backports/multiverse amd64 Packages/DiffIndex
忽略 http://archive.ubuntu.com trusty-backports/main i386 Packages/DiffIndex
忽略 http://repo.mysql.com trusty/mysql-5.7 i386 Packages/DiffIndex
忽略 https://apt.dockerproject.org ubuntu-trusty/main Translation-zh_CN
命中 http://ppa.launchpad.net trusty/main i386 Packages

▽
nameserver 8.8.8.8
忽略 http://archive.ubuntu.com trusty-backports/restricted i386 Packages/DiffIndex
忽略 https://apt.dockerproject.org ubuntu-trusty/main Translation-zh
忽略 https://apt.dockerproject.org ubuntu-trusty/main Translation-en
忽略 http://archive.ubuntu.com trusty-backports/universe i386 Packages/DiffIndex
忽略 http://repo.mysql.com trusty/mysql-tools i386 Packages/DiffIndex
忽略 http://archive.ubuntu.com trusty-backports/multiverse i386 Packages/DiffIndex
命中 http://archive.ubuntu.com trusty-backports/main Translation-en
命中 http://nginx.org trusty/nginx Sources
命中 http://nginx.org trusty/nginx amd64 Packages
命中 http://archive.ubuntu.com trusty-backports/multiverse Translation-en
命中 http://nginx.org trusty/nginx i386 Packages
忽略 http://nginx.org trusty/nginx Translation-zh_CN
忽略 http://nginx.org trusty/nginx Translation-zh
命中 http://archive.ubuntu.com trusty-backports/restricted Translation-en
忽略 http://nginx.org trusty/nginx Translation-en
忽略 http://ppa.launchpad.net trusty/main Translation-zh_CN
命中 http://archive.ubuntu.com trusty-backports/universe Translation-en
忽略 http://ppa.launchpad.net trusty/main Translation-zh
命中 http://archive.ubuntu.com trusty Release
W: GPG 錯誤:http://repo.mysql.com trusty InRelease: 無法執行 gpgv 以驗證簽名(您安裝了 gpgv 嗎?)
W: GPG 錯誤:http://ppa.launchpad.net trusty InRelease: 無法執行 gpgv 以驗證簽名(您安裝了 gpgv 嗎?)
W: GPG 錯誤:https://apt.dockerproject.org ubuntu-trusty InRelease: 無法執行 gpgv 以驗證簽名(您安裝了 gpgv 嗎?)
W: 校驗簽名出錯。此倉庫未被更新,仍然使用以前的索引檔案。GPG 錯誤:https://download.docker.com trusty InRelease: 無法執行 gpgv 以驗證簽名(您安裝了 gpgv 嗎?)

W: GPG 錯誤:http://nginx.org trusty InRelease: 無法執行 gpgv 以驗證簽名(您安裝了 gpgv 嗎?)
W: 校驗簽名出錯。此倉庫未被更新,仍然使用以前的索引檔案。GPG 錯誤:http://security.ubuntu.com trusty-security InRelease: 無法執行 gpgv 以驗證簽名(您安裝了 gpgv 嗎?)

W: 校驗簽名出錯。此倉庫未被更新,仍然使用以前的索引檔案。GPG 錯誤:http://archive.ubuntu.com trusty-updates InRelease: 無法執行 gpgv 以驗證簽名(您安裝了 gpgv 嗎?)

W: GPG 錯誤:http://archive.ubuntu.com trusty-backports InRelease: 無法執行 gpgv 以驗證簽名(您安裝了 gpgv 嗎?)
E: Couldn't create temporary file to work with /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_trusty_Release - mkstemp (2: No such file or directory)

解決方法

嘗試各種方法都不能解決問題,最終找到解決方法按如下,依次執行下列命令:

sudo apt-get clean
sudo mv /var/lib/apt/lists /tmp
sudo mkdir -p /var/lib/apt/lists/partial
sudo apt-get clean
sudo apt-get update