diff --git a/docs/debian/apt/apt_preferences-hold.md b/docs/debian/apt/apt_preferences-hold.md new file mode 100644 index 0000000..210e57c --- /dev/null +++ b/docs/debian/apt/apt_preferences-hold.md @@ -0,0 +1,118 @@ +# apt préférences, pinning, hold + +emplacement des fichiers: +`/etc/apt/preferences` ou `/etc/apt/preferences.d/perso` ou `/etc/apt/preferences.d/perso.pref` + + +## dépôts/branches debian + +* voir les caractéristiques des dépots: `pager /var/lib/apt/lists/...InRelease|Release` +* `apt policy` + + Suite | Codename | Label | Origin + :--: | :--: | :--: | :--: + stable | stretch | Debian | Debian + stable | stretch | Debian-Security | Debian + stable-updates | stretch-updates | Debian | Debian + stretch-backports | stretch-backports | Debian Backports | Debian Backports + + + Suite | Codename | Label | Origin | note + :--: | :--: | :--: | :--: | :--: + testing | buster | Debian | Debian | + testing | buster | Debian-Security | Debian | utile? + testing-updates | buster-updates | Debian | Debian | utile? + + + Suite | Codename | Label | Origin + :--: | :--: | :--: | :--: + unstable | sid | Debian | Debian + + +* pour toutes les branches, Components: `main` `contrib` `non-free` + + +## syntaxe préférences APT + +```text +Origin -> o= +Label -> l= +Suite -> a= (archive) +Version -> v= +Components -> c= (main contrib non-free) +Codename -> n= (name) +``` + +## préférences sur branche + +suivi testing ou codename + +```text + ### stable en fallback, cet épinglage n'est pas fonctionnellement utile +Package: * +Pin: release a=stable,n=stretch +Pin-Priority: 400 + + ### sid +Package: * +Pin: release a=unstable,n=sid +Pin-Priority: -10 +``` + +* installer un paquet de sid|unstable +```shell +apt -t unstable install + # ou +apt -t sid install + # ou +apt /unstable +``` + +## préférence sur version paquet + +* maintenir version 1 +```text +Package: +Pin: version * +Pin-Priority: 1001 +``` + +* maintenir version 1, équivalent +```text +Package: +Pin: release a=now +Pin-Priority: 1001 +``` +(release a=now indique les paquets installés) + +* éviter une installation version 2 +```text +Package: +Pin: version * +Pin-Priority: -10 +``` + +## hold + +hold permet de figer un paquet, sans discernement comme la version par exemple. plus de mise à jour possible sans marquage **unhold** + +* figeage (hold) d'un paquet en place +```shell +apt-mark hold +``` + +* libérer un paquet +```shell +apt-mark unhold +``` + +* voir tous les paquets marqués hold +```shell +apt-mark showhold +``` + +* combiner unhold et maj +```shell +apt --ignore-hold upgrade +``` +équivalent de `apt-mark unhold *` & `apt upgrade` diff --git a/mkdocs.yml b/mkdocs.yml index 41a0d0d..1c53432 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -14,6 +14,7 @@ pages: - home: "index.md" - debian: - apt: + - préférences hold: debian/apt/apt_preferences-hold.md - sources: debian/apt/sources.md - sources snapshot: debian/apt/sources_snapshot.md - unattended-upgrade: debian/apt/unattended-upgrade.md