解决报错:Couldn't create temporary file /tmp/apt.conf.IRqbCz

简介: 问题操作容器应该是属于服务器开发同学的常规操作,经常我们会遇到系统缺少对应的工具的情况,比如我们进入容器后,想使用 vim 修改某个文件,但是发现该容器没有安装 vim 工具。这个时候,一般都需要自己手动安装,比如在 unbuntu 系统中,可以使用 apt-get 包管理命令。

目录

  • 问题
  • 解决
  • 结尾

问题

操作容器应该是属于服务器开发同学的常规操作,经常我们会遇到系统缺少对应的工具的情况,比如我们进入容器后,想使用 vim 修改某个文件,但是发现该容器没有安装 vim 工具。这个时候,一般都需要自己手动安装,比如在 unbuntu 系统中,可以使用 apt-get 包管理命令。

但是,执行 apt-get install vim 命令时,提示没有仓库记录,因此,需要先更新包管理仓库列表,也就是执行 apt-get update 命令,但是遇到了如下报错信息:

root@al-bj-boom-hb-backstage-01:/etc/nginx# apt-get update
Get:1 http://security.debian.org/debian-security buster/updates InRelease [65.4 kB]
Err:1 http://security.debian.org/debian-security buster/updates InRelease
  Couldn't create temporary file /tmp/apt.conf.IRqbCz for passing config to apt-key
Get:2 http://deb.debian.org/debian buster InRelease [122 kB]
Err:2 http://deb.debian.org/debian buster InRelease
  Couldn't create temporary file /tmp/apt.conf.Afcu25 for passing config to apt-key
Get:3 http://deb.debian.org/debian buster-updates InRelease [51.9 kB]
Err:3 http://deb.debian.org/debian buster-updates InRelease
  Couldn't create temporary file /tmp/apt.conf.fztemY for passing config to apt-key
Reading package lists... Done
W: GPG error: http://security.debian.org/debian-security buster/updates InRelease: Couldn't create temporary file /tmp/apt.conf.IRqbCz for passing config to apt-key
E: The repository 'http://security.debian.org/debian-security buster/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://deb.debian.org/debian buster InRelease: Couldn't create temporary file /tmp/apt.conf.Afcu25 for passing config to apt-key
E: The repository 'http://deb.debian.org/debian buster 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://deb.debian.org/debian buster-updates InRelease: Couldn't create temporary file /tmp/apt.conf.fztemY for passing config to apt-key
E: The repository 'http://deb.debian.org/debian buster-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.

解决

解决方法总结下来也非常简单,执行下面的命令就可以了:

chmod 777 /tmp

执行后,再执行 apt-get update 命令,终于成功啦!

执行过程如下:

root@al-bj-boom-hb-backstage-01:/etc/nginx# chmod 777 /tmp
root@al-bj-boom-hb-backstage-01:/etc/nginx# apt-get update
Get:1 http://security.debian.org/debian-security buster/updates InRelease [65.4 kB]
Get:2 http://deb.debian.org/debian buster InRelease [122 kB]
Get:3 http://security.debian.org/debian-security buster/updates/main amd64 Packages [308 kB]
Get:4 http://deb.debian.org/debian buster-updates InRelease [51.9 kB]
Get:5 http://deb.debian.org/debian buster/main amd64 Packages [7906 kB]
Get:6 http://deb.debian.org/debian buster-updates/main amd64 Packages [15.2 kB]
Fetched 8230 kB in 4min 19s (31.7 kB/s)
Reading package lists... Done

整体过程截图如下:

image.png

结尾

更新完 apt-get 的工具库列表,我们就可以正常安装和使用 vim 工具啦!实时证明:确实好用。



作者简介:大家好,我是 liuzhen007,是一位音视频技术爱好者,同时也是CSDN博客专家、华为云享专家(共创编辑)、InfoQ 签约作者,欢迎关注我分享更多干货!



目录
相关文章
|
Ubuntu 安全
Ubuntu中遇到"无法创建临时文件"/tmp/..."在普通或root用户运行apt-get update时的错误解决办法
这些步骤当然不能涵盖所有可能出现问题的场合,但是能覆盖大多数常见的情景。希望这些信息能帮到你解决"无法创建临时文件"/tmp/..."这样的问题。不过,请记住,因为修改系统文件和目录的权限,清理临时文件,或者运行磁盘检查,都可能对系统造成影响,所以执行这些操作前要先确认这是安全的,必要时最好先做好数据备份。
966 10
|
Linux
nfs client高性能参数设置
linux kernel中sunrpc的实现是单连接和长链接的,为了提高并发性能,在单连接的基础上提供多个slot,通过tcp_slot_table_entries参数设置。slot个数越多,nfs请求并发处理能力越强,如果slot个数很小,而nfs请求又很多,就会在client排队等待。
10061 0
|
Ubuntu Linux
【问题复盘】在Ubuntu 20.04下安装OFED驱动 复盘:在Ubuntu 20.04下安装OFED驱动
整个问题主要是由于不同的内核版本导致文件路径不同,进而导致安装过程中某些库无法按预期安装而出现问题。 为什么使用最新的OFED驱动解决了问题呢?推测是最新驱动补充了之前缺失的某些文件,因此后续安装过程能够正常进行。 例如,在OFED 5.4中,某个安装所需的文件F位于A处,但安装程序却在B处查找该文件,导致报错。而在OFED 5.8中,该安装所需的文件F被移回到B处,此时不管去哪里查找都能找到文件F,因此安装可以正常进行。
1980 0
|
Python Windows
Pycharm最新激活教程(亲测有效!) 1
Pycharm最新激活教程(亲测有效!)
14435 0
|
存储 人工智能 缓存
Mooncake:月之暗面Kimi联合清华等机构推出的大模型推理架构
Mooncake是由月之暗面Kimi联合清华大学等机构共同开源的大模型推理架构。该架构以KVCache为中心,通过分布式设计和资源优化,显著提升了大模型推理的吞吐量和效率,同时降低了算力开销。Mooncake在长上下文场景中表现出色,支持多种应用场景,如自然语言处理、内容推荐系统和搜索引擎等。
2155 6
Mooncake:月之暗面Kimi联合清华等机构推出的大模型推理架构
|
弹性计算 安全 应用服务中间件
阿里云网络系列之经典网络和专有网络
阿里云面向客户提供的网络类型服务有经典网络和专有网络两种,但这两者有什么区别呢?阿里官网给的解释是: 经典网络:IP地址由阿里云统一分配,配置简便,使用方便,适合对操作易用性要求比较高、需要快速使用 ECS 的用户。
94869 1
|
Linux
linux 定时任务,每小时执行一次
每小时执行一次为  0  */1  *  *  *  这种写法。 注意的是,很容易粗心写成 *  */1  *  *  * 这种写法,代表每隔一小时每一分钟都执行一次
5361 0
解决ERROR in Conflict: Multiple assets emit different content to the same filename index.html 的问题
解决ERROR in Conflict: Multiple assets emit different content to the same filename index.html 的问题
1418 1
|
机器学习/深度学习 并行计算 PyTorch
使用anaconda配置标配版gpu的torch==1.2.0(30系列以下显卡)
使用anaconda配置标配版gpu的torch==1.2.0(30系列以下显卡)
使用anaconda配置标配版gpu的torch==1.2.0(30系列以下显卡)

热门文章

最新文章