• Home
  • Disclaimer
  • Contact
  • Archives
  • About
  • Subscribe
  • Support
  • Advertise

Kernel Talks

Unix, Linux & scripts.

  • How-to guides
    • Howto
    • Disk management
    • Configurations
  • OS
    • HPUX
    • Linux
  • Commands & tools
    • Commands
    • Software & Tools
    • System services
  • Cloud computing
    • AWS CSA associate quiz
    • AWS CSA preparation guide!
    • Cloud Services
  • Tips & Tricks
  • Linux commands
You are here: Home / Howto

How to configure proxy for YUM in RHEL, CentOS ?

Published: November 19, 2018 | Modified: November 19, 2018 | 514 views




A quick tutorial to configure proxy for YUM in RHEL, CentOS or Fedora Linux.

Proxy configuration in YUM in RHEL, CentOS, Fedora
Proxy configuration in YUM in RHEL, CentOS, Fedora

 


1. Enable proxy for yum in configuration file. (global)

If your server is connected to internet via proxy server then you can define it in configuration file located at /etc/yum.conf. For definition you should have below details ready with you  –

  1. Proxy server IP or hostname
  2. Port to be used for proxy connectivity
  3. User ID and password for authenticating you at proxy if enabled on proxy

Now, edit /etc/yum.conf using any text editor like vi and edit below parameters :

Shell
1
2
3
4
5
 
proxy=http://kerneltalksproxy.com:3487
proxy_username=shrikant
proxy_password=funWif#92cE
 

where –

kerneltalksproxy.com : Proxy server name
3487 : Port
Username for proxy authentication : shrikant
Password for proxy authentiction : funWif#92cE

Save and exit. List repo to verify internet connectivity using yum repolist.

Using this method you are configuring proxy within YUM configuration which will be used or available for all users on system whenever they use yum commands.


2. Using profile proxy (User specific)

If you dont want global proxy setup through /etc/yum.conf file then you can opt to define proxy at user level by defining it in user’s individual profile files. Add below config in .profile ( .profile file has different names depends on which login shell you are using) of the user so that it will be loaded every time user logged in to system.

Shell
1
2
3
4
 
http_proxy="http://shrikant:funWif#92cE@kerneltalksproxy.com:3487"
export http_proxy
 

If proxy dont need authentication then you can remove username, password portion and configure rest of the part –

Shell
1
2
3
4
 
http_proxy="http://kerneltalksproxy.com:3487"
export http_proxy
 

So, this proxy setting will be available for all applications who uses system proxy (like curl, yum) under that user’s login. Ask user to login and verify proxy by refreshing yum repo.


 

⇠ Previous article
How to enter single user mode in SUSE 12 Linux?
Next article ⇢
How to connect Windows EC2 AWS server using RDP?

Related stuff:

  • How to get directory size in Linux
  • Root disk mirroring in itanium HPUX
  • How to remove password expiry in linux
  • How to disable direct root login on Linux & HPUX
  • Step by step procedure to take ignite tape backup in HPUX
  • How to disable iptables firewall temporarily
  • How to add Cloundfront CDN in WordPress blog with SSL
  • File encryption / password protect file in HPUX
  • How to check and test APA in HPUX
  • How to install patch/software in HPUX
  • How to run your script with system boot in HPUX
  • How to setup domain name in Linux server

Filed Under: Howto Tagged With: enable proxy in yum, how to use proxy in yum, yum proxy configuration

If you like my tutorials and if they helped you in any way, then

  • Consider buying me a cup of coffee via paypal!
  • Subscribe to our newsletter here!
  • Like KernelTalks Facebook page.
  • Follow us on Twitter.
  • Follow our Google+ page.
  • Add our RSS feed to your feed reader.

Share Your Comments & Feedback: Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Get fresh content from KernelTalks

  • Email
  • Facebook
  • Google+
  • RSS
  • Twitter

Popular posts

  • mount.nfs: requested NFS version or transport protocol is not supported
  • How to reset iptables to default settings
  • How to rescan disk in Linux after extending vmware disk
  • 4 ways to check size of physical memory (RAM) in Linux
  • How to setup domain name in Linux server
  • 5 steps guide for SMTP configuration in Linux
  • How to remount filesystem in read write mode under Linux
  • How to enable repository using subscription-manager in RHEL
  • Difference between /etc/passwd and /etc/shadow
  • How to configure login banners in Linux (RedHat, Ubuntu, CentOS, Fedora)

Get Linux & Unix stuff right into your mailbox. Subscribe now!

* indicates required

This work is licensed under a CC-BY-NC license · Privacy Policy
© Copyright 2016-2017 KernelTalks · All Rights Reserved.
The content is copyrighted to Shrikant Lavhate & can not be reproduced either online or offline without prior permission.

  • Learn Linux Unix: File permissions & ownership
  • 5 steps guide for SMTP configuration in Linux
  • How to enter single user mode in SUSE 12 Linux?
  • LVM commands tutorial : Part 2 : Volume group (vgcreate, vgdisplay, vgscan)
  • How Docker container DNS works
  • How to configure nameserver in Linux
  • Building different types of software depots in HPUX
  • Restore network Ignite backup on HPUX server
  • All you need to know about sosreport tool
  • Account lock unlock status in Linux