![运行 sudo apt-get -f install 时出错](https://linux22.com/image/847827/%E8%BF%90%E8%A1%8C%20sudo%20apt-get%20-f%20install%20%E6%97%B6%E5%87%BA%E9%94%99.png)
E: Waited for /usr/sbin/dpkg-preconfigure --apt || true but it wasn't there
E: Failure running script /usr/sbin/dpkg-preconfigure --apt || true
我知道这个问题之前已经问过,但给出的答案返回错误。Ubuntu 版本 10.04.3
$ sudo sh -c "echo 'DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-pr econfigure --apt || true";};' >> /etc/apt/apt.conf.d/70debconf"
econfigure: 1: Syntax error: Unterminated quoted string
sh: true;};' >> /etc/apt/apt.conf.d/70debconf: not found
答案1
使用
echo 'DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt || true";};' | sudo tee -a /etc/apt/apt.conf.d/70debconf
代替
sudo sh -c "echo 'DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-pr econfigure --apt || true";};' >> /etc/apt/apt.conf.d/70debconf"