You are not logged in.

#1 2010-04-19 21:42:39

plutus
Member
Registered: 2010-03-20
Posts: 44

sudo pacman behind a proxy...

I've installed arch on a pc which is behind a proxy. No problem after using
export http_proxy=...

the point is that if I enter the system as root (or su) I can use pacman but, if I give a sudo pacman (as a user) I can not access the network.

Sudo works fine, the problem is that I can not manage the proxy as a simple user...as a SU everuthing is fine

I've also repated the export http(ftp)_proxy command as a user but without success

Offline

#2 2010-04-19 23:08:57

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: sudo pacman behind a proxy...

What do you mean by "Can't use pacman"? Does it spit out an error, or simply not open?

Last edited by cesura (2010-04-19 23:09:26)

Offline

#3 2010-04-19 23:12:23

plutus
Member
Registered: 2010-03-20
Posts: 44

Re: sudo pacman behind a proxy...

can not connect

Offline

#4 2010-04-19 23:27:47

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: sudo pacman behind a proxy...

The issue is something to do with the way your environment is translated across to the sudo session. I don't fully understand *how* this works, but adding this to your .bashrc make the HTTP_PROXY etc environment vars pass across OK so the `sudo pacman` instance can use them:

alias sudo="sudo "

Offline

#5 2010-04-19 23:34:39

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: sudo pacman behind a proxy...

plutus wrote:

can not connect

Oh, sorry. I read it over again and saw the problem cool

Anyway, I'm having the same thoughts as fukawi2. Probably a problem with the environment.

Offline

#6 2010-04-20 07:24:43

plutus
Member
Registered: 2010-03-20
Posts: 44

Re: sudo pacman behind a proxy...

same problem: connection refused... sad

Offline

#7 2010-04-20 14:46:31

ataraxia
Member
From: Pittsburgh
Registered: 2007-05-06
Posts: 1,553

Re: sudo pacman behind a proxy...

Add http_proxy and ftp_proxy to env_keep (in sudoers) so sudo won't clear it. It's also convenient to put a few other common things in there:

Defaults env_keep += "http_proxy ftp_proxy EDITOR VISUAL PAGER LESS"

This is documented in the suoders man page.

Offline

#8 2010-04-20 15:38:36

plutus
Member
Registered: 2010-03-20
Posts: 44

Re: sudo pacman behind a proxy...

thanks for helping, I'll give a try

Offline

#9 2010-04-20 16:21:03

Moo-Crumpus
Member
From: Hessen / Germany
Registered: 2003-12-01
Posts: 1,487

Re: sudo pacman behind a proxy...

As far as I know, you need to use wget as download tool. There is something like /etc/wgetrc, where you can edit your Proxy settings, or you can edit pacman.conf, to make wget use proxy login.


Frumpus addict
[mu'.krum.pus], [frum.pus]

Offline

#10 2010-04-20 22:34:28

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: sudo pacman behind a proxy...

Moo-Crumpus wrote:

As far as I know, you need to use wget as download tool. There is something like /etc/wgetrc, where you can edit your Proxy settings, or you can edit pacman.conf, to make wget use proxy login.

That will also work, but you don't NEED to do that to use a proxy. I use a proxy both at home and work with pacman and sudo using the method I posted above.

Last edited by fukawi2 (2010-04-20 22:35:02)

Offline

#11 2010-04-21 06:08:38

plutus
Member
Registered: 2010-03-20
Posts: 44

Re: sudo pacman behind a proxy...

I've already edited the pacman.conf and it works for the user&the SU...no way for sudo. I'll give a try later.
The point is that I would like to use the proxy settings in system-->preferences > proxy settings via the gnome GUI as I use a proxy at work but not at home...

Offline

#12 2010-04-21 13:59:05

plutus
Member
Registered: 2010-03-20
Posts: 44

Re: sudo pacman behind a proxy...

ok it works fine! smile

but: how can I use the GUI to configure the proxy?

thanks

Offline

#13 2010-04-21 23:17:39

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: sudo pacman behind a proxy...

plutus wrote:

but: how can I use the GUI to configure the proxy?

I *think* there's some funky hackery goes on when you open gnome-terminal that causes it to inherit the proxy settings from the GUI, but I'm not sure, and I wouldn't rely on it....

Offline

#14 2010-04-22 10:04:22

plutus
Member
Registered: 2010-03-20
Posts: 44

Re: sudo pacman behind a proxy...

fukawi2 wrote:
plutus wrote:

but: how can I use the GUI to configure the proxy?

I *think* there's some funky hackery goes on when you open gnome-terminal that causes it to inherit the proxy settings from the GUI, but I'm not sure, and I wouldn't rely on it....

well, under Ubuntu once you set the system proxy all is done...so I guess it's possible to tweak also arch

Offline

#15 2010-04-22 11:56:32

plutus
Member
Registered: 2010-03-20
Posts: 44

Re: sudo pacman behind a proxy...

anyway, the point is: at work I pass thru a proxy, at home not..how can I manage this?

Offline

#16 2010-04-22 11:58:05

Alex_Curth
Member
Registered: 2010-04-22
Posts: 1
Website

Re: sudo pacman behind a proxy...

Same problem.

Offline

#17 2010-08-24 19:09:27

vidar
Member
Registered: 2009-04-08
Posts: 9

Re: sudo pacman behind a proxy...

plutus wrote:

I've installed arch on a pc which is behind a proxy. No problem after using
export http_proxy=...

the point is that if I enter the system as root (or su) I can use pacman but, if I give a sudo pacman (as a user) I can not access the network.

Sudo works fine, the problem is that I can not manage the proxy as a simple user...as a SU everuthing is fine

I've also repated the export http(ftp)_proxy command as a user but without success


Yay, Thank you, you gave me the right clue..
I had configured a non existent proxy that  I used some time ago in my bashrc...

Its always about the trivial things ^^"

Last edited by vidar (2010-08-24 19:10:23)

Offline

Board footer

Powered by FluxBB