dpkg 错误:“/etc/resolv.conf”和“/run/systemd/resolve/stub-resolv.conf”是同一个文件

dpkg 错误:“/etc/resolv.conf”和“/run/systemd/resolve/stub-resolv.conf”是同一个文件

朋友们,

我正在尝试在 Ubuntu 20.04 上安装该软件包software-properties-common,但运行后sudo apt-get install -y software-properties-common出现以下错误:

cp: '/etc/resolv.conf' and '/run/systemd/resolve/stub-resolv.conf' are the same
file

dpkg: error processing package systemd (--configure):
      installed systemd package post-installation script subprocess returned 
error exit status 1
Errors were encountered while processing:
   systemd
   E: Sub-process /usr/bin/dpkg returned an error code (1)

我尝试过这个:

sudo rm -f /etc/resolv.conf 
ln -s /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf  

之后我重启了系统并尝试再次安装该软件包,但没有成功。我遇到了同样的错误。有什么办法可以解决这个问题吗?

答案1

尝试这个:

$ mv resolv.conf resolv.conf.old

并尝试再次安装。

相关内容