Dépôt Debian APT repository

Voir :

Notes debmirror

http://doc.ubuntu-fr.org/tutoriel/comment_creer_depot

Voir aussi :

aptly

wget -c http://www.gostcrypt.org/download/1.0/linux/Gostcrypt_1.0.deb mv Gostcrypt_1.0.deb gostcrypt.deb wget -c http://ftp.fr.debian.org/debian/pool/main/w/wxwidgets2.8/libwxgtk2.8-dev_2.8.12.1-12_amd64.deb wget -c https://github.com/adobe/brackets/releases/download/release-1.5/Brackets.Release.1.5.64-bit.deb wget -c ftp://ftp.mondorescue.org/debian/8/mondo_3.2.1-1_amd64.deb wget -c http://ftp.fr.debian.org/debian/pool/non-free/a/afio/afio_2.5.1.20130626+gite266635-1_amd64.deb wget -c http://ftp.fr.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-linux-nonfree_0.44~bpo8+1_all.deb wget -c http://ftp.fr.debian.org/debian/pool/main/p/pdfedit/pdfedit_0.4.5-1_amd64.deb

Modification d'un paquet .deb

wget -c http://www.gostcrypt.org/download/1.0/linux/Gostcrypt_1.0.deb rm tmp* -rf mkdir tmp cd tmp/ ar x ../Gostcrypt_1.0.deb ls -l mkdir DEBIAN cd DEBIAN/ tar xzvf ../control.tar.gz ls rm ../control.tar.gz vim control cd .. ls cd .. mv Gostcrypt_1.0.deb .. dpkg-deb --build tmp/

Comment créer un dépôt de paquets

Réf :

http://doc.ubuntu-fr.org/tutoriel/comment_creer_depot

https://wiki.debian.org/SettingUpSignedAptRepositoryWithReprepro

apt-get install reprepro
mkdir apt cd apt mkdir conf mkdir incoming

conf/distributions

Origin: Acme Label: Acme Suite: stable Codename: jessie Version: 8.2 Architectures: amd64 Components: main Description: Global Private Acme Repository

Placer les fichiers .deb dans le dossier incoming

reprepro -Vb . includedeb (distribution) incoming/(nom_du_paquet)

Exemple :

reprepro -Vb . includedeb jessie incoming/atop

/etc/nginx/sites-available/repo

server { listen 80 ; server_name apt.acme.fr ; root /var/www/apt ; autoindex on; charset utf-8; }

Faire un Dépôt partiel (partial Debian mirror) qui contiendra l'ensemble des paquets nécessaires

Voir

https://www.debian-administration.org/article/286/Setting_up_your_own_APT_repository_with_upload_support

https://blog.sileht.net/create-a-smart-debian-repository-with-reprepro.html

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

eval $(gpg-agent --daemon)

Et

apt-get install paquet cd /var/www/apt/incoming/ for paq in $(dpkg -l | grep ^ii | awk '{print $2}') ; do apt-get download $paq ; done cd .. for deb in incoming/*.deb ; do reprepro -Vb . includedeb jessie $deb ; done

add_packages.sh

#! /bin/bash set -o nounset WD=$(dirname $(realpath $0)) pushd . > /dev/null cd /var/www/apt/incoming/ for paq in $(cat $WD/packages_list.txt) $(dpkg -l | grep ^ii | awk '{print $2}' | egrep -v "$(cat $WD/packages_list_ignored.txt |tr "\n" "|" | sed -e 's/|$//')" ) do apt-get download $paq # > /dev/null done cd /var/www/apt/ for deb in incoming/*.deb do reprepro -Vb . includedeb jessie $deb # >/dev/null done popd > /dev/nul

Créer un paquet Debian

https://www.debian.org/doc/manuals/packaging-tutorial/packaging-tutorial.fr.pdf

Signer les paquets

Sur le serveur repo

Générer une clef

Export de la clef publique

gpg --list-key gpg --export -a 0x3E4DC2000A8903CF > /var/www/apt/conf/0x3E4DC2000A8903CF.asc

conf/distributions

SignWith: 0x3E4DC2000A8903CF

reprepro --ask-passphrase export

Sur un client

wget http://repo.local/conf/0x3E4DC2000A8903CF.asc apt-key add 0x3E4DC2000A8903CF.asc #curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3E4DC2000A8903CF" | sudo apt-key add