解决报错: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 签约作者,欢迎关注我分享更多干货!



目录
相关文章
|
8月前
|
关系型数据库 MySQL 数据库
Mysql-错误处理: Found option without preceding group in config file
Mysql-错误处理: Found option without preceding group in config file
872 0
|
分布式计算 安全 Hadoop
hdfs mkdir报错Cannot create directory /usr. Name node is in safe mode.
hdfs mkdir报错Cannot create directory /usr. Name node is in safe mode.
423 0
|
Linux
【Linux】locate: can not stat () `/var/lib/mlocate/mlocate.db‘: No such file or directory
【Linux】locate: can not stat () `/var/lib/mlocate/mlocate.db‘: No such file or directory
221 0
【Linux】locate: can not stat () `/var/lib/mlocate/mlocate.db‘: No such file or directory
|
运维
yum update 执行报错: error : unpacking of archive failed on file /usr/.../...;5d26ff7c: cpio : symlink
yum update 执行报错: error : unpacking of archive failed on file /usr/.../...;5d26ff7c: cpio : symlink早前已发现有台机一直在报这么个错误, 一用yum update 就报一堆: Error: unpacking rpm package .
2417 0

热门文章

最新文章