[Linux] Ubuntu proxy configuration

Source: Internet
Author: User
Apt-Get sets proxy method

Method 1: This is a temporary method. If you only need to use apt-Get through HTTP Proxy temporarily, you can use this method.
Before using apt-Get, enter the following command in the terminal:
Export HTTP Proxy = http: // yourproxyaddress: proxyport
It is said that the use of the proxy is canceled: Export http_proxy = "" No, try unset http_proxy;

Method 2:
This method uses the apt. conf file in the/etc/APT/folder. If you want apt-Get (instead of other applications) to always use HTTP proxy, you can use this method.
In some cases, the apt configuration file is not created during system installation. You can create one by yourself.

Sudo Vim/etc/APT/apt. conf Add the following line to your apt. conf file:

Acquire: http: proxy "http: // yourproxyaddress: proxyport"; Save the apt. conf file.

Method 3:
This method adds two lines to the. bashrc file in your home directory. If you want apt-Get and other applications such as wget to use this method.

Vim ~ /. Bashrc Add the following content at the end of your. bashrc file:
Http_proxy = http: // yourproxyaddress: proxyport
Export http_proxy saves the file. Close the current terminal and open another terminal.
Use apt-Get update or any network tool you want to use to test the proxy. You can use firestarter to view active network connections.

If you modify the configuration file again to correct the error, close the terminal and open it again. Otherwise, the new settings will not take effect.

After someone cancels the proxy in the following way on the Internet (you can choose "system"> "Preferences"> "network proxy"> "select to connect directly to the Internet, and then click" OK "to exit ), apt-Get still uses the original agent, so it is impossible to update and install the software. In my opinion, the agent set during system installation may have been written to apt. conf configuration file. Check apt. conf
Content in, if there is proxy settings in it, it should be OK to delete, I have not tried, just guess, haha ~

There is also a way to cancel Proxy: Command to cancel Proxy: unset http_proxy
This is done, but you need to enter this command every time you start the system.

Broadband dialing in Ubuntu:

Run the following command on the terminal: sudo pppoeconf.
Then follow the prompts to go to the next step. You need to enter the ADSL user name and password in the middle.
After the configuration is complete, you will be prompted whether to automatically connect when the system is started. If you select Yes, the system will automatically dial the Internet connection every time you log on to Ubuntu.

In the future, you need to manually dial, open the terminal, and enter the command:
Sudo Pon DSL-provider
Manual disconnection: sudo poff;
View connection status: plog and ifconfig ppp0
Ifconfig ppp0 can be used to query the local Internet IP Address

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.