apt-get update失败 解决方案

当遇到`apt-get update`失败时,通常是因为软件源出现问题。一种解决方案是参照博客单元,详细步骤包括查看报错信息并尝试更换软件源。如在没有vim等命令的环境下,可以通过echo命令修改源。

参考博文:

1.报错信息

Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]                                                                
Get:2 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB]                                                                           
Err:1 http://security.ubuntu.com/ubuntu bionic-security InRelease                                                                
  Couldn't create temporary file /tmp/apt.conf.oNI2ed for passing config to apt-key
Ign:3 https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu1804/x86_64  InRelease
Err:2 http://archive.ubuntu.com/ubuntu bionic InRelease                 
  Couldn't create temporary file /tmp/apt.conf.LB2Z9I for passing config to apt-key
Ign:4 https://developer.download.nvidia.cn/compute/machine-learning/repos/ubuntu1804/x86_64  InRelease
Get:6 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Err:6 http://archive.ubuntu.com/ubuntu bionic-updates InRelease                                
  Couldn't create temporary file /tmp/apt.conf.d2Y2f9 for passing config to apt-key
Get:8 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]                    
Err:8 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
  Couldn't create temporary file /tmp/apt.conf.cpf13r for passing config to apt-key
Get:5 https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu1804/x86_64  Release [564 B]
Get:7 https://developer.download.nvidia.cn/compute/machine-learning/repos/ubuntu1804/x86_64  Release [564 B]
Get:9 https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu1804/x86_64  Release.gpg [819 B]
Ign:9 https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu1804/x86_64  Release.gpg
Get:10 https://developer.download.nvidia.cn/compute/machine-learning/repos/ubuntu1804/x86_64  Release.gpg [833 B]
Ign:10 https://developer.download.nvidia.cn/compute/machine-learning/repos/ubuntu1804/x86_64  Release.gpg
Reading package lists... Done 
W: GPG error: http://security.ubuntu.com/ubuntu bionic-security InRelease: Couldn't create temporary file /tmp/apt.conf.oNI2ed for passing config to apt-key
E: The repository 'http://security.ubuntu.com/ubuntu bionic-security InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://archive.ubuntu.com/ubuntu bionic InRelease: Couldn't create temporary file /tmp/apt.conf.LB2Z9I for passing config to apt-key
E: The repository 'http://archive.ubuntu.com/ubuntu bionic InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://archive.ubuntu.com/ubuntu bionic-updates InRelease: Couldn't create temporary file /tmp/apt.conf.d2Y2f9 for passing config to apt-key
E: The repository 'http://archive.ubuntu.com/ubuntu bionic-updates InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://archive.ubuntu.com/ubuntu bionic-backports InRelease: Couldn't create temporary file /tmp/apt.conf.cpf13r for passing config to apt-key
E: The repository 'http://archive.ubuntu.com/ubuntu bionic-backports InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu1804/x86_64  Release: Couldn't create temporary file /tmp/apt.conf.S7sO56 for passing config to apt-key
E: The repository 'https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64  Release' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: https://developer.download.nvidia.cn/compute/machine-learning/repos/ubuntu1804/x86_64  Release: Couldn't create temporary file /tmp/apt.conf.rzSKDs for passing config to apt-key
E: The repository 'https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64  Release' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

解决方法:

https://blog.csdn.net/gpf19930310/article/details/82461306

换源: 在无vim等命令的情况下,可以使用echo命令

https://blog.csdn.net/miss1181248983/article/details/88578287

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值