How to Configure Proxy for Yum Repository on Linux Operating Systems

In this article, we will see how to Configure Proxy for Yum Repository. If our servers are accessing the internet via a “Proxy Server“, we can see that even if we can access the internet when we run a command such as “yum install package-name“, we can’t access it. In such a case, the settings that we will talk about in our article should be made.
1. We open the “etc/yum.conf” file on our server and edit it as follows.
# vim /etc/yum.conf
-- Open the file and edit the following information.
proxy=http://yourproxyaddress:port/
proxy_username=youruser
proxy_password=yourpassword
Sample ;
proxy=proxy.koraykey.net:8080
proxy_username=koray_gunduz
proxy_password=our password
-- If our Proxy Server exit without authentication
If so, we can leave the following parameters blank.
proxy_username=youruser
proxy_password=yourpassword
2. After this process, when we try to install the package again, we will see that it has been successfully installed.
-- We can use the following example commands to install a package.
# yum install packagename
# yum install httpd
-- We can use the following command to Update our Operating System.
This command will do all updates without confirmation from us
# yum -y update
-- If we want to update our Operating System with approval
# yum update
- If we need to configure the “
Proxy Server” on the command line at our request, we must enter the following variables in our “.bash_profile” file.
# cd
# vim .bash_profile
-- Open the file and type the following on an appropriate line.
We enter our variable.
HTTP_PROXY=http://yourproxyaddress:80/ export HTTP_PROXY
Sample;
HTTP_PROXY=proxy.koraykey.net:8080 export HTTP_PROXY
In this way, we have finished the installation.
I hope it was a useful article.
