Publish rpm packages.
To work with the RPM registry, you need either the lkar
client or an HTTP client like curl
to upload and finally, a
package manager like yum
or dnf
to install packages.
The following examples use mostly yum
.
Placeholder | Description |
---|---|
image |
The oci image used as backend. |
username |
The repository user. |
password_or_token |
The repository password or token. |
architecture |
The package architecture. |
filepath |
The path in the repository to the file to delete. |
If the registry is private, start by log in the registry:
lkar login artifact-registry.example.org
lkar login artifact-registry.example.org/<image>
lkar login rpm.example.org
lkar login rpm.example.org/<image>
To setup the RPM registry on the local machine, run the following command:
lkar rpm setup artifact-registry.example.org
lkar rpm setup artifact-registry.example.org/<image>
lkar rpm setup rpm.example.org
lkar rpm setup rpm.example.org/<image>
If the registry is private, provide credentials in the url:
https://<username>:<password_or_token>@<url>
To register the repository using the generated script, run the following command:
curl -s https://artifact-registry.example.org/rpm/setup | sh
curl -s https://artifact-registry.example.org/rpm/<image>/setup | sh
curl -s https://rpm.example.org/setup | sh
curl -s https://rpm.example.org/<image>/setup | sh
If the registry is private, provide credentials in the url:
https://{username}:{password_or_token}@<url>
Not supported
dnf config-manager --add-repo https://artifact-registry.example.org/rpm/<image>.repo
Not supported
dnf config-manager --add-repo https://rpm.example.org/<image>.repo
To register the repository add the repository definition in the /etc/yum.repos.d/
directory:
curl https://artifact-registry.example.org/rpm/.repo | sudo tee /etc/yum.repos.d/example.repo
curl https://artifact-registry.example.org/rpm/<image>.repo | sudo tee /etc/yum.repos.d/example.repo
curl https://rpm.example.org/.repo | sudo tee /etc/yum.repos.d/example.repo
curl https://rpm.example.org/<image>.repo | sudo tee /etc/yum.repos.d/example.repo
To publish an RPM package, run the following command:
lkar rpm push artifact-registry.example.org path/to/file.rpm
lkar rpm push artifact-registry.example.org/<image> path/to/file.rpm
lkar rpm push rpm.example.org path/to/file.rpm
lkar rpm push rpm.example.org/<image> path/to/file.rpm
To publish an RPM package, perform an HTTP PUT
operation with the package content in the request body.
https://artifact-registry.example.org/rpm/push
Example request using HTTP Basic authentication:
curl --user username:password_or_token \
--upload-file path/to/file.rpm \
https://artifact-registry.example.org/rpm/push
https://artifact-registry.example.org/rpm/<image>/push
Example request using HTTP Basic authentication:
curl --user username:password_or_token \
--upload-file path/to/file.rpm \
https://artifact-registry.example.org/rpm/user/image/push
https://rpm.example.org/push
Example request using HTTP Basic authentication:
curl --user username:password_or_token \
--upload-file path/to/file.rpm \
https://rpm.example.org/push
https://rpm.example.org/<image>/push
Example request using HTTP Basic authentication:
curl --user username:password_or_token \
--upload-file path/to/file.rpm \
https://rpm.example.org/user/image/push
To delete an RPM package, run the following commands:
First retrieve the path to package you want to delete:
lkar rpm ls artifact-registry.example.org
Then use the path to delete the package:
lkar rpm rm artifact-registry.example.org <path>
First retrieve the path to package you want to delete:
lkar rpm ls artifact-registry.example.org/<image>
Then use the path to delete the package:
lkar rpm rm artifact-registry.example.org/<image> <path>
First retrieve the path to package you want to delete:
lkar rpm ls rpm.example.org
Then use the path to delete the package:
lkar rpm rm rpm.example.org <path>
First retrieve the path to package you want to delete:
lkar rpm ls rpm.example.org/<image>
Then use the path to delete the package:
lkar rpm rm rpm.example.org/<image> <path>
To delete an RPM package, first retrieve the path to the package in the repository:
GET https://artifact-registry.example.org/_packages/rpm
Then perform an HTTP DELETE
operation. This will delete the package version too if there is no
file left.
DELETE https://artifact-registry.example.org/rpm/<filepath>
Example request using HTTP Basic authentication:
curl --user username:password_or_token -X DELETE \
https://artifact-registry.example.org/rpm/test-package-1.0.0.rpm
To delete an RPM package, first retrieve the path to the package in the repository:
GET https://artifact-registry.example.org/_packages/rpm/<image>
Then perform an HTTP DELETE
operation. This will delete the package version too if there is no
file left.
DELETE https://artifact-registry.example.org/rpm/<image>/<filepath>
Example request using HTTP Basic authentication:
curl --user username:password_or_token -X DELETE \
https://artifact-registry.example.org/rpm/user/image/test-package-1.0.0.rpm
To delete an RPM package, first retrieve the path to the package in the repository:
GET https://rpm.example.org/_packages
Then perform an HTTP DELETE
operation. This will delete the package version too if there is no
file left.
DELETE https://rpm.example.org/<filepath>
Example request using HTTP Basic authentication:
curl --user username:password_or_token -X DELETE \
https://rpm.example.org/test-package-1.0.0.rpm
To delete an RPM package, first retrieve the path to the package in the repository:
GET https://rpm.example.org/_packages/<image>
Then perform an HTTP DELETE
operation. This will delete the package version too if there is no
file left.
DELETE https://rpm.example.org/<image>/<filepath>
Example request using HTTP Basic authentication:
curl --user username:password_or_token -X DELETE \
https://rpm.example.org/user/image/test-package-1.0.0.rpm
To install a package from the RPM registry, execute the following commands:
# use latest version
yum install {package_name}
# use specific version
yum install {package_name}={package_version}