我正在尝试为客户虚拟机配置一些代理,现在我得到:
sudo apt-get update
E: Syntax error /etc/apt/apt.conf.d/95proxy:4: Extra junk at end of file
该文件的内容是:
cat /etc/apt/apt.conf.d/95proxy
Acquire::http::proxy "http://10.0.0.60:3128/"
Acquire::ftp::proxy "http://10.0.0.60:3128/"
Acquire::https::proxy "http://10.0.0.60:3128/"
答案1
问题是我没有为配置文件设置行尾分号。它应该看起来像这样:
Acquire::http::proxy "http://10.0.0.60:3128/";
Acquire::ftp::proxy "http://10.0.0.60:3128/";
Acquire::https::proxy "http://10.0.0.60:3128/";
阅读手册页:
每行的形式为
APT::Get::Assume-Yes "true";
。引号和尾随分号是必需的。
如果使用范围为多行大括号它应该看起来:
APT {
Get {
Assume-Yes "true";
Fix-Broken "true";
};
};