Debian

    First installation on a desktop

    Here are some notes in case you install debian for the first time from the [official website]

    • configure wired ethernet (avoid trouble to configure later)
    • if you need to encrypt a partition, ensure that you first have EFI partition (~500MB) and /boot (ext4, ~500MB)

    Auto security updates

    apt-get install unattended-upgrades && dpkg-reconfigure unattended-upgrades
    

    KDE

    If you are minimalist install kde-plasma-desktop, if you need more like kwin (to move a window through desktops) install kde-standard.

    source

    Releases

    Users can expect 3 years of full support for each release and 2 years of extra LTS support.

    • Debian 12 ("bookworm") — current "stable" release
    • Debian 11 ("bullseye") — current "oldstable" release EOL: ~2024-07
    • Debian 10 ("buster") — current "oldoldstable" release EOL: 2022-09-10
    • Debian 9 ("stretch") — "oldoldstable" release, under LTS support
    • Debian 8 ("jessie") — archived release, under extended LTS support
    • Debian 7 ("wheezy") — obsolete stable release
    • Debian 6.0 ("squeeze") — obsolete stable release

    source

    debian-12.4-amd64-netinst.iso

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA256
    
    64d727dd5785ae5fcfd3ae8ffbede5f40cca96f1580aaa2820e8b99dae989d94  debian-12.4.0-amd64-netinst.iso
    -----BEGIN PGP SIGNATURE-----
    
    iHUEAREIAB0WIQS6FrUxin3X0/uI3zRD+jfzTY+N4AUCZYHOWAAKCRBD+jfzTY+N
    4LleAP9+YIhm7ZWYIBaBvwBIA1j+5BQOKD4LjAnXtRAYGtwPXQD+OSsG26n7o3yc
    bXzljbF6eYeHCA2fQknxriVTF8WBXCY=
    =+paM
    -----END PGP SIGNATURE-----
    

    Upgrade distro

    # First, ensure your system is up-to-date in it's current release.
    apt-get update
    apt-get upgrade
    apt-get full-upgrade
    
    # update list.d
    
    # Clean and update package lists
    apt-get clean
    apt-get update
    
    # Perform the major release upgrade, removing packages if required
    apt-get upgrade
    apt-get full-upgrade
    

    source

    APT list

    Bullseye / Bookworm

    deb http://deb.debian.org/debian/ bullseye main contrib
    deb http://deb.debian.org/debian/ bullseye-updates main contrib
    deb http://deb.debian.org/debian bullseye-proposed-updates main contrib
    # deb http://deb.debian.org/debian/ bullseye-backports main contrib
    
    deb http://deb.debian.org/debian-security/ bullseye-security main contrib
    

    Note: you can add non-free if some non open-source packages are required.

    Buster

    deb http://deb.debian.org/debian/ buster main contrib
    deb-src http://deb.debian.org/debian/ buster main contrib
    
    deb http://deb.debian.org/debian/ buster-updates main contrib
    deb-src http://deb.debian.org/debian/ buster-updates main contrib
    
    deb http://security.debian.org/debian-security buster/updates main contrib
    deb-src http://security.debian.org/debian-security buster/updates main contrib
    

    ISO arm

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA256
    
    735401ae94a8ea5b56ebb09839f47f4419b60ad0411f489b266a21d7e736d860  buster-minimal-rock64-0.11.2-1187-arm64.img.xz
    -----BEGIN PGP SIGNATURE-----
    
    iHUEAREIAB0WIQTvklEfN1MKqSoQFZ9IVFdXiuZ0RgUCYTzbhgAKCRBIVFdXiuZ0
    RjElAQDdaoyDS7CsZzt4gVwt073efuAn81n8jW8xOPa+bSO2xgEA3HeK5aQqS93O
    1+7YB86Hlwug9anuss3MXJX1r5R9GaY=
    =PEDo
    -----END PGP SIGNATURE-----
    

    Note: default ssh user rock64 and password rock64

    source

    Change Kernel

    Steps: 1. Download/install with apt-get a kernel ((will be added in boot/ directory)) 2. Recreate new grub.cfg ((normally apt-get will do this step)) 3. Retrieve number in menuentry of grub for kernel you'd like to boot 4. Use this number to set-up as default boot kernel 5. Reboot and check kernel expected is here. 6. You can remove old kernel.

    Example:

    root@host1:~# apt-get install pve-firmware pve-kernel-2.6.32-26-pve
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following packages will be REMOVED:
      firmware-linux-free
    The following NEW packages will be installed:
      pve-firmware pve-kernel-2.6.32-26-pve
    0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded.
    Need to get 52.8 MB of archives.
    After this operation, 90.1 kB disk space will be freed.
    Do you want to continue [Y/n]? y
    Get:1 http://download.proxmox.com/debian/ wheezy/pve pve-firmware all 1.0-23 [19.7 MB]
    Get:2 http://download.proxmox.com/debian/ wheezy/pve pve-kernel-2.6.32-26-pve amd64 2.6.32-114 [33.1 MB]
    Fetched 52.8 MB in 4s (10.9 MB/s)
    (Reading database ... 24530 files and directories currently installed.)
    Removing firmware-linux-free ...
    Selecting previously unselected package pve-firmware.
    (Reading database ... 24497 files and directories currently installed.)
    Unpacking pve-firmware (from .../pve-firmware_1.0-23_all.deb) ...
    Selecting previously unselected package pve-kernel-2.6.32-26-pve.
    Unpacking pve-kernel-2.6.32-26-pve (from .../pve-kernel-2.6.32-26-pve_2.6.32-114_amd64.deb) ...
    Setting up pve-firmware (1.0-23) ...
    Setting up pve-kernel-2.6.32-26-pve (2.6.32-114) ...
    update-initramfs: Generating /boot/initrd.img-2.6.32-26-pve
    Generating grub.cfg ...
    Found linux image: /boot/vmlinuz-3.2.0-4-amd64
    Found initrd image: /boot/initrd.img-3.2.0-4-amd64
    Found linux image: /boot/vmlinuz-2.6.32-26-pve
    Found initrd image: /boot/initrd.img-2.6.32-26-pve
      No volume groups found
    done
    

    Note: here we install a kernel 2.6.32, linux don't choose him as default cause the version is older than 3.2 which is already there((You could verify this on this step, just do a reboot, and using uname, you'll see kernel 3.2)). We could do a apt-get remove of current version, but it's really dangerous cause we currently running on it. That's why we keep the current version of kernel, and changing the default kernel boot((see below)).

    grub-mkconfig -o /boot/grub/grub.cfg # allow to create config file for grub, based on kernel available in /boot/*
    

    Notice: Normally apt-get doing this step automatically.

    root@host1:~# grep menuentry /boot/grub/grub.cfg
    menuentry 'Debian GNU/Linux, with Linux 3.2.0-4-amd64' --class debian --class gnu-linux --class gnu --class os { # entry 0
    menuentry 'Debian GNU/Linux, with Linux 3.2.0-4-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os { # entry 1
    menuentry 'Debian GNU/Linux, with Linux 2.6.32-26-pve' --class debian --class gnu-linux --class gnu --class os { # entry 2
    menuentry 'Debian GNU/Linux, with Linux 2.6.32-26-pve (recovery mode)' --class debian --class gnu-linux --class gnu --class os { # entry 3
    
    root@host1:~# sed -i 's/set default="0"/set default="2"/g' /boot/grub/grub.cfg
    

    After reboot, we check kernel expected is currently using

    root@host1:~# uname -a
    Linux host1.frenchwinesociety.org 2.6.32-26-pve #1 SMP Mon Oct 14 08:22:20 CEST 2013 x86_64 GNU/Linux
    

    It's present, so we can remove old kernel

    apt-get remove linux-image-amd64 linux-image-3.2.0-4-amd64 linux-base
    

    And now we need to upgrade grub.cfg

    update-grub
    

    Notice: alias for ''grub-mkconfig -o /boot/grub/grub.cfg''

    List kernels

    apt-cache search linux-image
    

    Packaging

    Resources:

    Tutorial:

    apt install packaging-tutorial
    okular /usr/share/doc/packaging-tutorial/packaging-tutorial.pdf
    

    Requirements:

    apt install build-essential devscripts debhelper
    

    Tree structure of files

    ./debian/
    |-- changelog
    |-- compat
    |-- control
    |-- rules
    |-- source
    |-- *preinst
    |-- *postinst
    |-- *prerm
    |-- *postrm
    

    Notes:

    • those with * are optional, just good to know it can be specified
    • control contains the version, package's dependencies, maintainer contact, architecture, description
    • rules set of rules to build the package
    • compat the debhelper compatbility version

    Rules

    Minimal rule (using debhelper)

    #!/usr/bin/make -f
    #DH_VERBOSE = 1
    
    %:
      dh $@ 
    
    # you can override a rule, e.g.
    #override_dh_auto_test:
    #	echo "passed... assuming that test are done before building package"
    

    Note: see man debhelper 7

    Create changelog

    dch --create
    

    Requires: devscripts

    Build package

    Make a package :

    # debuild (old ?)
    dpkg-buildpackage -rfakeroot -b  # or dpkg-buildpackage -us -uc 
    
    

    Info on package

    dpkg --info file.deb  # or -I
    
    # extract only control informations
    dpkg -e file.deb # see DEBIAN/ directory
    
    # list files
    dpkg --contents file.deb
    
    # extract everything
    ar x file.deb
    
    # changelog
    apt-get changelog package
    

    source

    Unpack / Repack a package

    mkdir tmp
    dpkg-deb -R original.deb tmp
    # edit DEBIAN/postinst
    dpkg-deb -b tmp fixed.deb
    

    source