Skip to main content
Bounty Awarded with 50 reputation awarded by Py-ser
edited with final solution.
Source Link
rubynorails
  • 2.4k
  • 17
  • 25

Final Edit: After chatting with the user, they removed /etc/apt/apt.conf.d/proxy.conf but were still getting the same issue, except instead of not resolving proxy_server, it was not resolving proxy.server, which led me to believe the proxy settings were getting set in another location.

I had them run grep -rlE 'Acquire::.*::Proxy' /etc/apt/, which returned /etc/apt/apt.conf.

I then instructed them to run grep -nE 'Acquire::.*::Proxy' /etc/apt/apt.conf, which returned the following:

...
5:Acquire::http::Proxy "http://user:[email protected]:port/";
6:Acquire::https::Proxy "http://user:[email protected]:port/";
...

This was essentially doing the same as /etc/apt/apt.conf.d/proxy.conf, only the hostname was proxy.server instead of proxy_server. Still dummy/example settings. After instructing them to comment out lines 5 and 6 and re-run the initial command of sudo apt update --fix-missing && sudo apt upgrade, they confirmed it was working correctly and fetching updates.

Final Edit: After chatting with the user, they removed /etc/apt/apt.conf.d/proxy.conf but were still getting the same issue, except instead of not resolving proxy_server, it was not resolving proxy.server, which led me to believe the proxy settings were getting set in another location.

I had them run grep -rlE 'Acquire::.*::Proxy' /etc/apt/, which returned /etc/apt/apt.conf.

I then instructed them to run grep -nE 'Acquire::.*::Proxy' /etc/apt/apt.conf, which returned the following:

...
5:Acquire::http::Proxy "http://user:[email protected]:port/";
6:Acquire::https::Proxy "http://user:[email protected]:port/";
...

This was essentially doing the same as /etc/apt/apt.conf.d/proxy.conf, only the hostname was proxy.server instead of proxy_server. Still dummy/example settings. After instructing them to comment out lines 5 and 6 and re-run the initial command of sudo apt update --fix-missing && sudo apt upgrade, they confirmed it was working correctly and fetching updates.

edited based on additional information
Source Link
rubynorails
  • 2.4k
  • 17
  • 25

Edit #2: If you do indeed need to connect to a proxy, then just keep /etc/apt/apt.conf.d/proxy.conf in place and replace proxy_server with the actual IP or hostname of the proxy server and port with the actual port number. Alternately, you can just replace port with the actual port number and create an entry in /etc/hosts for proxy_server pointing to the correct IP address of the actual proxy server.

Edit #2: If you do indeed need to connect to a proxy, then just keep /etc/apt/apt.conf.d/proxy.conf in place and replace proxy_server with the actual IP or hostname of the proxy server and port with the actual port number. Alternately, you can just replace port with the actual port number and create an entry in /etc/hosts for proxy_server pointing to the correct IP address of the actual proxy server.

edited based on additional information
Source Link
rubynorails
  • 2.4k
  • 17
  • 25

Edit: I corrected the grep command based on your comment, and after re-reading your question, if you are not wanting to connect to a proxy at all, simply mv /etc/apt/apt.conf.d/proxy.conf /tmp/ and re-run the command, and it should work just fine. If that's the only place that proxy_server turned up, then I'm not sure why removing the lines didn't work, but it's possible that proxy.conf is getting cached somewhere. By removing the file altogether, your proxy settings will probably get re-initialized.

The actual root of the problem is that you have dummy/example settings in /etc/apt/apt.conf.d/proxy.conf, which is literally trying to resolve the host proxy_server on port port. As you can tell, proxy_server doesn't actually exist, and port would have to be an actual port number in order for apt to connect successfully.

By removing the proxy.conf file (which is not required at all for apt to work, and doesn't ordinarily exist by default), you should be able to resolve this issue.

Edit: I corrected the grep command based on your comment, and after re-reading your question, if you are not wanting to connect to a proxy at all, simply mv /etc/apt/apt.conf.d/proxy.conf /tmp/ and re-run the command, and it should work just fine. If that's the only place that proxy_server turned up, then I'm not sure why removing the lines didn't work, but it's possible that proxy.conf is getting cached somewhere. By removing the file altogether, your proxy settings will probably get re-initialized.

The actual root of the problem is that you have dummy/example settings in /etc/apt/apt.conf.d/proxy.conf, which is literally trying to resolve the host proxy_server on port port. As you can tell, proxy_server doesn't actually exist, and port would have to be an actual port number in order for apt to connect successfully.

By removing the proxy.conf file (which is not required at all for apt to work, and doesn't ordinarily exist by default), you should be able to resolve this issue.

Correction
Source Link
rubynorails
  • 2.4k
  • 17
  • 25
Loading
additional info
Source Link
rubynorails
  • 2.4k
  • 17
  • 25
Loading
Source Link
rubynorails
  • 2.4k
  • 17
  • 25
Loading