How to use Zypper client with Artifactory rpm repository?

Amith Kumar Mutakari
2020-10-05 07:58

Artifactory supports Zypper client with rpm repository. However, using this client we can only install the SUSE packages as mentioned below. 

Introduction:-
What is Zypper?
Zypper is a command line package manager in OpenSUSE Linux distribution which makes use of libzypp . Zypper provides functions like repository access, dependency solving, package installation, etc.

I have taken myart.jfrog.io as an example. You can replace myart.jfrog.io with your artifactory instance when you try at your end. 

1) Create a rpm repository and name it as rpm-remote-suse and point it to http://download.opensuse.org/update/11.1 

2) The command to add the Artifactory rpm remote repository and resolve the packages from it.

$ zypper ar https://myart.jfrog.io/artifactory/rpm-remote-suse/ update
 

Adding repository 'update' …………………………………………………………………………………………………………………………………………………………………………………….[done]

Repository 'update' successfully added

URI         : https://myart.jfrog.io/artifactory/rpm-remote-suse/
Enabled     : Yes                                                        
GPG Check   : Yes                                                        
Autorefresh : No                                                         
Priority    : 99 (default priority)  

3) Installing an example package with zypper client which will  resolve from the Artifactory remote repository and will be cached in the following location in Artifactory. 

 https://myart.jfrog.io/artifactory/rpm-remote-suse-cache/rpm/

4) How to install a package using Zypper client?

Below command will install the MozillaFirefox package. 

$ zypper in MozillaFirefox 

For any reference related to zypper client commands, we can follow this external link .