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

Kernel Talks

Unix, Linux, & Cloud!

  • How-to guides
    • Howto
    • Disk management
    • Configurations
    • Troubleshooting
  • OS
    • HPUX
    • Linux
  • Miscellaneous
    • Software & Tools
    • Cloud Services
    • System services
    • Virtualization
  • Certification Preparations
    • AWS Certified Solutions Architect – Associate
    • AWS Certified Solutions Architect – Professional
    • AWS Certified SysOps Administrator – Associate
    • AWS Certified Cloud Practitioner
    • Certified Kubernetes Administrator
    • Hashicorp Certified Terraform Associate
    • Oracle Cloud Infrastructure Foundations 2020 – Associate
  • Tips & Tricks
  • Linux commands
You are here: Home / Howto

How to configure proxy for YUM in RHEL, CentOS ?

Published: November 19, 2018 | Modified: June 24, 2020



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

Proxy configuration in YUM in RHEL, CentOS, Fedora

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

If your server is connected to the internet via proxy server then you can define it in the configuration file located at /etc/yum.conf. For a 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 :

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 authentication: 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 the system whenever they use yum commands.

2. Using profile proxy (User specific)

If you don’t want global proxy setup through /etc/yum.conf file then you can opt to define proxy at the user level by defining it in the 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 the system.

http_proxy="http://shrikant:funWif#92cE@kerneltalksproxy.com:3487" 
export http_proxy

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

http_proxy="http://kerneltalksproxy.com:3487" 
export http_proxy

So, this proxy setting will be available for all applications who use system proxy (like curl, yum) under that user’s login. Ask the 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 establish passwordless ssh between two servers
  • How to get directory size in Linux
  • How to add Cloundfront CDN in WordPress blog with SSL
  • How to resolve the MFA entity already exists error
  • Highest size files in mount point
  • How to download the package using YUM or APT
  • How to move /tmp on a separate disk as a separate mount point
  • How to forward SSH key in Putty
  • How to enable repository using subscription-manager in RHEL
  • How to save top command output in file
  • How to upgrade kernel in RHEL, Suse, Ubuntu Linux
  • Create nice text banner in HPUX

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.
  • 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
  • RSS
  • Twitter

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-2021 KernelTalks · All Rights Reserved.
The content is copyrighted to Shrikant Lavhate & can not be reproduced either online or offline without prior permission.