1

This error is showing up when using sudo apt get update:

E: Syntax error /etc/apt/apt.conf:2: Extra junk at end of file

error message from terminal

Lorenz Keel
  • 9,511

1 Answers1

1

In a comment, you wrote that the content of the file is:

Acquire::http::proxy “http://<proxy_server>:<port>/”;

In this case, the content of your apt.conf is not well-formed. If you need it to use apt behind a proxy, <proxy_server> and <port> should be replaced by the real values of proxy server and port.

Just as an example, you can check the question here to see how a proper apt.conf file is written.

Therefore, you have two possible solutions:

  1. Make a backup of the file by sudo mv /etc/apt/apt.conf /etc/apt/apt.conf.bak, then check if sudo apt-get update works (this may work only if you don't really need to be behind a proxy).
  2. Use sudo -H gedit /etc/apt/apt.conf and edit the file replacing the two placeholders with correct proxy server and port.
Lorenz Keel
  • 9,511