为什么我删除并重新创建“/tmp”、“/var/tmp”和“/var/log”后,apt 会出错?

为什么我删除并重新创建“/tmp”、“/var/tmp”和“/var/log”后,apt 会出错?

为什么运行以下命令后会出现错误?

sudo rm -r /tmp
sudo rm -r /var/tmp
sudo rm -r /var/log

sudo mkdir /tmp
sudo mkdir /var/tmp
sudo mkdir /var/log
sudo apt update

错误信息:

Couldn't create temporary file /tmp/apt.conf.RFX4BR for passing config to apt-key
Couldn't create temporary file /tmp/apt.conf.GuJXFx for passing config to apt-key
(truncated)

答案1

/tmp/需要是

drwxrwxrwt  20 root     root      4096 jun  5 21:03 tmp

/var/tmp并且/var/log需要:

drwxrwxr-x 13 root syslog   4096 jun  4 00:00 log
drwxrwxrwt 13 root root     4096 jun  5 04:09 tmp

sudo chmod 1777请使用和调整上述内容,sudo chown root:root将两个tmp和调整为“对数”。然后使用和sudo chown root:syslog检查它是否与此处列出的内容相匹配。ls /ls /var/

相关内容