如何将dnf的http_proxy设置为almalinux

问题描述 投票:0回答:1
用于在安全环境中下载互联网的软件包,而不是直接允许。 我尝试了设置env vars,但在DNF中没有工作。

我搜索了很多寻找解决方案,其中99%也没有起作用。 我尝试了什么: export http_proxy=http://x.x.x.x:8080; export https_proxy=$http_proxy dnf update

设置这些值在

/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

然后
dnf update

在所有情况下,一直说

dnf

Could not resolve proxy

在诸如this
的代理设置之后,在

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.org/metalink?repo=epel-9&arch=x86_64&infra=$infra&content=$contentdir [Could not resolve proxy: x.x.x.x:8080]

部分中添加了一个额外的钥匙值
[main]
然后尝试

[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
http-proxy dnf almalinux
1个回答
0
投票

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.