RPM Package Configuration

Repository URL Migration

Use case: Migration of RPM repositories (YUM/DNF) from direct sources to an OSA Proxy server.

The following table summarizes the redirection of repository URLs for RPM.

Sourcebaseurl in .repo before migrationbaseurl in .repo after migrationapplication.yml rpm.repository.registry
Nexushttps://nexus.host.ru/repository/rpm-proxyhttps://{osa-proxy-url}/nexus-rpmhttps://nexus.host.ru/repository/rpm-proxy
Artifactoryhttps://jfrog.host.ru/artifactory/rpm-remotehttps://{osa-proxy-url}/jfrog-rpmhttps://jfrog.host.ru/artifactory/rpm-remote
Official Mirrorhttps://repo.almalinux.org/almalinuxhttps://{osa-proxy-url}/inet-rpmhttps://repo.almalinux.org/almalinux

YUM/DNF Repository Migration

Original file /etc/yum.repos.d/almalinux.repo:

[baseos]
name=AlmaLinux $releasever - BaseOS
baseurl=https://repo.almalinux.org/almalinux/$releasever/BaseOS/$basearch/os/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9

The following repository definition needs to be added to the service's YAML configuration (the application.yml file) in the rpm section. The service must be restarted for the changes to take effect.

Configuration in application.yml file

rpm:
  enabled: true
  repository:
    - name: codescoring-rpm
      scan-package: true
      registry: https://repo.almalinux.org/almalinux

After configuring the proxy server and adding it to application.yml, the repository configuration will look like this:

[baseos]
name=AlmaLinux $releasever - BaseOS
baseurl=https://{osa-proxy-url}/codescoring-rpm/$releasever/BaseOS/$basearch/os/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9
Was this page helpful?