Debian API
DETAILS: Tier: Free, Premium, Ultimate Offering: GitLab Self-Managed
- Deployed behind a feature flag, disabled by default.
This is the API documentation for Debian.
WARNING: This API is used by the Debian related package clients such as dput and apt-get, and is generally not meant for manual consumption. This API is under development and is not ready for production use due to limited functionality.
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. Undocumented authentication methods might be removed in the future.
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
- 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
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
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 --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"
```0
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.
```shell
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"
```1
| Attribute | Type | Required | Description |
| ----------------- | ------ | -------- | ----------- |
| `distribution` | string | yes | The codename or suite of the Debian distribution. |
```shell
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"
```2
Write the output to a file:
```shell
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"
```3
This writes the downloaded file using the remote filename in the current directory.
## Download a release file signature
Download a Debian release file signature.
```shell
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"
```4
| Attribute | Type | Required | Description |
| ----------------- | ------ | -------- | ----------- |
| `distribution` | string | yes | The codename or suite of the Debian distribution. |
```shell
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"
```5
Write the output to a file:
```shell
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"
```6
This writes the downloaded file using the remote filename in the current directory.
## Download a packages index
Download a packages index.
```shell
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"
```7
| 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. |
```shell
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"
```8
Write the output to a file:
```shell
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"
```9
This writes the downloaded file using the remote filename in the current directory.
## Download a packages index by hash
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96947) in GitLab 15.4.
Download a packages index by hash.
```shell
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"
```0
| 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. |
```shell
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"
```1
Write the output to a file:
```shell
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"
```2
This writes the downloaded file using the remote filename in the current directory.
## Download a Debian Installer packages index
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/71918) in GitLab 15.4.
Download a Debian Installer packages index.
```shell
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"
```3
| 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. |
```shell
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"
```4
Write the output to a file:
```shell
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"
```5
This writes the downloaded file using the remote filename in the current directory.
## Download a Debian Installer packages index by hash
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96947) in GitLab 15.4.
Download a Debian Installer packages index by hash.
```shell
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"
```6
| 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. |
```shell
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"
```7
Write the output to a file:
```shell
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"
```8
This writes the downloaded file using the remote filename in the current directory.
## Download a source packages index
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/71918) in GitLab 15.4.
Download a source packages index.
```shell
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"
```9
| Attribute | Type | Required | Description |
| ----------------- | ------ | -------- | ----------- |
| `distribution` | string | yes | The codename or suite of the Debian distribution. |
| `component` | string | yes | The distribution component name. |
```plaintext
GET projects/:id/packages/debian/pool/:distribution/:letter/:package_name/:package_version/:file_name
```0
Write the output to a file:
```plaintext
GET projects/:id/packages/debian/pool/:distribution/:letter/:package_name/:package_version/:file_name
```1
This writes the downloaded file using the remote filename in the current directory.
## Download a source packages index by hash
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96947) in GitLab 15.4.
Download a source packages index by hash.
```plaintext
GET projects/:id/packages/debian/pool/:distribution/:letter/:package_name/:package_version/:file_name
```2
| Attribute | Type | Required | Description |
| ----------------- | ------ | -------- | ----------- |
| `distribution` | string | yes | The codename or suite of the Debian distribution. |
| `component` | string | yes | The distribution component name. |
```plaintext
GET projects/:id/packages/debian/pool/:distribution/:letter/:package_name/:package_version/:file_name
```3
Write the output to a file:
```plaintext
GET projects/:id/packages/debian/pool/:distribution/:letter/:package_name/:package_version/:file_name
```4
This writes the downloaded file using the remote filename in the current directory.