Hi there!
I have an RPM repository running on JFrog Artifactory. It’s being used by CentOS and RHEL hosts, and I would also like to use it with my openSUSE hosts as well.
This documentation from JFrog does not explicitly say that only yum clients are supported, and since they used the term “RPM repository”, to me it suggests that the repository should also work with zypper clients.
This is an opensuse document about repomd/rpm md/YUM sources, and a visual inspection of a repository on an openSUSE host created using the createrepo command looks consistent to the JFrog RPM repository layout.
opensuse:~ # ll /data/internalrepo/
total 1157456
-rw-r--r-- 1 root root 1185231772 Apr 22 08:54 myapp-server-2019.0.x86_64.rpm
drwxr-xr-x 1 root root 494 Apr 22 08:55 repodata
opensuse:~ # ll /data/internalrepo/repodata/
total 324
-rw-r--r-- 1 root root 1901 Apr 22 08:55 6a654dd3c11ae0f51efd9cd3fd09ccfdc3c48e988ab886c370e94f7f5bcdf3d1-primary.xml.gz
-rw-r--r-- 1 root root 315545 Apr 22 08:55 cfa28fb2383f1eec84d67bdb8a96d8d1ff66fa1917fb9ca5b5dfaea2569b559b-filelists.xml.gz
-rw-r--r-- 1 root root 1840 Apr 22 08:55 e541d1abcfd503ea5b4d69cfcad74e57750969110429974db7651b2f4dcb44e6-other.xml.gz
-rw-r--r-- 1 root root 1508 Apr 22 08:55 repomd.xml
opensuse:~ #
So at this point, I assume that pointing zypper to the RPM repository “should work” just fine.
However, when trying to point to the repository, there’s an error Repository type can’t be determined (#2 below). Here are all the steps to add the repository:
- Add the repository using addrepo:
opensuse:~ # zypper addrepo https://myuser:mypassword@rpm.example.com/myapp-release-rpm/stable/myapp/2019/3/ myapp
Adding repository 'myapp' ..................................................................................................................................................[done]
Repository 'myapp' successfully added
URI : https://myuser@rpm.example.com/myapp-release-rpm/stable/myapp/2019/3/
Enabled : Yes
GPG Check : Yes
Autorefresh : No
Priority : 99 (default priority)
Repository priorities are without effect. All enabled repositories share the same priority.
opensuse:~ # zypper repos
Repository priorities are without effect. All enabled repositories share the same priority.
# | Alias | Name | Enabled | GPG Check | Refresh
--+-----------------------------------+-----------------------------------+---------+-----------+--------
1 | myapp | myapp | Yes | ( p) Yes | No
2 | openSUSE-Leap-15.1-1 | openSUSE-Leap-15.1-1 | Yes | (r ) Yes | Yes
3 | openSUSE-Leap-15.1-Non-Oss | openSUSE-Leap-15.1-Non-Oss | Yes | (r ) Yes | No
4 | openSUSE-Leap-15.1-Oss | openSUSE-Leap-15.1-Oss | Yes | (r ) Yes | No
5 | openSUSE-Leap-15.1-Update | openSUSE-Leap-15.1-Update | Yes | (r ) Yes | No
6 | openSUSE-Leap-15.1-Update-Non-Oss | openSUSE-Leap-15.1-Update-Non-Oss | Yes | (r ) Yes | No
opensuse:~ #
- Try to refresh the repo:
opensuse:~ # zypper refresh myapp
Retrieving repository 'myapp' metadata ....................................................................................................................................[error]
Repository 'myapp' is invalid.
[myapp|https://myuser@rpm.example.com/myapp-release-rpm/stable/myapp/2019/3/] Valid metadata not found at specified URL
History:
- [myapp|https://myuser@rpm.example.com/myapp-release-rpm/stable/myapp/2019/3/] Repository type can't be determined.
Please check if the URIs defined for this repository are pointing to a valid repository.
Skipping repository 'myapp' because of the above error.
Could not refresh the repositories because of errors.
opensuse:~ #
- This is what the repo file looks like:
opensuse:~ # cat /etc/zypp/repos.d/myapp.repo
[myapp]
enabled=1
autorefresh=0
baseurl=https://myuser@rpm.myapp.com/myapp-release-rpm/stable/myapp/2019/3/
type=NONE
opensuse:~ #
Manually downloading the repomd.xml
file works fine.
opensuse:~ # curl -o repomd.xml --user myuser \
> https://rpm.myapp.com/myapp-release-rpm/stable/myapp/2019/3/repodata/repomd.xml
Enter host password for user 'myuser':
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1393 100 1393 0 0 1625 0 --:--:-- --:--:-- --:--:-- 1623
opensuse:~ # cat repomd.xml
<?xml version="1.0"?>
<repomd xmlns="http://linux.duke.edu/metadata/repo" xmlns:rpm="http://linux.duke.edu/metadata/rpm">
<data type="other">
<location href="repodata/f11b79e8b7cc5f4cc75851379d5e67d5f6434341-other.xml.gz"/>
<checksum type="sha" pkgid="YES">f11b79e8b7cc5f4cc75851379d5e67d5f6434341</checksum>
<size>2574</size>
<timestamp>1585213347</timestamp>
<open-checksum type="sha" pkgid="YES">de4ef8508be4c2088395e903e19159a7cad87199</open-checksum>
<open-size>36635</open-size>
<revision/>
</data>
<data type="filelists">
<location href="repodata/5cdaa6b9a97e9092c9e68d9d8a1bb32530c8e4c7-filelists.xml.gz"/>
<checksum type="sha" pkgid="YES">5cdaa6b9a97e9092c9e68d9d8a1bb32530c8e4c7</checksum>
<size>962315</size>
<timestamp>1585213345</timestamp>
<open-checksum type="sha" pkgid="YES">726c2e5680556cdd38558f7a2a20bf38d2f0a128</open-checksum>
<open-size>19862419</open-size>
<revision/>
</data>
<data type="primary">
<location href="repodata/cd85a1878f8c38c417e56a720c3ef4bc7f923eeb-primary.xml.gz"/>
<checksum type="sha" pkgid="YES">cd85a1878f8c38c417e56a720c3ef4bc7f923eeb</checksum>
<size>3005</size>
<timestamp>1585213349</timestamp>
<open-checksum type="sha" pkgid="YES">f3c3a178f18e7488eb0769dff6b3cd0def1144c4</open-checksum>
<open-size>46509</open-size>
<revision/>
</data>
</repomd>opensuse:~ #
I tried to look at /var/log/zypper.log, but it’s a little cluttered and I am not sure which ones are relevant.
Any idea what else to check would be very much appreciated.
Thanks!