Couldn‘t create temporary file /tmp/apt.conf.SUhXie for passing config to apt-key

apt-get update无法创建临时文件报错

报错内容如下:

Get:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease [265 kB]
Err:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease
Couldn’t create temporary file /tmp/apt.conf.T7lK6i for passing config to apt-key
Get:2 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease [114 kB]
Err:2 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease
Couldn’t create temporary file /tmp/apt.conf.wisI5n for passing config to apt-key
Get:3 https://apache.jfrog.io/artifactory/arrow/ubuntu focal InRelease [7291 B]
Get:4 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease [108 kB]
Err:4 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease
Couldn’t create temporary file /tmp/apt.conf.C1cEju for passing config to apt-key
Err:3 https://apache.jfrog.io/artifactory/arrow/ubuntu focal InRelease
Couldn’t create temporary file /tmp/apt.conf.D2Tv0x for passing config to apt-key
Get:5 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease [114 kB]
Err:5 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease
Couldn’t create temporary file /tmp/apt.conf.raCMvC for passing config to apt-key
Reading package lists…
W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal InRelease: Couldn’t create temporary file /tmp/apt.conf.T7lK6i for passing config to apt-key
E: The repository ‘http://ports.ubuntu.com/ubuntu-ports focal InRelease’ is not signed.
W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease: Couldn’t create temporary file /tmp/apt.conf.wisI5n for passing config to apt-key
E: The repository ‘http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease’ is not signed.
W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease: Couldn’t create temporary file /tmp/apt.conf.C1cEju for passing config to apt-key
E: The repository ‘http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease’ is not signed.
W: GPG error: https://apache.jfrog.io/artifactory/arrow/ubuntu focal InRelease: Couldn’t create temporary file /tmp/apt.conf.D2Tv0x for passing config to apt-key
E: The repository ‘https://apache.jfrog.io/artifactory/arrow/ubuntu focal InRelease’ is not signed.
W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal-security InRelease: Couldn’t create temporary file /tmp/apt.conf.raCMvC for passing config to apt-key
E: The repository ‘http://ports.ubuntu.com/ubuntu-ports focal-security InRelease’ is not signed.

重点是Couldn’t create temporary file /tmp/apt.conf.T7lK6i for passing config to apt-key。
报错的原理可参考这篇博客

解决方法

在使用apt-get update之前修改/tmp文件夹权限。

chmod 777 /tmp

在物理机上使用的直接修改就可以,像我一样在使用dockerfile创建镜像的,把这行命令加到apt-get update之前就可以。

  • 3
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值