Laufendes System ermitteln


reboot mit neuem System

root@i7-graf-buster-dh:~# uname -a Linux i7-graf-buster-dh 4.15.0-3-amd64 #1 SMP Debian 4.15.17-1 (2018-04-19) x86_64 GNU/Linux root@i7-graf-buster-dh:~#

Welche Kernel liegen in /boot?

root@i7-graf-buster-dh:~# ll /boot
insgesamt 60269
-rw-r--r-- 1 root root   199635 Mär 20 09:31 config-4.15.0-2-amd64
-rw-r--r-- 1 root root   199706 Apr 19 12:13 config-4.15.0-3-amd64
drwx------ 4 root root      512 Apr 29 16:49 efi
lrwxrwxrwx 1 root root       15 Mai 11  2017 grub -> /boot/efi/grub/
-rw-r--r-- 1 root root 22563164 Apr 18 17:38 initrd.img-4.15.0-2-amd64
-rw-r--r-- 1 root root 22696420 Apr 29 16:07 initrd.img-4.15.0-3-amd64
-rw-r--r-- 1 root root  3087126 Mär 20 09:31 System.map-4.15.0-2-amd64
-rw-r--r-- 1 root root  3093953 Apr 19 12:13 System.map-4.15.0-3-amd64
-rw-r--r-- 1 root root  4921104 Mär 20 09:31 vmlinuz-4.15.0-2-amd64
-rw-r--r-- 1 root root  4933392 Apr 19 12:13 vmlinuz-4.15.0-3-amd64
root@i7-graf-buster-dh:~#
Der Kernel 4.15.0-3 ist neu gekommen.

/etc/grub.d/40_custom editieren

In liegen zusätzlichee Entries die beim Bootscreen angezeigt werden.
Dort muss der Entry angepasst werden.
Früher lagen diese in /boot/efi/40_custom
root@i7-graf-buster-dh:cd  /etc/grub.d
root@i7-graf-buster-dh:/etc/grub.d# ll
insgesamt 92
-rwxr-xr-x 1 root root 10080 28. Feb 2024  00_header
-rwxr-xr-x 1 root root  6260 21. Apr 2023  05_debian_theme
-rwxr-xr-x 1 root root 13940 28. Feb 2024  10_linux
-rwxr-xr-x 1 root root 14513 28. Feb 2024  20_linux_xen
-rwxr-xr-x 1 root root   786 28. Feb 2024  25_bli
-rwxr-xr-x 1 root root 12661 28. Feb 2024  30_os-prober
-rwxr-xr-x 1 root root  1174 28. Feb 2024  30_uefi-firmware
-rwxr-xr-x 1 root root  4791 25. Jun 10:12 40_custom
-rwxr-xr-x 1 root root   215 23. Apr 2023  41_custom
-rw-r--r-- 1 root root   483 23. Apr 2023  README


Änderungen in /etc/grub.d/40_custom

Mit Editor /etc/grub.d/40_custom editieren dabei alle 4.15.0-2 nach 4.15.0-3 ändern
root@i7-graf-buster-dh:/etc/grub.d/# nano 40_custom
----------------------  ALT  ---------------------------------------------
menuentry 'i7-graf-buster-dh (buster | 4.15.0-2 | nvme0n1p4 | btrfs)' --class gnu-linux --class gnu --class os {
    search --no-floppy --fs-uuid --set=root 2e0f6b5c-9d5b-4766-9db4-e8364a3706d4
    linux  /boot/vmlinuz-4.15.0-2-amd64 root=UUID=2e0f6b5c-9d5b-4766-9db4-e8364a3706d4 ipv6.disable=1
    initrd /boot/initrd.img-4.15.0-2-amd64
}

----------------------  NEU  ---------------------------------------------
menuentry 'i7-graf-buster-dh (buster | 4.15.0-3 | nvme0n1p4 | btrfs)' --class gnu-linux --class gnu --class os {
    search --no-floppy --fs-uuid --set=root 2e0f6b5c-9d5b-4766-9db4-e8364a3706d4
    linux  /boot/vmlinuz-4.15.0-3-amd64 root=UUID=2e0f6b5c-9d5b-4766-9db4-e8364a3706d4 ipv6.disable=1
    initrd /boot/initrd.img-4.15.0-3-amd64
}
-------------------------------------------------------------------------
root@i7-graf-st-dh: cd /boot

installierte Pakete ermitteln

Nachdem der neue Kernl ja bootet wurde, kann das alte Kernelimage entfernt werden
Da gibt unterschiedliche Möglichkeiten:
  • Mittels dem Script **install_check** (Source liegt am Ende)
  • oder indem die Pakte selbt ermittelt werden.
    root@i7-graf-st-dh:/boot# dpkg -l | grep linux
    
    root@i7-graf-buster-dh:/boot/efi# dpkg -l | grep linux
    ii  binutils-x86-64-linux-gnu             2.30-15       amd64    GNU binary utilities, for x86-64-linux-gnu target
    ii  console-setup-linux                   1.184         all      Linux specific part of console-setup
    ii  fonts-linuxlibertine                  5.3.0-4       all      Linux Libertine family of fonts
    ii  libselinux1:amd64                     2.7-2+b2      amd64    SELinux runtime shared libraries
    ii  libv4l-0:amd64                        1.14.2-1      amd64    Collection of video4linux support libraries
    ii  libv4lconvert0:amd64                  1.14.2-1      amd64    Video4linux frame format conversion library
    ii  linux-base                            4.5           all      Linux image base package
    ii  linux-compiler-gcc-7-x86              4.15.17-1     amd64    Compiler for Linux on x86 (meta-package)
    ii  linux-headers-4.15.0-2-amd64          4.15.11-1     amd64    Header files for Linux 4.15.0-2-amd64
    ii  linux-headers-4.15.0-2-common         4.15.11-1     all      Common header files for Linux 4.15.0-2
    ii  linux-headers-4.15.0-3-amd64          4.15.17-1     amd64    Header files for Linux 4.15.0-3-amd64
    ii  linux-headers-4.15.0-3-common         4.15.17-1     all      Common header files for Linux 4.15.0-3
    ii  linux-headers-amd64                   4.15+92       amd64    Header files for Linux amd64 configuration (meta-package)
    ii  linux-image-4.15.0-2-amd64            4.15.11-1     amd64    Linux 4.15 for 64-bit PCs
    ii  linux-image-4.15.0-3-amd64            4.15.17-1     amd64    Linux 4.15 for 64-bit PCs
    ii  linux-image-amd64                     4.15+92       amd64    Linux for 64-bit PCs (meta-package)
    ii  linux-kbuild-4.15                     4.15.17-1     amd64    Kbuild infrastructure for Linux 4.15
    ii  linux-libc-dev:amd64                  4.15.17-1     amd64    Linux support headers for userspace development
    ii  util-linux                            2.31.1-0.5    amd64    miscellaneous system utilities
    root@i7-graf-buster-dh:/boot/efi#
    
    

    Welche Kernel liegen in /boot?

    root@i7-graf-buster-dh:~# ll /boot
    insgesamt 60269
    -rw-r--r-- 1 root root   199635 Mär 20 09:31 config-4.15.0-2-amd64
    -rw-r--r-- 1 root root   199706 Apr 19 12:13 config-4.15.0-3-amd64
    drwx------ 4 root root      512 Apr 29 16:49 efi
    lrwxrwxrwx 1 root root       15 Mai 11  2017 grub -> /boot/efi/grub/
    -rw-r--r-- 1 root root 22563164 Apr 18 17:38 initrd.img-4.15.0-2-amd64
    -rw-r--r-- 1 root root 22696420 Apr 29 16:07 initrd.img-4.15.0-3-amd64
    -rw-r--r-- 1 root root  3087126 Mär 20 09:31 System.map-4.15.0-2-amd64
    -rw-r--r-- 1 root root  3093953 Apr 19 12:13 System.map-4.15.0-3-amd64
    -rw-r--r-- 1 root root  4921104 Mär 20 09:31 vmlinuz-4.15.0-2-amd64
    -rw-r--r-- 1 root root  4933392 Apr 19 12:13 vmlinuz-4.15.0-3-amd64
    root@i7-graf-buster-dh:~#
    
    


    Über Paketmanager alle 4.15.0-2 löschen.
    Achtung: wenn auch eine der 4.15.0-3 Files gelöscht wird, steht Neuinstallation an da sie damit ihr laufendes System killen.

    alte Kernel und Linux-Header per aptitude purge löschen

    Die Pakete sind der Paketliste zu entnehmen
    Kernel nicht mittels rm direkt in /boot löschen.
    root@i7-graf-buster-dh:~# aptitude purge linux-headers-4.15.0-2-amd64 linux-headers-4.15.0-2-common
    linux-image-4.15.0-2-amd64
    
    Prüfen. Es sollte jetzt nur noch ein Kernel in /boot liegen
    root@i7-graf-buster-dh:~# ll /boot
    insgesamt 30213
    -rw-r--r-- 1 root root   199706 Apr 19 12:13 config-4.15.0-3-amd64
    drwx------ 4 root root      512 Apr 29 16:52 efi
    lrwxrwxrwx 1 root root       15 Mai 11  2017 grub -> /boot/efi/grub/
    -rw-r--r-- 1 root root 22696420 Apr 29 16:07 initrd.img-4.15.0-3-amd64
    -rw-r--r-- 1 root root  3093953 Apr 19 12:13 System.map-4.15.0-3-amd64
    -rw-r--r-- 1 root root  4933392 Apr 19 12:13 vmlinuz-4.15.0-3-amd64
    root@i7-graf-buster-dh:~#
    
    Vor reboot update-grub2 nicht vergegessen
    root@i7-graf-buster-dh:~# update-grub2
    GRUB-Konfigurationsdatei wird erstellt …
    Found background image: /usr/share/images/desktop-base/desktop-grub.png
    Linux-Abbild gefunden: /boot/vmlinuz-4.15.0-3-amd64
    initrd-Abbild gefunden: /boot/initrd.img-4.15.0-3-amd64
    Debian GNU/Linux 9 (stretch) auf /dev/nvme0n1p3 gefunden
    Debian GNU/Linux 9 (stretch) auf /dev/sda3 gefunden
    Debian GNU/Linux 9 (stretch) auf /dev/sda4 gefunden
    Adding boot menu entry for EFI firmware configuration erledigt
    root@i7-graf-buster-dh:~#
    
    Ist das System jetzt sauber?
    root@i7-graf-buster-dh:/boot/efi# cd
    root@i7-graf-buster-dh:~# bin/install_check
    + aptitude clean
    
    + aptitude -f install
    
    Es werden keine Pakete installiert, aktualisiert oder entfernt.
    0 Pakete aktualisiert, 0 zusätzlich installiert, 0 werden entfernt und 0 nicht aktualisiert.
    0 B an Archiven müssen heruntergeladen werden. Nach dem Entpacken werden 0 B zusätzlich belegt sein.
    
    + debfoster
    + deborphan
    + COLUMNS=200
    + dpkg -l
    + grep -v '^ii'
    + cat /tmp/i_check.tmp
    Gewünscht=Unbekannt/Installieren/R=Entfernen/P=Vollständig Löschen/Halten
    | Status=Nicht/Installiert/Config/U=Entpackt/halb konFiguriert/
    Halb installiert/Trigger erWartet/Trigger anhängig
    |/ Fehler?=(kein)/R=Neuinstallation notwendig (Status, Fehler: GROSS=schlecht)
    ||/ Name                                         Version                     Architektur                 Beschreibung
    +++-============================================-===========================-===========================-=============================================================================================
    + rm /tmp/i_check.tmp
    root@i7-graf-buster-dh:~#
    



    Das Script install_check

    Zum Abschluss das Script install_check
    Das Script install_check ist nicht Teil einer Distribution sondern eine Eigenentwicklung
    Das Script verwendet debfoster und deborphan Diese Pakete müssen Sie ggf nachinstallieren.
    • debfoster Die Debfoster-Anwendung ist ein Containerprogramm für die Paketmanager apt und dpkg. Es verwaltet eine Liste der installierten Pakete, die explizit angefordert wurden. Es verwendet eine Liste , welche Pakete installiert wurden, weil andere Pakete davon abhängig waren.
      Wenn debfoster ausgeführt wird, fragt es ob ein Paket behalten oder verworfen werden soll. So können wir z.B. alte Kernelimages verwerfen und neu behalten.
      Es ist dann nicht mehr erforderlich die Pakete manuell zu suchen.
    • deporhan zeigt uns verwaiste Pakete
      Diese können wir dann mit dem Paketmanager entfernen.
    ##!/bin/bash
    
    #
    # Systemüberprüfung
    #
    echo 'current state flag
    i - the package is installed and all its dependencies are satisfied.
    c - the package was removed, but its configuration files are still present.
    p - the package and all its configuration files were removed, or the package was never installed.
    v - the package is virtual.
    B - the package has broken dependencies.
    u - the package has been unpacked but not configured.
    C - half-configured: the packages configuration was interrupted.
    H - half-installed: the packages installation was interrupted
    '
    echo 'action flag
    i - the package will be installed.
    u - the package will be upgraded.
    d - the package will be deleted: it will be removed, but its configuration files will remain on the system.
    p - the package will be purged: it and its configuration files will be removed.
    h - the package will be held back: it will be kept at its current version, 
        even if a newer version becomes available, until the hold is cancelled.
    F - An upgrade of the package has been forbidden.
    r - the package will be reinstalled.
    B - the package is "broken": some of its dependencies will not be satisfied. 
         aptitude will not allow you to install, remove, or upgrade anything while you have broken package
    '
    echo 'third Character
    A  - the package was automatically installed
    '
    
    
    set -x
    
    aptitude clean
    aptitude -f install
    debfoster
    deborphan
    COLUMNS=200 dpkg -l | grep -v ^ii >/tmp/i_check.tmp
    cat /tmp/i_check.tmp
    rm /tmp/i_check.tmp
    
    set +x
    
    

    Meine Hardware

    • Motherbord : Gigabyte Z170M-D3H
    • CPU Intel Core I7 6700
    • Memory : 4 x 16 GB PC-2400 DDR4
    • Grafik: Radeon PRO WX 4100 4GB 4xDisplaYPort
    • 512 GB Samsung Pro 960 M.2
    • 4TB WDC WD40EZRZ-00W




Fatal error: Cannot redeclare function buildCookieInfo() (previously declared in /hp/ao/ae/lz/www/detlefhahn/common/inc/cookie_handler_4_0.inc:42) in /hp/ao/ae/lz/www/detlefhahn/common/inc/footer_6_1.inc.php on line 15
216.73.217.118 nach_neuem_kernel.php 178


E_COMPILE_ERROR
{"type":64
"message":"Cannot redeclare function buildCookieInfo() (previously declared in \/hp\/ao\/ae\/lz\/www\/detlefhahn\/common\/inc\/cookie_handler_4_0.inc:42)"
"file":"\/hp\/ao\/ae\/lz\/www\/detlefhahn\/common\/inc\/footer_6_1.inc.php"
"line":15
"scriptfile":"\/linux\/system\/nach_neuem_kernel.php"} '
' . (0 - 1) /hp/ao/ae/lz/www/detlefhahn/common/inc/startup_6_1.inc(1005): debug_string_backtrace() '
' . (1 - 1) [internal function]: fatal_error()