Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
147
rated 0 times [  147] [ 0]  / answers: 1 / hits: 514341  / 2 Years ago, fri, december 3, 2021, 12:04:52

I need to configure proxy. There wasn't apt.conf file in /etc/apt/ so I've created it using nano.


But I don't understand what I need to write there. I've written
http_proxy = http://lgn:[email protected]:8080/ there and then restarted networking. But when I try to apt-get update - it doesn't work.


Actually, I don't understand what port and IP I should write in apt.conf file (there was example with 192.168.1.254 IP and 8080 port, so I decided to use them).


More From » apt

 Answers
4

To use a proxy, you need a proxy server. The IP and port have to be from this proxy server. Login and pwd must be your user and password on the proxy server (if the proxy requires login).



From help.ubuntu.com site:




APT configuration file method



This method uses the apt.conf file which is found in your /etc/apt/ directory. This method is useful if you only want apt-get (and not other applications) to use a http-proxy permanently.



On some installations there will be no apt-conf file set up. Edit apt-conf file (or create a new one if you have no one yet) using the editor of your choice.



sudo nano /etc/apt/apt.conf


Add this line to your /etc/apt/apt.conf file (substitute your details for yourproxyaddress and proxyport).



Acquire::http::Proxy "http://yourproxyaddress:proxyport";


Save the apt.conf file.




If your proxy needs a login/password, substitute:



"http://yourproxyaddress:proxyport";


with:



"http://username:password@yourproxyaddress:proxyport";


using username and password from the proxy server.


[#32647] Saturday, December 4, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
cklaceowne

Total Points: 228
Total Questions: 102
Total Answers: 111

Location: Ivory Coast
Member since Sun, Mar 7, 2021
3 Years ago
;