Ask Your Question
1

Fedora 29 DNF fails to work behind proxy server.

asked 2018-10-31 01:45:26 -0500

georgelappies gravatar image

updated 2018-10-31 08:34:20 -0500

Hi all

With Fedora 29, dnf fails to work behind a proxy server.

I added the following to /etc/dnf/dnf.conf

# The proxy server - proxy server:port number
proxy=http://192.168.0.253:8080
# The account details for dnf connections 
proxy_username=user
proxy_password=password

However when I run dnf -v update, I get the following error:

[root@localhost ~]# dnf -v update
Loaded plugins: builddep, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, needs-restarting, playground, repoclosure, repograph, repomanage, reposync
DNF version: 4.0.4
cachedir: /var/cache/dnf
repo: downloading from remote: fedora-modular
error: Status code: 407 for http://mirror.liquidtelecom.com/fedora/fedora/linux/development/29/Modular/x86_64/os/repodata/repomd.xml 

...long listing of mirrors...

(https://dl.fedoraproject.org/pub/fedora/linux/development/29/Modular/x86_64/os/repodata/repomd.xml).
error: Curl error (56): Failure when receiving data from the peer for https://mirror.linux-ia64.org/fedora/linux/development/29/Modular/x86_64/os/repodata/repomd.xml [Received HTTP code 407 from proxy after CONNECT] (https://mirror.linux-ia64.org/fedora/linux/development/29/Modular/x86_64/os/repodata/repomd.xml).
error: Status code: 407 for http://mirror.linux-ia64.org/fedora/linux/development/29/Modular/x86_64/os/repodata/repomd.xml (http://mirror.linux-ia64.org/fedora/linux/development/29/Modular/x86_64/os/repodata/repomd.xml).
Fedora Modular 29 - x86_64                      511  B/s | 2.3 kB     00:04    
Cannot download 'https://mirrors.fedoraproject.org/metalink?repo=fedora-modular-29&arch=x86_64': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried.
Error: Failed to synchronize cache for repo 'fedora-modular'
[root@localhost ~]#

Thanks

EDIT: fixed the formatting of the lines added to dnf.conf

EDIT 2: Using dnf -v update shows that curl fails to download the packages. I have the proxy exported in the .bashrc and .bash_profile files of the root user and the normal user.

EDIT 3: The username and password is 100% correct. It is the company proxy server to limit internet access based on username. The exact same username and password works in Firefox in Fedora 29 after entering it, and I am able to download the xml files via Firefox inside Fedora 29 after authenticating with the proxy server. Even doing curl ..a..mirror..name.xml from the command line after a sudo -i works. It is like the curl invoked by DNF is not using the proxy settings as per the file.

edit retag flag offensive close merge delete

Comments

hi:

edit configuration file : /etc/dnf/dnf.conf and set proxy variable:

proxy=http://<proxy site="">:<proxy port="">/

proxy_username=<proxy user="">

proxy_password=<proxy password="">

proxy_auth_method=ntlm

-- proxy method are:

basic HTTP Basic authentication

digest HTTP Digest authentication

negotiate HTTP Negotiate (SPNEGO) authentication

ntlm HTTP NTLM authentication

digest_ie HTTP Digest authentication with an IE flavor

ntlm_wb NTLM delegating to winbind helper

none None auth method

any All suitable methods

source https://dnf.readthedocs.io/en/latest/...

My.WhiteLion gravatar imageMy.WhiteLion ( 2019-01-09 05:33:16 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2018-10-31 02:31:20 -0500

villykruse gravatar image

The man page for dnf.conf says you have the specify an url for the proxy setting. For example

proxy=http://192.168.0.253:8080

Also see https://www.cyberciti.biz/faq/how-to-use-dnf-command-with-a-proxy-server-on-fedora/ or search for "dnf proxy" on Google.

edit flag offensive delete link more

Comments

Thanks, I edited the file to be as per your example. However it still fails with the exact same error.

georgelappies gravatar imagegeorgelappies ( 2018-10-31 02:40:25 -0500 )edit

"Status code: 407" says your proxy server somehow doesn't like your username and password. There might be more information to be found int the log files on the proxy server.

I just wonder, why require username and password for a proxy server in a private network address.

villykruse gravatar imagevillykruse ( 2018-10-31 07:21:57 -0500 )edit

Thanks for the reply. The username and password is 100% correct. It is the company proxy server to limit internet access based on username. The exact same username and password works in Firefox in Fedora 29 after entering it, and I am able to download the xml files via Firefox inside Fedora 29 after authenticating with the proxy server. Even doing curl ..a..mirror..name.xml from the command line after a sudo -i works. It is like the curl invoked by DNF is not using the proxy settings as per the file.

georgelappies gravatar imagegeorgelappies ( 2018-10-31 08:27:55 -0500 )edit

Maybe you found a bug that needs to be reported to bugzilla.

villykruse gravatar imagevillykruse ( 2018-10-31 09:16:45 -0500 )edit

My recommendation is to take this issue to whoever is in charge of your company's proxy server and see what they say. There's always a possibility that there's an issue with the proxy and if so, there's nothing we can do to fix it. If nothing else, you can eliminate that as a possibility.

sideburns gravatar imagesideburns ( 2018-10-31 11:18:56 -0500 )edit
0

answered 2019-02-20 16:14:01 -0500

Here is how I got my dnf update to work on Fedora 29 using a Squid proxy configured with SSL intercept. Kept getting "Error: Failed to synchronize cache for repo 'fedora-modular'" errors running dnf update until I added sslverify=0 to dnf.conf.

/etc/dnf/dnf.conf

sslverify=0 proxy=http://192.168.1.2:3128 proxy_username=user proxy_password=password

Source: http://fossdev.blogspot.com/2015/12/f...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-10-31 01:45:26 -0500

Seen: 1,924 times

Last updated: Oct 31 '18