Debian API

Version history

This is the API documentation for Debian.

For instructions on how to upload and install Debian packages from the GitLab package registry, see the Debian registry documentation.

note
These endpoints do not adhere to the standard API authentication methods. See the Debian registry documentation for details on which headers and token types are supported.

Enable the Debian API

The Debian API is behind a feature flag that is disabled by default. GitLab administrators with access to the GitLab Rails console can opt to enable it. To enable it, follow the instructions in Enable the Debian API.

Enable the Debian group API

The Debian group API is behind a feature flag that is disabled by default. GitLab administrators with access to the GitLab Rails console can opt to enable it. To enable it, follow the instructions in Enable the Debian group API.

Upload a package file

Upload a Debian package file:

Attribute Type Required Description
id string yes The ID or full path of the project.
file_name string yes The name of the Debian package file.
curl --request PUT \
     --upload-file path/to/mypkg.deb \
     --header "Private-Token: <personal_access_token>" \
     "https://gitlab.example.com/api/v4/projects/1/packages/debian/mypkg.deb"

Download a package

Download a package file.

Attribute Type Required Description
distribution string yes The codename or suite of the Debian distribution.
letter string yes The Debian Classification (first-letter or lib-first-letter).
package_name string yes The source package name.
package_version string yes The source package version.
file_name string yes The filename.
curl --header "Private-Token: <personal_access_token>" "https://gitlab.example.com/api/v4/projects/1/packages/pool/my-distro/a/my-pkg/1.0.0/example_1.0.0~alpha2_amd64.deb"

Write the output to a file:

curl --header "Private-Token: <personal_access_token>" \
     "https://gitlab.example.com/api/v4/projects/1/packages/pool/my-distro/a/my-pkg/1.0.0/example_1.0.0~alpha2_amd64.deb" \
     --remote-name

This writes the downloaded file using the remote filename in the current directory.

Route prefix

The remaining endpoints described are two sets of identical routes that each make requests in different scopes:

  • Use the project-level prefix to make requests in a single project’s scope.
  • Use the group-level prefix to make requests in a single group’s scope.

The examples in this document all use the project-level prefix.

Project-level

 /projects/:id/packages/debian`
Attribute Type Required Description
id string yes The project ID or full project path.

Group-level

 /groups/:id/-/packages/debian`
Attribute Type Required Description
id string yes The project ID or full group path.

Download a distribution Release file

Download a Debian distribution file.

Attribute Type Required Description
distribution string yes The codename or suite of the Debian distribution.
curl --header "Private-Token: <personal_access_token>" "https://gitlab.example.com/api/v4/projects/1/packages/debian/dists/my-distro/Release"

Write the output to a file:

curl --header "Private-Token: <personal_access_token>" \
     "https://gitlab.example.com/api/v4/projects/1/packages/debian/dists/my-distro/Release" \
     --remote-name

This writes the downloaded file using the remote filename in the current directory.

Download a signed distribution Release file

Download a signed Debian distribution file.

Attribute Type Required Description
distribution string yes The codename or suite of the Debian distribution.
curl --header "Private-Token: <personal_access_token>" "https://gitlab.example.com/api/v4/projects/1/packages/debian/dists/my-distro/InRelease"

Write the output to a file:

curl --header "Private-Token: <personal_access_token>" \
     "https://gitlab.example.com/api/v4/projects/1/packages/debian/dists/my-distro/InRelease" \
     --remote-name

This writes the downloaded file using the remote filename in the current directory.

Download a release file signature