Notes Mise à jour Debian

Voir

UnattendedUpgrades

http://www.pontikis.net/blog/simple-steps-to-update-a-debian-server

apt-get update
apt list --upgradable

apt install apt-show-versions apt-show-versions | grep upgradeable

apt-get install update-notifier-common:
/usr/lib/update-notifier/apt-check
/usr/lib/update-notifier/apt-check --human-readable

apt-get install debian-goodies checkrestart apt-get install update-notifier-common
checkrestart |grep ^servi | bash -s --

http://unix.stackexchange.com/questions/75807/no-public-key-available-on-apt-get-update

# apt-get update
Atteint http://ftp.fr.debian.org squeeze/contrib i386 Packages [63/1807]
Ign http://http.debian.net/debian/ squeeze-lts/main Translation-en
Atteint http://ftp.fr.debian.org squeeze/non-free i386 Packages
Atteint http://ftp.fr.debian.org squeeze-updates/main Sources/DiffIndex
Ign http://http.debian.net/debian/ squeeze-lts/main Translation-fr
Atteint http://http.debian.net squeeze-lts Release.gpg
Atteint http://ftp.fr.debian.org squeeze-updates/contrib Sources
Réception de : 1 http://http.debian.net squeeze-lts Release [28,7 kB]
Ign http://http.debian.net squeeze-lts Release
Atteint http://http.debian.net squeeze-lts/main Sources/DiffIndex
Ign http://http.debian.net squeeze-lts/main i386 Packages/DiffIndex
Atteint http://ftp.fr.debian.org squeeze-updates/main i386 Packages/DiffIndex
Atteint http://ftp.fr.debian.org squeeze-updates/contrib i386 Packages
Atteint http://http.debian.net squeeze-lts/main i386 Packages
28,7 ko réceptionnés en 1s (26,3 ko/s)
Lecture des listes de paquets... Fait
W: Erreur de GPG : http://http.debian.net squeeze-lts Release : Les signatures suivantes ne sont pas valables : BADSIG 8B48AD6246925553 Debian Archive Automat
ic Signing Key (7.0/wheezy) <ftpmaster@debian.org>

apt-get install debian-keyring debian-archive-keyring apt-get update apt-get upgrade

apt-get upgrade ouvre parfois une jolie fenêtre quand le maintenaient du paquet propose un fichier de configuration différent que votre fichier actuel. L'interface (debconf !?) proposée par défaut de se prête pas vraiment aux scripts.

Solution

DEBIAN_FRONTEND='text'

for SERV in $LISTE_SERV do ssh root@$SERV 'env DEBIAN_FRONTEND='text' apt-get upgrade -y' done

Une nouvelle version du fichier de configuration /etc/samba/smb.conf est
disponible mais la version actuellement utilisée a été modifiée localement.
1. Installer la version du responsable du paquet
2. Garder la version actuellement installée
3. Montrer les différences entre les versions
4. Montrer côte à côte les différences entre les versions
5. Montrer les différences entre les trois versions du fichier
6. Fusionner les trois versions (« 3-way merge » : expérimental)
7. Lancer un shell pour examiner la situation
Action souhaitée pour le fichier de configuration modifié smb.conf :

Voir :

export DEBIAN_FRONTEND='noninteractive'
dpkg-reconfigure --frontend=readline debconf

Exit-il des packages plus récent à mettre à jour

apt list --upgradable

Pour les anciennes Debian ?

check_update_apt.sh

#! /bin/bash # Package update-notifier-common nécessaire set -o nounset #declare -i recmaj #declare -i secmaj IFS=';' read recmaj secmaj <<< $(/usr/lib/update-notifier/apt-check 2>&1) echo "RECMAJ : $recmaj" echo "SECMAJ : $secmaj"

/usr/lib/update-notifier/apt-check du paquet update-notifier-common peur être remplacé par

apt-get update LC_ALL=C apt-get -s dist-upgrade | grep "^[[:digit:]]\+ upgraded"

Pb

Err. This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.

apt-get update --allow-releaseinfo-change

Err - The following packages have been kept back - 1 not upgraded

# apt-get upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
libjson-xs-perl
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
# apt-get dist-upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
libjson-xs-perl
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
# apt list --upgradable
libjson-xs-perl/oldstable-security 4.040-1~deb12u1 amd64 [upgradable from: 4.030-2+b5]
Notice: There are 2 additional versions. Please use the '-a' switch to see them.
# apt-show-versions | grep upgradeable
libjson-xs-perl:amd64/testing 4.030-2+b5 upgradeable to 4.040-1~deb12u1
# apt-get --with-new-pkgs upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
libjson-xs-perl
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
# apt-mark showhold
#
# apt upgrade --with-new-pkgs libjson-xs-perl
Calculating upgrade... Error!
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
Unsatisfied dependencies:
libjson-xs-perl : Depends: perlapi-5.36.0
Error: Unable to correct problems, you have held broken packages.
# apt install --only-upgrade libjson-xs-perl
Solving dependencies... Error!
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
Unsatisfied dependencies:
libjson-xs-perl : Depends: perlapi-5.36.0
Error: Unable to correct problems, you have held broken packages.
Error: The following information from --solver 3.0 may provide additional context:
Unable to satisfy dependencies. Reached two conflicting decisions:
1. libjson-xs-perl:amd64=4.040-1~deb12u1 is selected as an upgrade
2. libjson-xs-perl:amd64=4.040-1~deb12u1 Depends perlapi-5.36.0
but none of the choices are installable:
- perl-base:amd64=5.36.0-7+deb12u3 is not selected for install
- perl-base:amd64=5.36.0-7+deb12u2 is not selected for install
# apt-get purge libjson-xs-perl
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
libcommon-sense-perl libtypes-serialiser-perl
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
libjson-xs-perl*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 213 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 544809 files and directories currently installed.)
Removing libjson-xs-perl (4.030-2+b5) ...
Processing triggers for man-db (2.13.1-1) ...