# Häufig genutzte 3rd-Party Repositories

Beschreibt die schnelle Einrichtung von häufig genutzten 3rd-Party Repositories wie z.B. für docker oder des Icinga2-Clients

# download.docker.com (Docker + Compose)

```bash
apt-get update
apt-get install ca-certificates curl gnupg
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
chmod a+r /etc/apt/keyrings/docker.gpg
echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get update
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
```

from [https://docs.docker.com/engine/install/debian/](https://docs.docker.com/engine/install/debian/)

# packages.icinga.com (Icinga2)

```bash
apt update
apt -y install apt-transport-https wget gnupg
wget -O - https://packages.icinga.com/icinga.key | gpg --dearmor -o /usr/share/keyrings/icinga-archive-keyring.gpg
DIST=$(awk -F"[)(]+" '/VERSION=/ {print $2}' /etc/os-release); \
 echo "deb [signed-by=/usr/share/keyrings/icinga-archive-keyring.gpg] https://packages.icinga.com/debian icinga-${DIST} main" > \
 /etc/apt/sources.list.d/${DIST}-icinga.list
 echo "deb-src [signed-by=/usr/share/keyrings/icinga-archive-keyring.gpg] https://packages.icinga.com/debian icinga-${DIST} main" >> \
 /etc/apt/sources.list.d/${DIST}-icinga.list
apt update
```

from [https://icinga.com/docs/icinga-2/latest/doc/02-installation/01-Debian/](https://icinga.com/docs/icinga-2/latest/doc/02-installation/01-Debian/)

# deb.sury.org (PHP)

```bash
apt update
apt -y install lsb-release ca-certificates curl
curl -sSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb
dpkg -i /tmp/debsuryorg-archive-keyring.deb
sh -c 'echo "deb [signed-by=/usr/share/keyrings/debsuryorg-archive-keyring.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
apt update
```

from [https://packages.sury.org/php/](https://packages.sury.org/php/)

# repo.mongodb.org (MongoDB Community Edition)

#### Add the MongoDB apt repository and install the MongoDB packages

Replace the Version (4.4) with the one you want to install.

```bash
apt-get install gnupg curl
echo "deb [ signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/debian bookworm/mongodb-org/8.0 main" | tee /etc/apt/sources.list.d/mongodb-org-8.0.list
apt-get update
apt-get install -y mongodb-org
```

from [https://www.mongodb.com/docs/v8.0/tutorial/install-mongodb-on-debian/](https://www.mongodb.com/docs/v8.0/tutorial/install-mongodb-on-debian/)

# repo.percona.com (Percona MySQL and others)

```bash
apt update
apt install curl gnupg2 lsb-release
curl -O https://repo.percona.com/apt/percona-release_latest.generic_all.deb
dpkg -i percona-release_latest.generic_all.deb
percona-release enable tools
```

from [https://docs.percona.com/percona-server/8.0/apt-repo.html](https://docs.percona.com/percona-server/8.0/apt-repo.html)

# packagecloud.io/crowdsec (Crowdsec Security)

```
apt update
apt install debian-archive-keyring
apt install -y curl gnupg apt-transport-https
mkdir -p /etc/apt/keyrings/
curl -fsSL https://packagecloud.io/crowdsec/crowdsec/gpgkey | gpg --dearmor > /etc/apt/keyrings/crowdsec_crowdsec-archive-keyring.gpg
echo "deb [signed-by=/etc/apt/keyrings/crowdsec_crowdsec-archive-keyring.gpg] https://packagecloud.io/crowdsec/crowdsec/any any main" > /etc/apt/sources.list.d/crowdsec_crowdsec.list
echo "#deb-src [signed-by=/etc/apt/keyrings/crowdsec_crowdsec-archive-keyring.gpg] https://packagecloud.io/crowdsec/crowdsec/any any main" >> /etc/apt/sources.list.d/crowdsec_crowdsec.list
apt update
apt install crowdsec
```

from [https://docs.crowdsec.net/u/getting\_started/installation/linux/](https://docs.crowdsec.net/u/getting_started/installation/linux/)

# packages.gitlab.com (Gitlab)

### gitlab-ce

```bash
apt update
apt install -y curl ca-certificates apt-transport-https gnupg2
curl --location "https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh" | bash
apt update
EXTERNAL_URL="https://gitlab.example.com" apt install gitlab-ce
# or
# GITLAB_ROOT_EMAIL="admin@example.com" GITLAB_ROOT_PASSWORD="strongpassword" EXTERNAL_URL="https://gitlab.example.com" apt install gitlab-ce
cat /etc/gitlab/initial_root_password
```

from [https://docs.gitlab.com/install/package/debian/](https://docs.gitlab.com/install/package/debian/)

### gitlab-runner

```bash
curl -L "https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh" | bash
cat <<EOF | sudo tee /etc/apt/preferences.d/pin-gitlab-runner.pref
Explanation: Prefer GitLab provided packages over the Debian native ones
Package: gitlab-runner
Pin: origin packages.gitlab.com
Pin-Priority: 1001
EOF
apt update
apt install gitlab-runner
```

from [https://docs.gitlab.com/runner/install/linux-repository/](https://docs.gitlab.com/runner/install/linux-repository/)

# nginx.org (nginx)

```bash
apt update
apt install curl gnupg2 ca-certificates lsb-release debian-archive-keyring
curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor | tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null
# stable nginx
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] http://nginx.org/packages/debian `lsb_release -cs` nginx" | tee /etc/apt/sources.list.d/nginx.list
# mainline nginx
#echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] http://nginx.org/packages/mainline/debian `lsb_release -cs` nginx" | tee /etc/apt/sources.list.d/nginx.list
echo -e "Package: *\nPin: origin nginx.org\nPin: release o=nginx\nPin-Priority: 900\n" | tee /etc/apt/preferences.d/99nginx
apt update
apt install nginx
```

from [https://docs.nginx.com/nginx/admin-guide/installing-nginx/installing-nginx-open-source/#debian-packages](https://docs.nginx.com/nginx/admin-guide/installing-nginx/installing-nginx-open-source/#debian-packages)

# artifacts.elastic.co (Elasticsearch)

```bash
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | gpg --dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg
apt install apt-transport-https
echo "deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/9.x/apt stable main" | tee /etc/apt/sources.list.d/elastic-9.x.list
apt update
apt install elasticsearch
```

from [https://www.elastic.co/docs/deploy-manage/deploy/self-managed/install-elasticsearch-with-debian-package](https://www.elastic.co/docs/deploy-manage/deploy/self-managed/install-elasticsearch-with-debian-package)

# nodejs.org (nodeJS)

<p class="callout info">NodeJS bietet viele verschiedene Varianten. Daher ist es am einfachsten direkt auf der Herstellerseite zu schauen:  
  
für Debian und Co: https://github.com/nodesource/distributions  
andere: [https://nodejs.org/en/download/package-manager](https://nodejs.org/en/download/package-manager)</p>

# mydumper.github.io (MyDumper MySQL Backup)

```bash
mkdir -p /etc/apt/keyrings/
wget -qO- 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x1D357EA7D10C9320371BDD0279EA15C0E82E34BA&exact=on' | tee /etc/apt/keyrings/mydumper.asc
echo "deb [signed-by=/etc/apt/keyrings/mydumper.asc] https://mydumper.github.io/mydumper/repo/apt/debian trixie main" > /etc/apt/sources.list.d/mydumper.list
echo "#deb [signed-by=/etc/apt/keyrings/mydumper.asc] https://mydumper.github.io/mydumper/repo/apt/debian trixie testing" >> /etc/apt/sources.list.d/mydumper.list
apt update
apt install mydumper
```

From [https://mydumper.github.io/mydumper/docs/html/installing.html](https://mydumper.github.io/mydumper/docs/html/installing.html)