The “dnf” command is the package manager for Fedora Linux. If you are behind a proxy server, you can configure dnf to use the proxy by setting the http_proxy
and https_proxy
environment variables. Here’s how:
- Open a terminal window.
- Set the
http_proxy
andhttps_proxy
environment variables to the URL of your proxy server, including the port number. For example:
export http_proxy=http://proxy.example.com:8080
export https_proxy=http://proxy.example.com:8080
- To make these settings persistent, you can add the above lines to your shell profile file, such as ~/.bashrc or ~/.bash_profile.
- Verify the proxy settings by running the following command:
dnf config-manager --set-proxy
- Run the following command to test if the proxy is working:
dnf check-update
If the proxy is configured correctly, you should see the list of available updates. If you encounter any errors, make sure the URL and port number of your proxy server are correct, and that the proxy allows traffic to the required ports for dnf (usually port 80 for HTTP and port 443 for HTTPS).