Chapter 13. Changing proxy settings


RHUI can use a proxy server to sync Red Hat content through. If no proxy server is specified while installing RHUI, none is used. Otherwise, this proxy server is used with all RHUI repositories that you add. This chapter describes how the proxy server configuration can be changed.

Follow these steps if you wish to:

  • start using a proxy server in a RHUI environment that was installed with no proxy server configuration
  • edit the current proxy server configuration, for example, if the server hostname has changed
  • stop using the proxy server that a RHUI environment was installed with

Procedure

There are two ways to configure (or unconfigure) proxy server settings.

  • First option: Rerun the installer to update the global RHUI tools configuration and answers file:

    rhui-installer --rerun --proxy-protocol <PROTOCOL> \
                           --proxy-hostname <HOSTNAME> \
                           --proxy-port <PORT> \
                           --proxy-username <USERNAME> \
                           --proxy-password <PASSWORD>
  • Second option: Create (or edit) the local overrides file, /root/.rhui/rhui-tools-custom.conf, so that it contains:

    [proxy]
    proxy_protocol: <PROTOCOL>
    proxy_host: <HOSTNAME>
    proxy_port: <PORT>
    proxy_user: <USERNAME>
    proxy_pass: <PASSWORD>
    Note

    This option was introduced in RHUI 4.11.

    In either case, the parameters are as follows:

    • PROTOCOL is either http or https if configuring the proxy server; if unconfiguring it:

      • if rerunning the installer, do not use the --proxy-protocol argument
      • if using the local file, leave the value empty
    • HOSTNAME is the new proxy server hostname; if clearing the configuration:

      • if rerunning the installer, use an empty string in double quotes ("")
      • if using the local file, leave the value empty
    • PORT is the TCP port where the proxy server is listening, typically 3128; if clearing the configuration:

      • if rerunning the installer, do not use the --proxy-port argument
      • if using the local file, leave the value empty
    • USERNAME is an optional parameter. Only use it if the proxy server requires credentials. If it does not or you are clearing the configuration:

      • if rerunning the installer, use ""
      • if using the local file, leave the value empty or do not use the proxy_user: option at all
    • PASSWORD ditto.

      Examples:

    • Start using a proxy server, and this server requires no credentials.

      • With the installer:

        rhui-installer --rerun --proxy-protocol http --proxy-hostname squid.example.com --proxy-port 3128
      • With the local file:

        [proxy]
        proxy_host: squid.example.com
        proxy_protocol: http
        proxy_port: 3128
    • Change the proxy server hostname, everything else remains the same.

      • With the installer:

        rhui-installer --rerun --proxy-hostname newsquid.example.com
      • With the local file:

        [proxy]
        proxy_host: newsquid.example.com
    • Stop using the proxy server.

      • With the installer:

        rhui-installer --rerun --proxy-hostname ""
      • With the local file:

        [proxy]
        proxy_protocol:
        proxy_host:
        proxy_port:
        Important

        This new configuration will only affect Red Hat repositories added after the configuration is updated. To apply this new configuration to existing repositories, it is necessary to remove, add, and re-synchronize the repositories.

        This will cause an outage that will last from the moment you remove them until you re-sync them. However, already synchronized packages will not have to be re-downloaded from the Red Hat CDN. RHUI will mainly have to parse all the repodata files and determine which package belongs where. This can take up to several hours.

        Although there are technical means outside of rhui-manager whereby the proxy fields can be modified for the existing repositories—or rather, for the so-called remotes—using such means is unsupported.

  • Make sure you have a list (or lists) of your repositories so that you can add them again. If you do not have such a list, you can use rhui-manager to generate a file with all your currently added Red Hat repositories.

    To generate a list of Red Hat repositories, first create a raw list with one ID per line:

    rhui-manager --noninteractive repo list --redhat_only --ids_only > /root/rawlist
  • Then create a YAML file with repositories. Start by creating a stub:

    echo -e "name: all Red Hat repositories\nrepo_ids:" > /root/repo_list.yml
  • Next, append the repositories from the raw list as YAML list items:

    sed "s/^/  - /" /root/rawlist >> /root/repo_list.yml
  • Delete all Red Hat repositories from your RHUI:

    Use the text user interface, or delete them one by one on the command line. For the latter, you can use the raw list created earlier:

    while read repo; do rhui-manager --noninteractive repo delete --repo_id $repo; done < /root/rawlist
    Note

    Repositories are deleted in asynchronous background tasks: queued and executed by available Pulp workers. It may take tens of minutes, or hours, to actually delete all the repositories. Be patient.

  • When the repositories have been deleted, re-add them. They will be added with the new proxy settings (or with no proxy URL) this time. It is also necessary to re-synchronize the repositories. You can add and re-synchronize them in one step on the command line:

    rhui-manager --noninteractive repo add_by_file --file /root/repo_list.yml --sync_now

    Alternatively, use your own methods to synchronize the repositories, for example, in a specific order. Lastly, you can also simply wait for the synchronization to start automatically: in six hours, or in any other time defined as repo_sync_frequency in /etc/rhui/rhui-tools.conf.

    Important

    In any case, the repositories will not be available in the meantime.

Verification

The rhui-manager tool does not display information about the proxy server that is used with a repository. However, you can use the pulpcore-manager tool as outlined below:

env PULP_SETTINGS=/etc/pulp/settings.py /usr/bin/pulpcore-manager shell << EOM
from pulpcore.app.models import Remote
rem = Remote.objects.get(name="rhel-8-for-x86_64-baseos-rhui-rpms-8")
print(rem.proxy_url)
EOM

The output should look like this for a configured proxy server:

http://squid.example.com:3128

or None if no proxy server is configured with the specified repository.

Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2026 Red Hat
Back to top