为什么运行以下命令后会出现错误?
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/