Publish deb packages.
To work with the DEB registry, you need either the lkar
client or an HTTP client like curl
to upload and finally, a
package manager like apt
to install packages.
The following examples use apt
.
Placeholder | Description |
---|---|
image |
The oci image used as backend. |
distribution |
The distriution to use. |
component |
The component to use. |
username |
The repository user. |
password_or_token |
The repository password or token. |
architecture |
The package architecture. |
filepath |
The path 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 deb.example.org
lkar login deb.example.org/<image>
To setup the DEB registry on the local machine, run the following command:
lkar deb setup artifact-registry.example.org <distribution> <component>
lkar deb setup artifact-registry.example.org/<image> <distribution> <component>
lkar deb setup deb.example.org <distribution> <component>
lkar deb setup deb.example.org/<image> <distribution> <component>
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/deb/<distribution>/<component>/setup | sh
curl -s https://artifact-registry.example.org/deb/<image>/<distribution>/<component>/setup | sh
curl -s https://deb.example.org/<distribution>/<component>/setup | sh
curl -s https://deb.example.org/<image>/<distribution>/<component>/setup | sh
If the registry is private, provide credentials in the url:
https://{username}:{password_or_token}@<url>
To register the repository add the url to the list of known deb sources (/etc/apt/sources.list
):
echo "deb https://artifact-registry.example.org/deb <distribution> <component>" | sudo tee -a /etc/apt/sources.list
echo "deb https://artifact-registry.example.org/deb/<image> <distribution> <component>" | sudo tee -a /etc/apt/sources.list
echo "deb https://deb.example.org <distribution> <component>" | sudo tee -a /etc/apt/sources.list
echo "deb https://deb.example.org/<image> <distribution> <component>" | sudo tee -a /etc/apt/sources.list
The registry files are signed with a GPG key which must be known to apt.
sudo curl https://artifact-registry.example.org/deb/repository.key -o /etc/apt/trusted.gpg.d/example.asc
sudo curl https://deb.example.org/repository.key -o /etc/apt/trusted.gpg.d/example.asc
Afterward, update the local package index:
apt update
To publish an DEB package, run the following command:
lkar deb push artifact-registry.example.org <distribution> <component> path/to/file.deb
lkar deb push artifact-registry.example.org/<image> <distribution> <component> path/to/file.deb
lkar deb push deb.example.org <distribution> <component> path/to/file.deb
lkar deb push deb.example.org/<image> <distribution> <component> path/to/file.deb
To publish an DEB package, perform an HTTP PUT
operation with the package content in the request body.
https://artifact-registry.example.org/deb/<distribution>/<component>/push
Example request using HTTP Basic authentication:
curl --user username:password_or_token \
--upload-file path/to/file.deb \
https://artifact-registry.example.org/deb/focal/main/push
https://artifact-registry.example.org/deb/<image>/<distribution>/<component>/push
Example request using HTTP Basic authentication:
curl --user username:password_or_token \
--upload-file path/to/file.deb \
https://artifact-registry.example.org/deb/user/image/focal/main/push
https://deb.example.org/<distribution>/<component>/push
Example request using HTTP Basic authentication:
curl --user username:password_or_token \
--upload-file path/to/file.deb \
https://deb.example.org/focal/main/push
https://deb.example.org/<image>/<distribution>/<component>/push
Example request using HTTP Basic authentication:
curl --user username:password_or_token \
--upload-file path/to/file.deb \
https://deb.example.org/user/image/focal/main/push
To delete an DEB package, run the following commands:
First retrieve the path to package you want to delete:
lkar deb ls artifact-registry.example.org <distribution> <component>
Then use the path to delete the package:
lkar deb rm artifact-registry.example.org <path>
First retrieve the path to package you want to delete:
lkar deb ls artifact-registry.example.org/<image> <distribution> <component>
Then use the path to delete the package:
lkar deb rm artifact-registry.example.org/<image> <path>
First retrieve the path to package you want to delete:
lkar deb ls deb.example.org <distribution> <component>
Then use the path to delete the package:
lkar deb rm deb.example.org <path>
First retrieve the path to package you want to delete:
lkar deb ls deb.example.org/<image> <distribution> <component>
Then use the path to delete the package:
lkar deb rm deb.example.org/<image> <path>
To delete an DEB package, first retrieve the path to the package in the repository:
GET https://artifact-registry.example.org/_packages/deb
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/deb/pool/<distribution>/<component>/<architecture>/<filename>
Example request using HTTP Basic authentication:
curl --user username:password_or_token -X DELETE \
https://artifact-registry.example.org/deb/pool/focal/main/test-package-1.0.0.deb
To delete an DEB package, first retrieve the path to the package in the repository:
GET https://artifact-registry.example.org/_packages/deb/<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/deb/<image>/pool/<distribution>/<component>/<architecture>/<filename>
Example request using HTTP Basic authentication:
curl --user username:password_or_token -X DELETE \
https://artifact-registry.example.org/deb/user/image/pool/focal/main/test-package-1.0.0.deb
To delete an DEB package, first retrieve the path to the package in the repository:
GET https://deb.example.org/_packages
Then perform an HTTP DELETE
operation. This will delete the package version too if there is no
file left.
DELETE https://deb.example.org/pool/<distribution>/<component>/<architecture>/<filename>
Example request using HTTP Basic authentication:
curl --user username:password_or_token -X DELETE \
https://deb.example.org/pool/focal/main/test-package-1.0.0.deb
To delete an DEB package, first retrieve the path to the package in the repository:
GET https://deb.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://deb.example.org/<image>/pool/<distribution>/<component>/<architecture>/<filename>
Example request using HTTP Basic authentication:
curl --user username:password_or_token -X DELETE \
https://deb.example.org/user/image/pool/focal/main/test-package-1.0.0.deb
To install a package from the DEB registry, execute the following commands:
# use latest version
apt install {package_name}
# use specific version
apt install {package_name}={package_version}