Ubuntu學習之apt-get update 升級錯誤

繁夜發表於2018-09-06

今天在使用 apt-get update 時報錯了

Get:1 http://mirrors.cloud.aliyuncs.com/ubuntu xenial InRelease [247 kB]
Get:2 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-security InRelease [107 kB]
0% [1 InRelease gpgv 247 kB] [Waiting for headers]Couldn't create tempfiles for splitting up /var/lib/apt/lists/partial/mirrors.cloud.aliyuncs.com_ubuntu_dists_Ign:1 http://mirrors.cloud.aliyuncs.com/ubuntu xenial InRelease
0% [2 InRelease gpgv 107 kB] [Waiting for headers]Couldn't create tempfiles for splitting up /var/lib/apt/lists/partial/mirrors.cloud.aliyuncs.com_ubuntu_dists_Ign:2 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-security InRelease
Get:3 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-updates InRelease [109 kB]
0% [3 InRelease gpgv 109 kB]Couldn't create tempfiles for splitting up /var/lib/apt/lists/partial/mirrors.cloud.aliyuncs.com_ubuntu_dists_xenial-updates_InReleaIgn:3 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-updates InRelease
Get:4 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-proposed InRelease [260 kB]
0% [4 InRelease gpgv 260 kB]Couldn't create tempfiles for splitting up /var/lib/apt/lists/partial/mirrors.cloud.aliyuncs.com_ubuntu_dists_xenial-proposed_InReleIgn:4 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-proposed InRelease
Get:5 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-backports InRelease [107 kB]
0% [5 InRelease gpgv 107 kB]Couldn't create tempfiles for splitting up /var/lib/apt/lists/partial/mirrors.cloud.aliyuncs.com_ubuntu_dists_xenial-backports_InRelIgn:5 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-backports InRelease
Reading package lists... Error!
W: GPG error: http://mirrors.cloud.aliyuncs.com/ubuntu xenial InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: The repository 'http://mirrors.cloud.aliyuncs.com/ubuntu xenial InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Couldn't create temporary file to work with /var/lib/apt/lists/partial/mirrors.cloud.aliyuncs.com_ubuntu_dists_xenial_Release - mkstemp (2: No such file or directory)
W: GPG error: http://mirrors.cloud.aliyuncs.com/ubuntu xenial-security InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: The repository 'http://mirrors.cloud.aliyuncs.com/ubuntu xenial-security InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Couldn't create temporary file to work with /var/lib/apt/lists/partial/mirrors.cloud.aliyuncs.com_ubuntu_dists_xenial-security_Release - mkstemp (2: No such file or directory)
W: GPG error: http://mirrors.cloud.aliyuncs.com/ubuntu xenial-updates InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: The repository 'http://mirrors.cloud.aliyuncs.com/ubuntu xenial-updates InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Couldn't create temporary file to work with /var/lib/apt/lists/partial/mirrors.cloud.aliyuncs.com_ubuntu_dists_xenial-updates_Release - mkstemp (2: No such file or directory)
W: GPG error: http://mirrors.cloud.aliyuncs.com/ubuntu xenial-proposed InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: The repository 'http://mirrors.cloud.aliyuncs.com/ubuntu xenial-proposed InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Couldn't create temporary file to work with /var/lib/apt/lists/partial/mirrors.cloud.aliyuncs.com_ubuntu_dists_xenial-proposed_Release - mkstemp (2: No such file or directory)
W: GPG error: http://mirrors.cloud.aliyuncs.com/ubuntu xenial-backports InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: The repository 'http://mirrors.cloud.aliyuncs.com/ubuntu xenial-backports InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Couldn't create temporary file to work with /var/lib/apt/lists/partial/mirrors.cloud.aliyuncs.com_ubuntu_dists_xenial-backports_Release - mkstemp (2: No such file or directory)
E: Couldn't create temporary file to work with /var/lib/apt/lists/mirrors.cloud.aliyuncs.com_ubuntu_dists_xenial_Release - mkstemp (2: No such file or directory)
E: The package lists or status file could not be parsed or opened.

然後試著用以下指令

1 sudo rm /var/lib/apt/lists/* -vf
2 sudo apt-get update

具體解決:
run these two commands and it should get you fixed up.
Code:
sudo rm /var/lib/apt/lists/* -vf
The first command will remove the damaged list and when you run the second command it will replace it with a new list.

Code:
sudo apt-get update

然後突然想到前天被礦機坑過,我把tmp 資料夾給刪了
重新新建了tmp 資料夾後,再試試

Get:1 http://mirrors.cloud.aliyuncs.com/ubuntu xenial InRelease [247 kB]
Get:2 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-security InRelease [107 kB]
0% [1 InRelease gpgv 247 kB] [2 InRelease 55.0 kB/107 kB 52%]Couldn't create tempfiles for splitting up /var/lib/apt/lists/partial/mirrors.cloud.aliyuncs.com_ubIgn:1 http://mirrors.cloud.aliyuncs.com/ubuntu xenial InRelease
Get:3 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-updates InRelease [109 kB]
Get:4 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-proposed InRelease [260 kB]
0% [2 InRelease gpgv 107 kB] [4 InRelease 110 kB/260 kB 42%]Couldn't create tempfiles for splitting up /var/lib/apt/lists/partial/mirrors.cloud.aliyuncs.com_ubuIgn:2 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-security InRelease
0% [3 InRelease gpgv 109 kB] [4 InRelease 210 kB/260 kB 80%]Couldn't create tempfiles for splitting up /var/lib/apt/lists/partial/mirrors.cloud.aliyuncs.com_ubuIgn:3 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-updates InRelease
Get:5 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-backports InRelease [107 kB]
0% [4 InRelease gpgv 260 kB] [5 InRelease 62.1 kB/107 kB 58%]Couldn't create tempfiles for splitting up /var/lib/apt/lists/partial/mirrors.cloud.aliyuncs.com_ubIgn:4 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-proposed InRelease
0% [5 InRelease gpgv 107 kB]Couldn't create tempfiles for splitting up /var/lib/apt/lists/partial/mirrors.cloud.aliyuncs.com_ubuntu_dists_xenial-backports_InRelIgn:5 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-backports InRelease
Fetched 830 kB in 0s (8,379 kB/s)
Reading package lists... Done
W: GPG error: http://mirrors.cloud.aliyuncs.com/ubuntu xenial InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: The repository 'http://mirrors.cloud.aliyuncs.com/ubuntu xenial InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://mirrors.cloud.aliyuncs.com/ubuntu xenial-security InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: The repository 'http://mirrors.cloud.aliyuncs.com/ubuntu xenial-security InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://mirrors.cloud.aliyuncs.com/ubuntu xenial-updates InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: The repository 'http://mirrors.cloud.aliyuncs.com/ubuntu xenial-updates InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://mirrors.cloud.aliyuncs.com/ubuntu xenial-proposed InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: The repository 'http://mirrors.cloud.aliyuncs.com/ubuntu xenial-proposed InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://mirrors.cloud.aliyuncs.com/ubuntu xenial-backports InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: The repository 'http://mirrors.cloud.aliyuncs.com/ubuntu xenial-backports InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.

結果好了一點兒,現在證書又有問題了 。。。。。。。。。。。。。

其實這個是由於新建的 tmp 資料夾許可權不夠的原因

chmod 777 /tmp

apt-get update --allow-unauthenticated

相關文章