Debian notes and tips This note was created on 2023-03-20 This note was last edited on 2024-04-02 === Make yourself administrator === Add user to "sudo" group: $ su -l # adduser *YOURUSER* sudo # exit === Change language === # dpkg-reconfigure locales === Upgrade to next major version === 1. Switch to console tty via Ctrl+Alt+F3 (the upgrade should be done on a text console, because your desktop environment could freeze during post-install/service restarts, leaving the system in a broken state). 2. Check held back packages and unhold, if needed: # apt-mark showhold # apt-mark unhold *pkg* 3. Install updates for current release: # apt update # apt upgrade # apt full-upgrade # apt --purge autoremove 4. Change Debian release name in sources.list, for example to migrate from Bullseye to Bookworm: ~~~ --- deb https://deb.debian.org/debian/ bullseye main contrib non-free --- deb https://security.debian.org/debian-security bullseye-security main contrib non-free --- deb https://deb.debian.org/debian/ bullseye-updates main contrib non-free +++ deb https://deb.debian.org/debian/ bookworm stable main contrib non-free non-free-firmware +++ deb https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware +++ deb https://deb.debian.org/debian/ bookworm-updates main contrib non-free non-free-firmware ~~~ Alternatively, you can change all accurencies of "bullseye" to "bookworm" using sed: # sed -i 's/buster/bullseye/g' /etc/apt/sources.list 5. Clean and update package lists: # apt clean # apt update 6. Perform the major release upgrade, removing packages if required: # apt upgrade # apt full-upgrade # apt autoremove 7. Reboot your system: # systemctl reboot 8. Now check the output of "uname -a" and "lsb_release -a" to see info about the upgraded system. === Install non-free Nvidia driver === 1. Make sure, that "non-free" and "non-free-firmware" are included in your "/etc/apt/sources.list". 2. Install driver and control panel: # apt install nvidia-driver nvidia-settings === Install / Reinstall DE === # tasksel === Update GRUB config === If you want to add Windows entry to yout GRUB, first you'll need to install and enable OS Prober: 1. Install "os-prober": # apt install os-prober 2. To enable OS Prober: add/uncomment/change the following line in "/etc/default/grub" configuration file: ~~~ GRUB_DISABLE_OS_PROBER=false ~~~ 3. Update GRUB config: # update-grub2 === Restore GRUB using a Debian CD/USB === 1. Boot from your Debian CD/USB. 2. On UEFI Installer Menu choose "Advanced Options" and then "(Graphical) Rescue Mode". 3. Choose your language, location, keyboard, choose network. Or skip them using "Go back" button. 4. Select your root partition. For example, it could be "/dev/sda4" or "/dev/nvme0n1p3" 5. If you have a separate /boot and /boot/efi, mount them as well. 6. On this step you can choose "Execute a shell", to make sure that everything is mounted correctly. 7. Choose "Reinstall GRUB boot loader". 8. Choose the device for bootloader installation. It should correspond to your EFI System Partition (ESP), which is typically mounted at "/boot/efi". For example, "/dev/sda1". 9. After GRUB was successfully reinstalled, choose "Reboot the system". 10. Done.