Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'doc/user/packages/debian_repository/index.md')
-rw-r--r--doc/user/packages/debian_repository/index.md40
1 files changed, 40 insertions, 0 deletions
diff --git a/doc/user/packages/debian_repository/index.md b/doc/user/packages/debian_repository/index.md
index 1d846a60281..4143ab0881f 100644
--- a/doc/user/packages/debian_repository/index.md
+++ b/doc/user/packages/debian_repository/index.md
@@ -175,3 +175,43 @@ To install a package:
```shell
sudo apt-get -y install -t <codename> <package-name>
```
+
+## Download a source package
+
+To download a source package:
+
+1. Configure the repository:
+
+ If you are using a private project, add your [credentials](#authenticate-to-the-package-registry) to your apt configuration:
+
+ ```shell
+ echo 'machine gitlab.example.com login <username> password <your_access_token>' \
+ | sudo tee /etc/apt/auth.conf.d/gitlab_project.conf
+ ```
+
+ Download your distribution key:
+
+ ```shell
+ sudo mkdir -p /usr/local/share/keyrings
+ curl --header "PRIVATE-TOKEN: <your_access_token>" \
+ "https://gitlab.example.com/api/v4/projects/<project_id>/debian_distributions/<codename>/key.asc" \
+ | \
+ gpg --dearmor \
+ | \
+ sudo tee /usr/local/share/keyrings/<codename>-archive-keyring.gpg \
+ > /dev/null
+ ```
+
+ Add your project as a source:
+
+ ```shell
+ echo 'deb-src [ signed-by=/usr/local/share/keyrings/<codename>-archive-keyring.gpg ] https://gitlab.example.com/api/v4/projects/<project_id>/packages/debian <codename> <component1> <component2>' \
+ | sudo tee /etc/apt/sources.list.d/gitlab_project-sources.list
+ sudo apt-get update
+ ```
+
+1. Download the source package:
+
+ ```shell
+ sudo apt-get source -t <codename> <package-name>
+ ```