tech:depot_debian_apt_repository
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| tech:depot_debian_apt_repository [2025/11/14 08:45] – Jean-Baptiste | tech:depot_debian_apt_repository [2026/06/17 11:01] (Version actuelle) – Jean-Baptiste | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| + | {{tag> | ||
| + | |||
| + | # Dépôt Debian APT repository | ||
| + | |||
| + | Voir : | ||
| + | * [[Notes debmirror]] | ||
| + | * http:// | ||
| + | |||
| + | Voir aussi : | ||
| + | * aptly | ||
| + | |||
| + | ~~~bash | ||
| + | wget -c http:// | ||
| + | mv Gostcrypt_1.0.deb gostcrypt.deb | ||
| + | wget -c http:// | ||
| + | wget -c https:// | ||
| + | wget -c ftp:// | ||
| + | wget -c http:// | ||
| + | wget -c http:// | ||
| + | wget -c http:// | ||
| + | ~~~ | ||
| + | |||
| + | Modification d'un paquet .deb | ||
| + | ~~~bash | ||
| + | wget -c http:// | ||
| + | rm tmp* -rf | ||
| + | mkdir tmp | ||
| + | cd tmp/ | ||
| + | ar x ../ | ||
| + | ls -l | ||
| + | mkdir DEBIAN | ||
| + | cd DEBIAN/ | ||
| + | tar xzvf ../ | ||
| + | ls | ||
| + | rm ../ | ||
| + | vim control | ||
| + | cd .. | ||
| + | ls | ||
| + | cd .. | ||
| + | mv Gostcrypt_1.0.deb .. | ||
| + | dpkg-deb --build | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Comment créer un dépôt de paquets | ||
| + | |||
| + | Réf : | ||
| + | * http:// | ||
| + | * https:// | ||
| + | |||
| + | ~~~bash | ||
| + | apt-get install reprepro | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | mkdir apt | ||
| + | cd apt | ||
| + | mkdir conf | ||
| + | mkdir incoming | ||
| + | ~~~ | ||
| + | |||
| + | `conf/ | ||
| + | ~~~ini | ||
| + | Origin: Acme | ||
| + | Label: Acme | ||
| + | Suite: stable | ||
| + | Codename: jessie | ||
| + | Version: 8.2 | ||
| + | Architectures: | ||
| + | Components: main | ||
| + | Description: | ||
| + | ~~~ | ||
| + | |||
| + | Placer les fichiers .deb dans le dossier incoming | ||
| + | |||
| + | `reprepro -Vb . includedeb (distribution) incoming/ | ||
| + | |||
| + | Exemple : | ||
| + | ~~~bash | ||
| + | reprepro -Vb . includedeb jessie incoming/ | ||
| + | ~~~ | ||
| + | |||
| + | `/ | ||
| + | ~~~nginx | ||
| + | server { | ||
| + | listen 80 ; | ||
| + | server_name apt.acme.fr ; | ||
| + | |||
| + | root / | ||
| + | |||
| + | autoindex on; | ||
| + | charset utf-8; | ||
| + | } | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Faire un Dépôt partiel (partial Debian mirror) qui contiendra l' | ||
| + | |||
| + | Voir | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | Voir équivalent pour RPM RedHat [[creation_d_un_depot_redhat_rpm_pour_yum]] | ||
| + | ## Add Packages in local Debian repository | ||
| + | |||
| + | |||
| + | Exemple | ||
| + | |||
| + | Pour que GPG ne nous demande pas mille fois la paraphrase | ||
| + | ~~~bash | ||
| + | eval $(gpg-agent --daemon) | ||
| + | ~~~ | ||
| + | |||
| + | Et | ||
| + | ~~~bash | ||
| + | apt-get install paquet | ||
| + | cd / | ||
| + | for paq in $(dpkg -l | grep ^ii | awk ' | ||
| + | cd .. | ||
| + | for deb in incoming/ | ||
| + | ~~~ | ||
| + | |||
| + | `add_packages.sh` | ||
| + | ~~~bash | ||
| + | #! /bin/bash | ||
| + | |||
| + | set -o nounset | ||
| + | WD=$(dirname $(realpath $0)) | ||
| + | |||
| + | pushd . > /dev/null | ||
| + | |||
| + | cd / | ||
| + | for paq in $(cat $WD/ | ||
| + | do | ||
| + | apt-get download $paq # > /dev/null | ||
| + | done | ||
| + | |||
| + | |||
| + | cd / | ||
| + | for deb in incoming/ | ||
| + | do | ||
| + | reprepro -Vb . includedeb jessie $deb # >/ | ||
| + | done | ||
| + | |||
| + | popd > /dev/nul | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Créer un paquet Debian | ||
| + | |||
| + | https:// | ||
| + | |||
| + | ## Signer les paquets | ||
| + | |||
| + | Sur le serveur repo | ||
| + | |||
| + | 1) Générer une clef | ||
| + | |||
| + | Export de la clef publique | ||
| + | ~~~bash | ||
| + | gpg --list-key | ||
| + | gpg --export -a 0x3E4DC2000A8903CF > / | ||
| + | ~~~ | ||
| + | |||
| + | `conf/ | ||
| + | ~~~ | ||
| + | SignWith: 0x3E4DC2000A8903CF | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | reprepro --ask-passphrase export | ||
| + | ~~~ | ||
| + | |||
| + | Sur un client | ||
| + | ~~~bash | ||
| + | wget http:// | ||
| + | apt-key add 0x3E4DC2000A8903CF.asc | ||
| + | |||
| + | #curl -sL " | ||
| + | ~~~ | ||
| + | |||
| + | Autre exemple : | ||
| + | Add GPG key | ||
| + | ~~~bash | ||
| + | curl -fsSL https:// | ||
| + | ~~~ | ||
| + | |||
| + | `-f` : Fail silently on server errors | ||
| + | |||
| + | `-s` : Silent or quiet mode. Don't show progress meter or error messages | ||
| + | |||
| + | `-S` : When used with -s, --silent, it makes curl show an error message if it fails | ||
| + | |||
| + | `-L` : If the server reports that the requested page has moved to a different location, this option will make curl redo the request on the new place. | ||
| + | |||
