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
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
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:
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).sudo -H gedit /etc/apt/apt.conf
and edit the file replacing the two placeholders with correct proxy server and port.
sudo apt-get update
, orsudo apt update
. run the correct command and check if the problem is still present. – Lorenz Keel Jun 02 '22 at 10:22cat /etc/apt/apt.conf
: you can fix the error only if you check the file content (as the error suggests to you) – Lorenz Keel Jun 02 '22 at 10:45apt.conf
Acquire::http::proxy “http://<proxy_server>:/”;
– Anmol Chooudhary Jun 02 '22 at 13:27cat -A /etc/apt/apt.conf
to your question using the [edit] button – steeldriver Jun 02 '22 at 13:51