1

I've tried installing a CentOS 8 server behind a corporate proxy but I can't seem to figure out why it won't let me do any connection commands.

vi /etc/profile.d/proxy.sh
# proxy    settings
MB_PROXY_URL="http://username:password@proxy.domain.ltd:3128/"

http_proxy=$MB_PROXY_URL
https_proxy=$MB_PROXY_URL
ftp_proxy=$MB_PROXY_URL
no_proxy="127.0.0.1,localhost,domain.ltd,192.168.0.*"

HTTP_PROXY=$MB_PROXY_URL
HTTPS_PROXY=$MB_PROXY_URL
FTP_PROXY=$MB_PROXY_URL
NO_PROXY="127.0.0.1,localhost,domain.ltd,192.168.0.*"

export http_proxy https_proxy ftp_proxy no_proxy HTTP_PROXY HTTPS_PROXY FTP_PROXY NO_PROXY

# then run
source /etc/profile.d/proxy.sh

vi /etc/dnf/dnf.conf
# proxy settings
proxy=http://proxy.domain.ltd:3128/
proxy_username=username
proxy_password=password

vi /etc/wgetrc
# proxy settings
http_proxy    = http://username:password@proxy.domain.ltd:3128/
https_proxy    = http://username:password@proxy.domain.ltd:3128/
ftp_proxy    = http://username:password@proxy.domain.ltd:3128/
no_proxy    = "127.0.0.1,localhost,domain.ltd,192.168.0.*"

I have the exact settings on a CentOS 7 server (except yum instead of dnf) and I am able to connect to do updates or installs.

The error message I receive when running: yum -y update kernel or yum -y update or yum -y upgrade is:

[root@server01 ~]# yum install nano
CentOS-8 - AppStream                                                   106 kB/s | 2.1 kB     00:00    
Failed to download metadata for repo 'AppStream'
Error: Failed to download metadata for repo 'AppStream'

I have searched around for a solution to proxies, and to the AppStream but nothing seems to work.

When I run the commands verbose, I get the HTTP 407 error but I cant seem to find any other areas to add a proxy.

Some things I have tried are:

  • changing the repo from mirror to base
  • changing the repo from http to https
  • disabling the SELINUX
  • stopping the firewall

There doesn't seem to be as much documentation for CentOS 8 but hopefully someone can help!

2

Turns out the dnf has changed the way it deals with proxies. If you’re using a basic proxy authentication then you need to specify it:

vi /etc/dnf/dnf.conf
# proxy settings
proxy=http://proxy.domain.ltd:3128/
proxy_username=username
proxy_password=password
proxy_auth_method=basic

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.