Problem with apt-get behind a proxy after install

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
joselipo

Problem with apt-get behind a proxy after install

Post by joselipo »

I have just installed Linux Mint Maya using linuxmint-13-mate-dvd-32bit.iso file

I installed it in a computer connected to a network behind a proxy but did not add proxy info during installation.
After instalation, I added proxy info in the config application. This successfully recorded the proxy info, and when I wrote $http_proxy or $ftp_proxy on the command terminal I could see the correct proxy address. However, with the proxy correctly configured, apt-get did not work, being unable to connect to any server.

However, after that, and searching for information in the web, I solved the problem creating the file /etc/apt/conf.d./30proxy and adding there the proxy info:

Acquire::http::proxy "http://IP:8080/";
Acquire::ftp::proxy "ftp://IP:8080/";
Acquire::https::proxy "https://IP:8080/";

Where "IP" is the IP of the proxy. After this, I could sucessfully update my system.

It seems that apt-get searches for proxy information in two different places, or makes in some cases mistakes acquiring the proxy information.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
karlchen
Level 23
Level 23
Posts: 18225
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Problem with apt-get behind a proxy after install

Post by karlchen »

Hello, joselipo.

The problem may be that you configured the proxy settings in such a way that your personal environment holds all necessary environment variables pointing to the proxy address and proxy port. But user root's environment does not have the same variables set.
You may check whether this is the case by executing

Code: Select all

sudo -i
and inside the root shell

Code: Select all

env | grep -i proxy
Executing software updates will trigger root processes, though. So root needs to know your proxy settings as well.

The other problem which does exist is that not all software products honours the environment variables pointing to the proxy. There are software products which expect to find proxy names and ports inside their own configuration files.

Kind regards,
Karl
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 792 days now.
Lifeline
Locked

Return to “Beginner Questions”