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
1 Answer
Reset to default 0Add 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.