4

I want to use the Ubuntu Software Center to install software, but I cannot download them.

How can I give my proxy settings in Ubuntu terminal (just like we use cmd in Windows to choose IE proxy settings)?

3 Answers 3

3

You can easily change the proxy settings for your user, or for the entire system, within the Network config under System Settings. This uses the GUI and is quick and helpful, but not very advanced. If you have particular requirements or special settings/circumstances, this may not do everything you need.

  1. Open System Settings
  2. Choose Network
  3. In the left hand menu, choose Network Proxy
  4. Enter your proxy settings. If you want to apply them system wide, press that button.
  5. Close the window, or presss All Settings to leave this interface.

You should be all set. You may have to logout and login again for changes to take affect. In unusual circumstances, you may have to reboot your system, but that is highly unlikely for a Linux system. Network Manager Proxy dialogue

1
  • 1
    That's not a terminal solution, but a good one. Sep 24, 2014 at 3:33
2

proxy setting from terminal in ubuntu:
Open the terminal and run the following commands:
For a HTTP proxy, simply run the following command in a terminal

export http_proxy='http://proxy_username:password@proxy_ip:port'

For a HTTPs and FTP

export https_proxy='https://proxy_username:password@proxy_ip:port'
export ftp_proxy='ftp://proxy_username:password@proxy_ip:port'

If there is no username and password required for your proxy then simply remove the username and password section.

export https_proxy='https://proxy_ip:port'

These settings are saved into /etc/apt/apt.conf file .So you can directly add these variables using text editor .First open the apt.conf file

sudo gedit /etc/apt/apt.conf

then enter the username,password,proxy_ip and port in given format

Acquire::http::proxy "http://proxy_username:password@proxy_ip:port";
Acquire::https::proxy "https://proxy_username:password@proxy_ip:port";
Acquire::ftp::proxy "ftp://proxy_username:password@proxy_ip:port";
2
  • I can't find /etc/apt/apt.conf file. Is there any alternative to this file ?
    – firmanium
    Apr 5, 2018 at 2:13
  • I also want to try the first solution using export, but my username is "domainname\firman" how should I write the syntax ? Thank You
    – firmanium
    Apr 5, 2018 at 3:41
1

Add

http_proxy='http://proxy_username:password@proxy_ip:port'
https_proxy='https://proxy_username:password@proxy_ip:port'
ftp_proxy='ftp://proxy_username:password@proxy_ip:port'

to /etc/environment to load them automatically at login (or system start - I might look that up if it matters).

You must log in to answer this question.

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