最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

http proxy - How to set http_proxy for dnf in AlmaLinux - Stack Overflow

programmeradmin0浏览0评论

I want to set http_proxy for downloading packages inside a secure environment which is internet is not directly allowed.

I tried settings env vars but didn't worked in dnf.

I searched a lot for finding a solution and 99% of them didn't worked also.

What I tried:

export http_proxy=http://x.x.x.x:8080; export https_proxy=$http_proxy
dnf update

settings these values in /etc/dnf/dnf.conf:

[main]
gpgcheck=1
installonly_limit=3
clean_requirements_on_remove=True
proxy=http://x.x.x.x:8080
proxy_username=username
proxy_password=password

and then

dnf update

in all cases the dnf kept saying that Could not resolve proxy

Extra Packages for Enterprise Linux 9 - x86_64                                                                                               0.0  B/s |   0  B     00:00    
Errors during downloading metadata for repository 'epel':
  - Curl error (5): Couldn't resolve proxy name for ;arch=x86_64&infra=$infra&content=$contentdir [Could not resolve proxy: x.x.x.x:8080]

I want to set http_proxy for downloading packages inside a secure environment which is internet is not directly allowed.

I tried settings env vars but didn't worked in dnf.

I searched a lot for finding a solution and 99% of them didn't worked also.

What I tried:

export http_proxy=http://x.x.x.x:8080; export https_proxy=$http_proxy
dnf update

settings these values in /etc/dnf/dnf.conf:

[main]
gpgcheck=1
installonly_limit=3
clean_requirements_on_remove=True
proxy=http://x.x.x.x:8080
proxy_username=username
proxy_password=password

and then

dnf update

in all cases the dnf kept saying that Could not resolve proxy

Extra Packages for Enterprise Linux 9 - x86_64                                                                                               0.0  B/s |   0  B     00:00    
Errors during downloading metadata for repository 'epel':
  - Curl error (5): Couldn't resolve proxy name for https://mirrors.fedoraproject./metalink?repo=epel-9&arch=x86_64&infra=$infra&content=$contentdir [Could not resolve proxy: x.x.x.x:8080]
Share Improve this question asked Feb 2 at 13:31 SalehiSalehi 3922 silver badges13 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Add a extra key value in [main] section right after proxy settings like this

[main]
gpgcheck=1
installonly_limit=3
clean_requirements_on_remove=True
proxy=http://x.x.x.x:8080
proxy_username=username
proxy_password=password
proxy_auth_method=basic

and then try

dnf update

It will work, comment if didn't.

发布评论

评论列表(0)

  1. 暂无评论