56

I'm trying to configure some proxies for a guest virtual machine and now I'm getting:

sudo apt-get update
E: Syntax error /etc/apt/apt.conf.d/95proxy:4: Extra junk at end of file

The content of the file is:

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 Answer 1

73

The problem was that I wasn't setting up the end of line semicolons for the configuration file. It should look like this:

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/";

Reading the man page:

Each line is of the form APT::Get::Assume-Yes "true";. The quotation marks and trailing semicolon are required.

In case of multiple lines using scopes with curly braces it should looks:

APT {
  Get {
    Assume-Yes "true";
    Fix-Broken "true";
  };
};
7
  • "curly brakes"? Surely you mean "wiggly parentheses" Sep 20, 2013 at 18:23
  • @joeytwiddle I meant hammered parentheses, but then it wouldn't make sense...
    – Braiam
    Sep 20, 2013 at 18:44
  • 1
    This can also happen if you use "single quote" instead of "double quote". Just happened to me. Jul 10, 2015 at 10:42
  • 1
    You mean, "single quote", instead of 'double quote'? Nov 30, 2018 at 16:38
  • 1
    Also note that there should be double quote! Aug 31, 2020 at 3:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .