Detailed explanation of how to configure DNF proxy on Centos8

藏色散人
Release: 2021-01-06 16:37:16
forward
4294 people have browsed it

The following is the tutorial column of centos to introduce to you the Centos8 configuration DNF proxy method. I hope it will be helpful to friends in need!

Detailed explanation of how to configure DNF proxy on Centos8

##centos 8 Configuring DNF proxy method Centos 8 uses dnf instead of yum by default. The original yum configuration file (/etc/yum.conf) is linked to the dnf configuration file (/etc/dnf/dnf.conf) by default
Originally, you only need to change the yum configuration file for proxying The setting method is no longer easy to use.
Centos 8 needs to be modified as follows

cat /etc/dnf/dnf.conf[main]gpgcheck=1
installonly_limit=3
clean_requirements_on_remove=True#best=Trueproxy=http://Proxy_Ip:port
proxy_username=username
proxy_password=password
Copy after login
Copy after login

Modify /etc/rhsm/rhsm.conf (there is no need to create it yourself)


cat /etc/rhsm/rhsm.conf

proxy_hostname = Proxy_Ip
proxy_port = Port
proxy_user = Username
proxy_password = Password
Copy after login
Copy after login

After the above settings are completed, dnf may still not be available. Install, then change the source configuration.

centos 8 uses three sources by default, the locations are as follows

/etc/yum.repos.d/CentOS-AppStream.repo
/etc/yum.repos.d/CentOS-Base.repo
/etc/yum.repos.d/CentOS-Extras.repo
Copy after login
Copy after login

Each repo file has two addresses, one starting with "mirrorlist=" and the other "baseurl=", the default is "mirrorlist=" , if you still cannot use dnf after configuring the proxy, comment out the addresses starting with "mirrorlist=" in the above three files and use the addresses starting with "baseurl=".

centos 8 Configuring DNF proxy method

centos 8 uses dnf instead of yum by default, the original yum configuration file (/etc/ yum.conf) is linked to the dnf configuration file (/etc/dnf/dnf.conf) by default
The original method of simply changing the yum configuration file for proxy settings is no longer easy to use.
centos 8 needs to be modified as follows

cat /etc/dnf/dnf.conf[main]gpgcheck=1
installonly_limit=3
clean_requirements_on_remove=True#best=Trueproxy=http://Proxy_Ip:port
proxy_username=username
proxy_password=password
Copy after login
Copy after login

Modify /etc/rhsm/rhsm.conf (there is no need to create it yourself)

cat /etc/rhsm/rhsm.conf

proxy_hostname = Proxy_Ip
proxy_port = Port
proxy_user = Username
proxy_password = Password
Copy after login
Copy after login

After the above settings are completed, you may still be unable to use dnf to install, continue Come down and change the source configuration.

centos 8 uses three sources by default, the locations are as follows

/etc/yum.repos.d/CentOS-AppStream.repo
/etc/yum.repos.d/CentOS-Base.repo
/etc/yum.repos.d/CentOS-Extras.repo
Copy after login
Copy after login

Each repo file has two addresses, one starting with "mirrorlist=" and the other "baseurl=", the default is "mirrorlist=" , if you still cannot use dnf after configuring the proxy, comment out the addresses starting with "mirrorlist=" in the above three files and use the addresses starting with "baseurl=".

The above is the detailed content of Detailed explanation of how to configure DNF proxy on Centos8. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template