- Enable the Debian API
- Enable the Debian group API
- Upload a package file
- Download a package
- Route prefix
- Download a distribution Release file
- Download a signed distribution Release file
- Download a release file signature
- Download a packages index
- Download a packages index by hash
- Download a Debian Installer packages index
- Download a Debian Installer packages index by hash
- Download a source packages index
- Download a source packages index by hash
Debian API
- Debian API introduced in GitLab 13.5.
- Debian group API introduced in GitLab 14.2.
- Deployed behind a feature flag, disabled by default.
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.
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.
Authenticate to the Debian Package Repositories
See Authenticate to the Debian Package Repositories.
Upload a package file
- Introduced in GitLab 14.0.
- Upload with explicit distribution and component introduced in GitLab 15.9.
Upload a Debian package file:
PUT projects/:id/packages/debian/:file_name
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. |
distribution | string | no | The distribution codename or suite. Used with component for upload with explicit distribution and component. |
component | string | no | The package file component. Used with distribution for upload with explicit distribution and component. |
curl --request PUT \
--user "<username>:<personal_access_token>" \
--upload-file path/to/mypkg.deb \
"https://gitlab.example.com/api/v4/projects/1/packages/debian/mypkg.deb"
Upload with explicit distribution and component:
curl --request PUT \
--user "<username>:<personal_access_token>" \
--upload-file /path/to/myother.deb \
"https://gitlab.example.com/api/v4/projects/1/packages/debian/myother.deb?distribution=sid&component=main"
Download a package
Introduced in GitLab 14.2.
Download a package file.
GET projects/:id/packages/debian/pool/:distribution/:letter/:package_name/:package_version/:file_name
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/debian/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/debian/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
Introduced in GitLab 14.1.
Download a Debian distribution file.
GET <route-prefix>/dists/*distribution/Release
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
Introduced in GitLab 14.1.
Download a signed Debian distribution file.
GET <route-prefix>/dists/*distribution/InRelease
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
Introduced in GitLab 14.2.
Download a Debian release file signature.
GET <route-prefix>/dists/*distribution/Release.gpg
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.gpg"
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.gpg" \
--remote-name
This writes the downloaded file using the remote filename in the current directory.
Download a packages index
Introduced in GitLab 14.2.
Download a packages index.
GET <route-prefix>/dists/*distribution/:component/binary-:architecture/Packages
Attribute | Type | Required | Description |
---|---|---|---|
distribution | string | yes | The codename or suite of the Debian distribution. |
component | string | yes | The distribution component name. |
architecture | string | yes | The distribution architecture type. |
curl --header "Private-Token: <personal_access_token>" "https://gitlab.example.com/api/v4/projects/1/packages/debian/dists/my-distro/main/binary-amd64/Packages"
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/main/binary-amd64/Packages" \
--remote-name
This writes the downloaded file using the remote filename in the current directory.
Download a packages index by hash
Introduced in GitLab 15.4.
Download a packages index by hash.
GET <route-prefix>/dists/*distribution/:component/binary-:architecture/by-hash/SHA256/:file_sha256
Attribute | Type | Required | Description |
---|---|---|---|
distribution | string | yes | The codename or suite of the Debian distribution. |
component | string | yes | The distribution component name. |
architecture | string | yes | The distribution architecture type. |
curl --header "Private-Token: <personal_access_token>" "https://gitlab.example.com/api/v4/projects/1/packages/debian/dists/my-distro/main/binary-amd64/by-hash/SHA256/66a045b452102c59d840ec097d59d9467e13a3f34f6494e539ffd32c1bb35f18"
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/main/binary-amd64/by-hash/SHA256/66a045b452102c59d840ec097d59d9467e13a3f34f6494e539ffd32c1bb35f18" \
--remote-name
This writes the downloaded file using the remote filename in the current directory.
Download a Debian Installer packages index
Introduced in GitLab 15.4.
Download a Debian Installer packages index.
GET <route-prefix>/dists/*distribution/:component/debian-installer/binary-:architecture/Packages
Attribute | Type | Required | Description |
---|---|---|---|
distribution | string | yes | The codename or suite of the Debian distribution. |
component | string | yes | The distribution component name. |
architecture | string | yes | The distribution architecture type. |
curl --header "Private-Token: <personal_access_token>" "https://gitlab.example.com/api/v4/projects/1/packages/debian/dists/my-distro/main/debian-installer/binary-amd64/Packages"
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/main/debian-installer/binary-amd64/Packages" \
--remote-name
This writes the downloaded file using the remote filename in the current directory.
Download a Debian Installer packages index by hash
Introduced in GitLab 15.4.
Download a Debian Installer packages index by hash.
GET <route-prefix>/dists/*distribution/:component/debian-installer/binary-:architecture/by-hash/SHA256/:file_sha256
Attribute | Type | Required | Description |
---|---|---|---|
distribution | string | yes | The codename or suite of the Debian distribution. |
component | string | yes | The distribution component name. |
architecture | string | yes | The distribution architecture type. |
curl --header "Private-Token: <personal_access_token>" "https://gitlab.example.com/api/v4/projects/1/packages/debian/dists/my-distro/main/debian-installer/binary-amd64/by-hash/SHA256/66a045b452102c59d840ec097d59d9467e13a3f34f6494e539ffd32c1bb35f18"
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/main/debian-installer/binary-amd64/by-hash/SHA256/66a045b452102c59d840ec097d59d9467e13a3f34f6494e539ffd32c1bb35f18" \
--remote-name
This writes the downloaded file using the remote filename in the current directory.
Download a source packages index
Introduced in GitLab 15.4.
Download a source packages index.
GET <route-prefix>/dists/*distribution/:component/source/Sources
Attribute | Type | Required | Description |
---|---|---|---|
distribution | string | yes | The codename or suite of the Debian distribution. |
component | string | yes | The distribution component name. |
curl --header "Private-Token: <personal_access_token>" "https://gitlab.example.com/api/v4/projects/1/packages/debian/dists/my-distro/main/source/Sources"
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/main/source/Sources" \
--remote-name
This writes the downloaded file using the remote filename in the current directory.
Download a source packages index by hash
Introduced in GitLab 15.4.
Download a source packages index by hash.
GET <route-prefix>/dists/*distribution/:component/source/by-hash/SHA256/:file_sha256
Attribute | Type | Required | Description |
---|---|---|---|
distribution | string | yes | The codename or suite of the Debian distribution. |
component | string | yes | The distribution component name. |
curl --header "Private-Token: <personal_access_token>" "https://gitlab.example.com/api/v4/projects/1/packages/debian/dists/my-distro/main/source/by-hash/SHA256/66a045b452102c59d840ec097d59d9467e13a3f34f6494e539ffd32c1bb35f18"
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/main/source/by-hash/SHA256/66a045b452102c59d840ec097d59d9467e13a3f34f6494e539ffd32c1bb35f18" \
--remote-name
This writes the downloaded file using the remote filename in the current directory.