LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-28-2009, 01:52 AM   #1
soltanloo
Member
 
Registered: Jun 2009
Posts: 39

Rep: Reputation: 15
proxy setting in bash for using yum


hi, im very new to linux. my linux box in the office has an a proxy server to access the internet. i can set this on my browsers. id like to know how i give my shell (bash) the proxy server settings so i can wget,yum install perl modules, etc. on my shell terminal without problems.

i used
Code:
export http_proxy=http://<proxy-server-ip>:<port>
for example

Code:
export http_proxy=http://bsc.aut.ac.ir:8080
and also i did this for ftp.
but i doesn't work.
 
Old 09-28-2009, 02:16 AM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Hi soltanloo,

Proxy settings vary per application - 'wget' will read the 'http_proxy' environment variable but 'yum' will not, you will need to set it in /etc/yum.conf

cheers
 
Old 09-29-2009, 01:59 AM   #3
soltanloo
Member
 
Registered: Jun 2009
Posts: 39

Original Poster
Rep: Reputation: 15
thank u
but how can i edit etc/yum.conf ?
my yum.conf contains :

Code:
[main]
cachedir=/var/cache/yum
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=3

#  This is the default, if you make this bigger yum won't see if the metadata
# is newer on the remote and so you'll "gain" the bandwidth of not having to
# download the new metadata and "pay" for it by yum not having correct
# information.
#  It is esp. important, to have correct metadata, for distributions like
# Fedora which don't keep old packages around. If you don't like this checking
# interupting your command line usage, it's much better to have something
# manually check the metadata once an hour (yum-updatesd will do this).
# metadata_expire=90m

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
Type  :quit<Enter>  to exit Vim                               5,1           All
 
Old 09-29-2009, 02:04 AM   #4
soltanloo
Member
 
Registered: Jun 2009
Posts: 39

Original Poster
Rep: Reputation: 15
in fact i'm trying to install sysstat package. i juct know
Code:
yum install sysstat
. and it needs proxy setting to connect to the network.
also i tried to do it with a rpm packet. but it takes an our to download , and it's still downloading and nothing has happened.
 
Old 09-29-2009, 07:38 AM   #5
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Just add this line:

Code:
http_proxy=http://bsc.aut.ac.ir:8080
cheers
 
Old 09-30-2009, 02:13 AM   #6
soltanloo
Member
 
Registered: Jun 2009
Posts: 39

Original Poster
Rep: Reputation: 15
hi

i put this code in /etc/yum.conf and now it works.
Code:
proxy=http://xxx.xx.xx:8080
proxy_username=xxxxx
proxy_password=xxxxxx
 
Old 09-30-2009, 05:01 PM   #7
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Yeah sorry, I realised yesterday that I'd given you the wrong line, you can combine it if you like as well :

Code:
proxy=http://username:password@yourproxy.tld:8080
cheers
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to switch between a proxy and no proxy connection for yum jaycee4u Fedora 3 09-04-2009 01:14 AM
YUM through proxy? your_shadow03 Linux - Newbie 18 04-22-2009 03:32 AM
YUM with proxy watcher69b Linux - Software 5 04-22-2008 07:08 AM
yum thru proxy a1ex_007 Fedora 7 06-29-2005 10:30 AM
Proxy + Yum beatlelane Fedora 9 12-17-2003 08:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration