Outils pour utilisateurs

Outils du site


blog

SystemD Forker Debian, changer de distro ou passer à BSD

Voir : https://github.com/davmac314/dinit/blob/master/doc/linux/DINIT-AS-INIT.md

antiX Linux est une distribution Linux dérivée de Debian, adaptée aux ordinateurs vieillissants, depuis les Pentium III. Cette distribution utilise sysvinit en lieu et place de systemd, pour des raisons qui ne sont pas idéologiques mais techniques.

Beaucoup sont contraint à utiliser SystemD, il est difficile de s'en passer (Gnome / Mate-desktop, Udev)

… runit est notamment utilisé par défaut par la distribution void-linux et empaqueté (à destination des utilisateurs avancés) pour d’autres distributions telles que Artix Linux (dérivée de Archlinux pour supporter officiellement les autres systèmes d’init différents de Systemd) ou Debian (il s’agit d’une des trois options du paquet init, les autres étant sysvinit-core et systemd-sysv). Il est également à noter que des développements ont lieu via Debian. Un autre, nosh est également intéressant car capable d’importer les unit de SystemD.

Source : https://linuxfr.org/news/les-daemontools-ont-20-ans

La distro VoidLinux utilise runit à la place de SystemD

En cherchant un peut pour Debian on trouve l'astuce suivante.

/etc/apt/preferences.d/systemd

Package: systemd
Pin: origin 
Pin-Priority: -1

Package: systemd-sysv
Pin: release o=Debian
Pin-Priority: -1

Voir : http://without-systemd.org/wiki/index.php/How_to_remove_systemd_from_a_Debian_jessie/sid_installation

Ou encore

Forcer le lancement de systemd

# cat /proc/1/comm
init

/etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT="init=/bin/systemd"
update-grub

FIXME

/etc/default/grub

GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"
2025/03/24 15:06

Notes Mise à jour Debian

Voir

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) ...
root@vivabelo:~# LANG=C 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:
  libwine libwine:i386 libwine-dev wine wine32:i386 wine64 wine64-tools
0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.


# dpkg --get-selections | grep hold
# 

Résolution du problème avec aptitude

aptitude upgrade

ou

¿Acepta esta solución? [Y/n/q/?]n               
Las acciones siguientes resolverán estas dependencias                                                    
                                                                                                         
      Eliminar los paquetes siguientes:                                             
1)      libavcodec61 [7:7.1.3-1 (now)]                                              
                                                    
      Instalar los paquetes siguientes:                                             
2)      fonts-wine [10.0~repack-6 (stable)]                                         
3)      libavcodec-extra61 [7:7.1.3-0+deb13u1 (stable, stable-security)]            
4)      libavformat61 [7:7.1.3-0+deb13u1 (stable, stable-security)]                 
5)      libbluray2 [1:1.3.4-1+b2 (stable)]                                          
6)      libcapi20-3t64 [1:3.27-3.2+b1 (stable)]     
7)      libosmesa6 [25.0.7-2 (stable)]                                              
8)      librav1e0.7 [0.7.1-9+b2 (stable)]                                                
9)      libudfread0 [1.1.2-1+b2 (stable)]                                           
10)     libwine [10.0~repack-6 (stable)]                                            
11)     libz-mingw-w64 [1.3.1+dfsg-2 (stable)]                                      
12)     wine64 [10.0~repack-6 (stable)]             
                                                                                                         
      Desactualizar los paquetes siguientes:                                        
13)     libavutil59 [7:7.1.3-1 (now) -> 7:7.1.3-0+deb13u1 (stable, stable-security)]
                                                                                                         
      Leave the following dependencies unresolved:                                  
14)     wine64 recomienda wine32 (= 10.0~repack-6)
2025/03/24 15:06

Apt debian

Note :

debconf: delaying package configuration, since apt-utils is not installed

/etc/apt/apt.conf.d/01norecommend

APT::Install-Recommends "0";
APT::Install-Suggests "0";

Pour installer les dépendances recommandées pour un paquet précis

apt-get install -o 'APT::Install-Recommends=1' nompaquet

Pour vérifier

apt-config dump | grep Recommends

/etc/apt/apt.conf

Acquire {
Languages "none";
};
Configurer tous les paquets qui ne le sont pas
dpkg --configure -a
Noexec

Voir Notes sécurité OS GNU_Linux hardening - partitions - noexec Sécurité système de fichier - noexec ro

Désactivation de l'installation automatique des paquets recommandés.

Dans le fichier , il faut ajouter les lignes ci-dessous :

/root/.aptitude/config

aptitude "";
aptitude::Suggests-Important "false";
aptitude::Recommends-Important "false";

Pb

Pb W: There is no public key available for the following key IDs

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

apt-get update
W: There is no public key available for the following key IDs:
7638D0442B90D010
Solutions

Solution 1

apt-get install debian-keyring debian-archive-keyring

Solution 2

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7638D0442B90D010

Solution 3 - apt-key si Proxy

curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x7638D0442B90D010" | sudo apt-key add
Suppressions paquets - Err le sous-processus script post-installation installé a retourné une erreur de sortie d'état 1
insserv: Service portmap has to be enabled to start service nfs-common

insserv: exiting now!

update-rc.d: error: insserv rejected the script header

dpkg : erreur de traitement de nfs-common (--configure) :

le sous-processus script post-installation installé a retourné une erreur de sortie d'état 1

configured to not write apport reports

                                      Des erreurs ont été rencontrées pendant l'exécution :

nfs-common

E: Sub-process /usr/bin/dpkg returned an error code (1)

Si pas de NFS v1,v2 ou v3 (et si NFSv4 !?)

service nfs-common stop
service portmap stop
service rpcbind stop
apt-get -y autoremove --purge portmap rpcbind
Pb - The following upgrades have been deferred due to phasing
# apt-get dist-upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following upgrades have been deferred due to phasing:
  apparmor libapparmor1 libpciaccess0
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
#
Solution
# apt -o APT::Get::Always-Include-Phased-Updates=true upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  apparmor libapparmor1 libpciaccess0
3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 710 kB of archives.
After this operation, 1024 B of additional disk space will be used.
Do you want to continue? [Y/n]
2025/03/24 15:06

Debian standard install postinstall

TODO : Ansible

/etc/vim/vimrc.local

syntax on

if has("autocmd")
  au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
endif


if has("autocmd")
  filetype plugin indent on
endif

" The following are commented out as they cause vim to behave a lot
" differently from regular Vi. They are highly recommended though.
set showcmd             " Show (partial) command in status line.
set showmatch           " Show matching brackets.
"set ignorecase         " Do case insensitive matching
set smartcase           " Do smart case matching
set incsearch           " Incremental search
"set autowrite          " Automatically save before commands like :next and :make
set hidden              " Hide buffers when they are abandoned
"set mouse=a            " Enable mouse usage (all modes)

Vérif comme sur RedHat (sécurité)

Dernière connexion : vendredi 29 juillet 2016 à 11:21:45 CEST de gateway sur pts/0
Dernière connexion échoué :  vendredi 29 juillet 2016 à 11:24:37 CEST sur pts/1
Il y a 3 tentatives échouées de connexion depuis la dernière connexion réussie.
2025/03/24 15:06

Debian reboot needed

/etc/needrestart/restart.d/

apt-get install reboot-notifier
$ dpkg -S /usr/sbin/needrestart 
needrestart: /usr/sbin/needrestart

/var/run/reboot-required

2025/03/24 15:06
blog.txt · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki