Bug 186054 - yum doesn't use proxy when launched from sudo context
Summary: yum doesn't use proxy when launched from sudo context
Keywords:
Status: CLOSED DUPLICATE of bug 185309
Alias: None
Product: Fedora
Classification: Fedora
Component: yum
Version: 5
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeremy Katz
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-03-21 12:37 UTC by stef
Modified: 2014-01-21 22:53 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2006-04-19 20:41:48 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description stef 2006-03-21 12:37:23 UTC
Description of problem:

when you run  a yum command like 'sudo yum upgrade' or 'sudo yum install <package>' , it doesn't 
work.

doing a 'export http_proxy=http://proxy:8080' or adding the line 'proxy=http://proxy:8080' in /etc/
yum.conf doesn't change a thing.

works only if yum is started from a real root console.

Version-Release number of selected component (if applicable):


How reproducible:

always

Steps to Reproduce:
1.be a user declared in the sudoers 
2.launch 'sudo yum upgrade'
3.
  
Actual results:

yum fails to find the repositories

Expected results:

yum working

Additional info:

Comment 1 stef 2006-03-21 13:06:04 UTC
additional infos :

even launched from a root console (after doing a 'su' or 'su -'), you still need
to enter   'export http_proxy=http://proxy:8080' before issuing the 'yum
upgrade' command.

The parameter 'proxy=http://proxy:8080' in /etc/yum.conf is ignored.

Comment 2 Jeremy Katz 2006-03-21 15:04:52 UTC
By default, sudo now does some environment cleaning and only retains a certain
set of env vars to avoid the never-ending exploits due to preserved
environmental variables.  See /etc/sudoers for the list of what's kept.

proxy in yum.conf should work though

Comment 3 stef 2006-03-22 09:53:19 UTC
(In reply to comment #2)
> proxy in yum.conf should work though

Well it doesn't ...

here's an example output, the line 'proxy=http://proxy:8080' is present in
/etc/yum.conf.

[root@yuri ~]# yum upgrade
Loading "installonlyn" plugin
Setting up Upgrade Process
Setting up repositories
livna                                                                [1/4]
core                                                                 [2/4]
Cannot find a valid baseurl for repo: core
Error: Cannot find a valid baseurl for repo: core

[root@yuri ~]# export HTTP_PROXY=http://proxy:8080

[root@yuri ~]# yum upgrade
Loading "installonlyn" plugin
Setting up Upgrade Process
Setting up repositories
livna                                                                [1/4]
core                                                                 [2/4]
updates                                                              [3/4]
extras                                                               [4/4]
Reading repository metadata in from local files
No Packages marked for Update/Obsoletion


Comment 4 stef 2006-03-22 09:56:24 UTC
(In reply to comment #2)
> By default, sudo now does some environment cleaning and only retains a certain
> set of env vars to avoid the never-ending exploits due to preserved
> environmental variables.  See /etc/sudoers for the list of what's kept.

to be complete, the result as shown in comment #3 is ALSO true when running yum
from a real root login, not only a 'sudo' or a 'su'.


Comment 5 Jeremy Katz 2006-04-19 20:41:48 UTC

*** This bug has been marked as a duplicate of 185309 ***


Note You need to log in before you can comment on or make changes to this bug.