Thursday, May 23, 2024
rated 0 times [  21] [ 0]  / answers: 1 / hits: 89547  / 2 Years ago, sun, october 9, 2022, 6:41:14

I tried to reset proxy of the terminal by some commands but it doesn't happen and automatically switches back to this proxy (which apparently was my college proxy).

I checked in my system settings.I don't understand why this is recurring.

Please be comprehensive.Also I further would like to know how to bypass proxy server since I couldn't access any of the ubuntu repositories as they were blocked in my college's proxy settings as is Ubuntu's homepage.

Thanks for your time.
Terminal snapshot

sudo ls /etc/apt/apt.conf.d/
It displays a different set of options where proxy is not listed.I am on 12.10,if this should help any.I put a snap of the terminal after the above command has been entered.
ls Command entered

More From » command-line


Ubuntu 12.10 will set proxy settings both in /etc/environment and /etc/apt/apt.conf when you set proxy from GUI (Network Settings).

Check your apt settings

grep -Hnri proxy /etc/apt/

will list out the current proxy settings used by apt in the following format.


If you see any output, it corresponds to apt's proxy settings. They will have to be cleared.

sudoedit <filename>

will allow you to edit the corresponding configuration file. Copy the existing contents somewhere in case you need to restore them, and delete or comment the lines that look like

Acquire::<protocol>::proxy=<your proxy here>

(Add // at the beginning of a line to comment that line. Commented lines are ignored.)

Save the files, close the text editor, and retry. If the problem persists,

Check global default environment.

grep proxy -i /etc/environment

Should list any proxy settings that are applied globally. If you need to clear them,

sudoedit /etc/environment

will fire up the text editor. Lines that start with # will be ignored, so add a # before those lines that mention your proxy settings. Save the file and retry.

Cleaning the user environment

It is possible that the systemwide configuration is clean but apt is picking up proxy settings from the user's environment. sudoin certain configurations by default, or when explicitly passed -E as an option, preserves the environment.

env | grep -i proxy

should list out any current environment proxy settings. unset <variable> can be used to unset or clear a variable. Unset all <protocol>_proxy variables. If they are automatically being set, you might comment out the corresponding entries from ~/.profile, ~/.bashrc, ~/.pam_environment

(Those are the most common files that contain the entries. All of them can be searched at once using grep -Hni proxy ~/.profile ~/.bashrc ~/.pam_environment )

[#33992] Sunday, October 9, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.

Total Points: 396
Total Questions: 90
Total Answers: 106

Location: Saint Lucia
Member since Sun, Sep 5, 2021
3 Years ago
biryanrownies questions
Wed, Sep 7, 22, 18:13, 2 Years ago
Fri, Dec 3, 21, 02:50, 3 Years ago
Sat, Feb 12, 22, 16:02, 2 Years ago
Sat, Apr 15, 23, 09:22, 1 Year ago