Bug 186054 - yum doesn't use proxy when launched from sudo context
yum doesn't use proxy when launched from sudo context
Status: CLOSED DUPLICATE of bug 185309
Product: Fedora
Classification: Fedora
Component: yum (Show other bugs)
5
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeremy Katz
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-03-21 07:37 EST by stef
Modified: 2014-01-21 17:53 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-04-19 16:41:48 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description stef 2006-03-21 07:37:23 EST
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 08:06:04 EST
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 10:04:52 EST
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 04:53:19 EST
(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 04:56:24 EST
(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 16:41:48 EDT

*** 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.