You are not logged in.

#1 2013-09-11 16:53:23

parinporecha
Member
From: India
Registered: 2013-09-10
Posts: 3

[SOLVED] Pacman and yaourt not working when run with "sudo"

Hi,

I am an Arch newbie, just installed Arch 3.10 on my machine. I access internet through a proxy server and I'm facing this strange problem -

Pacman is unable to fetch packages when I run it through sudo - "sudo pacman -S smplayer" (It gives network unreachable error).
However when I run it through root, it retrieves those same packages successfully.
yaourt also faces a similar kind of problem -
When I run it through sudo or as root, it is unable to retrieve packages which can be downloaded by pacman. But, when I run pacman to download those same packages, it is able to do so.

I am using gnome 3.8, and use radiotray ( It's for listening online radios ). When I run it via 'Alt-F2' or as a startup application, it's not able to connect to any radio station ( which means it's not connecting to the internet ). However, on running it via terminal, it connects to the internet successfully. Are these 2 problems related ? I'm facing the first one even without loading gnome, so it's not gnome's problem, i guess.

I can ping successfully through my administrator as well as root account, connect to the internet via browser, and ssh, git, bzr are also working fine.

What can I do to resolve this ?

Thanks

Last edited by parinporecha (2013-09-12 06:01:06)

Offline

#2 2013-09-11 17:57:17

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [SOLVED] Pacman and yaourt not working when run with "sudo"

How did you configure Arch Linux to use the proxy server? Please post the configuration files you used to configure it.

Also, there's no such thing as "Arch 3.10". wink Do you mean you used the installation media from 2013.09.01?

Last edited by drcouzelis (2013-09-11 17:59:02)

Offline

#3 2013-09-11 18:05:56

parinporecha
Member
From: India
Registered: 2013-09-10
Posts: 3

Re: [SOLVED] Pacman and yaourt not working when run with "sudo"

To configure proxy, I added the line "export http_proxy=PROXY_LINK" to the bashrc files of user and root.

Regarding Arch 3.10, yes i meant the installation media from 2013.09.01 ( kernel 3.10 ) smile

Offline

#4 2013-09-11 18:21:51

henk
Member
From: Weert, Netherlands
Registered: 2013-01-01
Posts: 334

Re: [SOLVED] Pacman and yaourt not working when run with "sudo"

I recommend you should read this page carefully.

Offline

#5 2013-09-11 19:52:10

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: [SOLVED] Pacman and yaourt not working when run with "sudo"

parinporecha wrote:

To configure proxy, I added the line "export http_proxy=PROXY_LINK" to the bashrc files of user and root.

Regarding Arch 3.10, yes i meant the installation media from 2013.09.01 ( kernel 3.10 ) smile

That's why root works, but not sudo. Sudo clears the environment. See man sudo and man sudoers.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#6 2013-09-12 05:59:09

parinporecha
Member
From: India
Registered: 2013-09-10
Posts: 3

Re: [SOLVED] Pacman and yaourt not working when run with "sudo"

Adding

Defaults env_keep += "http_proxy https_proxy ftp_proxy"

to the sudoers file resolved the problem. (Found it in proxy settings page on wiki, as suggested by henk)

sudo and yaourt work fine now

Thank you for the help smile

Offline

Board footer

Powered by FluxBB