ARTIFACTORY: How to configure RPM Grafana remote repository in Artifactory

ARTIFACTORY: How to configure RPM Grafana remote repository in Artifactory

AuthorFullName__c
Vaibhav Jain
articleNumber
000006287
ft:sourceType
Salesforce
FirstPublishedDate
2024-12-30T18:46:44Z
lastModifiedDate
2024-12-30
VersionNumber
2
Introduction 

Artifactory is a versatile solution designed to streamline the management of remote repositories. This article provides a step-by-step guide to configuring and resolving grafana packages available on “https://rpm.grafana.com” using Artifactory.

By following the instructions below, you will learn how to set up a remote registry for “rpm.grafana.com” as an RPM Remote repository, enabling you to install packages effortlessly.


Configuring the RPM Remote Repository:

To begin, access the Artifactory UI and follow these steps:

1. Create a new remote repository by navigating to Administration -> Repositories -> Create Repository. Select RPM.

2. Enter the repository name and the URL and then create it. Refer to the attached screenshot for visual assistance.

User-added image 
 

3. Then, navigate to the Set Me Up page for the repository and then follow the steps as mentioned.

  • In the client, create an artifactory.repo file under /etc/yum.repos.d/ directory.
  • Copy the contents from the Set Me up and set the gpgcheck to 1 and repo_gpgcheck to 1.
  • Also, in the gpgkey section, the URL will be pointing to Artifactory. Hence, just append the gpg.key at last.
     

4. Below is the sample artifactory.repo file.

[Artifactory]
name=Artifactory
baseurl=http://admin:XXXXXXXXXXXXXX@<DNS-name>/artifactory/rpm-grafana-remote
enabled=1
gpgcheck=1
#Optional - if you have GPG signing keys installed, use the below flags to verify the repository metadata signature:
gpgkey=http://admin:XXXXXXXXXXX@<DNS-name>/artifactory/rpm-grafana-remote/gpg.key
repo_gpgcheck=1

 

5. Once the configuration is done. Perform yum update. This will fetch the metadata file from the upstream. Sharing the below command:

    > yum update --disablerepo="*" --enablerepo="Artifactory"


6. Then install the grafana package from this repository, it will prompt you to import the GPG key. Press Yes and the package will be successfully downloaded. Below is the sample output.
 

 > yum install grafana --disablerepo="*" --enablerepo="Artifactory"
Updating Subscription Management repositories.
Last metadata expiration check: 0:01:14 ago on Sun 22 Dc 2024 04:48:57 AM UTC.
Dependencies resolved.
===================================================================================================================================================================================================================================
 Package                                               Architecture                                         Version                                                Repository                                                 Size
===================================================================================================================================================================================================================================
Installing:
 grafana                                               x86_64                                               11.3.1-1                                               Artifactory                                               120 M

Transaction Summary
===================================================================================================================================================================================================================================
Install  1 Package

Total download size: 120 M
Installed size: 448 M
Is this ok [y/N]: y
Downloading Packages:
grafana-11.3.1-1.x86_64.rpm                                                                                                                                                                         21 MB/s | 120 MB     00:05    
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                               21 MB/s | 120 MB     00:05     
retrieving repo key for Artifactory unencrypted from http://admin:XXXXXXXXXXXXX@<DNS-name>/artifactory/rpm-grafana-remote/gpg.key
Artifactory                                                                                                                                                                                        288 kB/s | 2.4 kB     00:00    
Importing GPG key 0x10458545:
 Userid     : "Grafana Labs <engineering@grafana.com>"
 Fingerprint: B53A E77B ADB6 30A6 8304 6005 963F A277 1045 8545
 From       : http://admin:XXXXXXXXXXXXX@<DNS-name>/artifactory/rpm-grafana-remote/gpg.key
Is this ok [y/N]: y
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                                           1/1 
  Installing       : grafana-11.3.1-1.x86_64                                                                                                                                                                                   1/1 
  Running scriptlet: grafana-11.3.1-1.x86_64                                                                                                                                                                                   1/1 
### NOT starting on installation, please execute the following statements to configure grafana to start automatically using systemd
 sudo /bin/systemctl daemon-reload
 sudo /bin/systemctl enable grafana-server.service
### You can start grafana-server by executing
 sudo /bin/systemctl start grafana-server.service

POSTTRANS: Running script

  Verifying        : grafana-11.3.1-1.x86_64                                                                                                                                                                                   1/1 
Installed products updated.

Installed:
  grafana-11.3.1-1.x86_64 

Complete!
Hooray, the setup is completed and the packages are downloaded. 

For more information on RPM Repositories, please visit the below articles:-
  1. How to configure GPG Keys with Artifactory Remote Repositories
  2. Set Up RPM Repositories