Skip to content

Error when Publishing Debian Package for Second Distribution in GitLab Package Registry

Summary: I am encountering an issue while trying to publish Debian packages to the GitLab package registry. I am utilizing the CI to build Debian packages for an internal application. The intention is to build packages for both Debian Buster and Debian Bullseye.

Issue Details:

  • Build Configuration: I have configured the CI to build Debian packages for both Debian Buster and Debian Bullseye. The build for each .deb file is successful. After the job execution, I receive an output file in the format:
    • monapp-<version>.deb

Publishing Process:

  • Publishing Command for Buster: To publish the Debian package to the package registry for Debian Buster, I am using the following command:

    curl --request PUT --user "gitlab-ci-token:${CI_JOB_TOKEN}" --get --data "distribution=buster" --data "component=main" "https://gitlab.test.com/api/v4/projects/103/packages/debian/" --upload-file build/monapp${CI_COMMIT_TAG}_amd64.deb
  • Publishing Command for Bullseye: Similarly, for Debian Bullseye, I am using the following command:

    curl --request PUT --user "gitlab-ci-token:${CI_JOB_TOKEN}" --get --data "distribution=bullseye" --data "component=main" "https://gitlab.test.com/api/v4/projects/103/packages/debian/" --upload-file build/monapp${CI_COMMIT_TAG}_amd64.deb

Issue Encountered:

  • Issue with Bullseye: While adding the first .deb package to the repository works perfectly fine, I encounter an error when attempting to add the second package with the following error message: "Debian package monapp exists in distribution buster."

Desired Resolution: I am seeking a solution to allow for the successful addition of two distinct distributions to the Debian package repository in GitLab. This would ensure that there are no conflicts or errors, allowing both packages to be uploaded without issues.

Thank you for your attention to this matter. Please let me know if you require any additional information or if there are any troubleshooting steps I can follow to resolve this issue.