You are not logged in.

#1 2014-09-22 12:03:15

nugetchar
Member
Registered: 2014-08-09
Posts: 39
Website

[SOLVED} Setting Proxy doesn't work

Hi everyone,

I'm trying to go through a proxy with my ArchLinux, and in order to do this I run this script :

#!/bin/bash
# set utc proxy

export http_proxy=http://proxyweb.utc.fr:3128
export https_proxy=$http_proxy
export ftp_proxy=$http_proxy
export rsync_proxy=$http_proxy
export no_proxy="localhost,127.0.0.1,greta,localaddress,.localdomain.com"

But when I want, for example, to launch a "sudo pacman -S something", I can't go through the proxy. Do you have any idea why this isn't working ?

Thanks in advance.

Last edited by nugetchar (2014-09-22 13:17:55)

Offline

#2 2014-09-22 12:24:42

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: [SOLVED} Setting Proxy doesn't work

Don't run it, source it.


This silver ladybug at line 28...

Offline

#3 2014-09-22 12:29:10

nugetchar
Member
Registered: 2014-08-09
Posts: 39
Website

Re: [SOLVED} Setting Proxy doesn't work

I'm sorry, I do not understand what you mean by "source it" ? I wrote it into my ~/.bashrc but it still does not work, which is strange because a "echo $http_proxy" gives me the right output...

Offline

#4 2014-09-22 12:39:25

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [SOLVED} Setting Proxy doesn't work

nugetchar wrote:

But when I want, for example, to launch a "sudo pacman -S something", I can't go through the proxy. Do you have any idea why this isn't working ?

sudo changes your environment, and maintains a whitelist of what it allows to "leak" through to the new user session. You can use the -E flag to preserve the environment, or you can specifically whitelist variables in sudoers with the env_keep directive.

Offline

#5 2014-09-22 12:55:55

nugetchar
Member
Registered: 2014-08-09
Posts: 39
Website

Re: [SOLVED} Setting Proxy doesn't work

Thank you, it works !
But there is still a little problem : I cannot use yaourt with "sudo -E yaourt -S something". How could I fix it ?

Thanks smile

Offline

#6 2014-09-22 13:17:33

nugetchar
Member
Registered: 2014-08-09
Posts: 39
Website

Re: [SOLVED} Setting Proxy doesn't work

Nevermind, I put the line "Defaults env_keep += "ftp_proxy http_proxy https_proxy no_proxy" which, combined with the export in the bashrc, allow me to go through the proxy even with the yaourt command.

Thanks for your help !

Offline

Board footer

Powered by FluxBB