CentOS / RHEL / Fedora Linux: Use Yum Command With A Proxy Server

To use the yum command with a proxy server on CentOS, RHEL, or Fedora Linux, you need to modify the /etc/yum.conf file and add the proxy server settings. Here’s how you can do this:

  1. Open the /etc/yum.conf file using a text editor:
sudo nano /etc/yum.conf
  1. Add the following lines to the file, replacing PROXY_HOST and PROXY_PORT with the hostname and port number of your proxy server:
proxy=http://PROXY_HOST:PROXY_PORT
  1. Save and close the file.
  2. Verify that the yum command is using the proxy server by running the following command:
yum info yum

If you have a username and password for your proxy server, you can add them to the proxy URL in the following format:

proxy=http://username:password@PROXY_HOST:PROXY_PORT

Note that the yum command will use the proxy server for all its operations, including downloading packages and metadata, until you remove or modify the proxy settings in the /etc/yum.conf file.

Leave a Comment