[HowTo] Install Debian unstable KDE by mmdebstrap from a live testing

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Post Reply
Message
Author
jebez
Posts: 108
Joined: 2024-07-01 15:21
Been thanked: 1 time

[HowTo] Install Debian unstable KDE by mmdebstrap from a live testing

#1 Post by jebez »

Using efi/boot/bootx64.efi (auto detected by the BIOS EFI) by ukify:

Using nvidia-driver of Nvidia (in https://developer.download.nvidia.com/c ... 12/x86_64/).

Warning! No Wayland (at this time, nvidia-driver 565.57.01-1) viewtopic.php?p=814239#p814239.

PC: 64-bit
Motherboard: Gigabyte B450M DS3H
CPU: 12 × AMD Ryzen 5 2600 Six-Core Processor
GPU: NVIDIA GeForce GTX 1660 SUPER/PCIe/SSE2
BIOS EFI: supports FAT & NTFS

Download a live testing from https://cdimage.debian.org/cdimage/week ... so-hybrid/.
Burn it to a DVD-RW
or
mount it then copy paste all its contents to a NTFS partition (since the BIOS supports NTFS) on e.g. a USB flash drive
or

Code: Select all

cp .../debian-live-testing-amd64-*.iso /dev/sdb
Download https://developer.download.nvidia.com/c ... -1_all.deb (here to /dev/sdb1).
Boot the live.

Code: Select all

sudo sed -i 1s/x// /etc/passwd
su -

Code: Select all

fdisk -l
ls -l /dev/disk/by-id
fdisk -l nvme0n1 is the drive of the future OS. Make sure its disklabel type is GPT instead of the old MBR.
ls -l /dev/disk/by-id the value of nvme0n1 to set to root=/dev/disk/by-id/...-part1 & resume=/dev/disk/by-id/...-part2.

Code: Select all

fdisk /dev/nvme0n1
apt update
apt upgrade
apt install f2fs-tools mmdebstrap systemd-ukify --autoremove
apt clean
mkfs.f2fs /dev/nvme0n1p1
mkswap /dev/nvme0n1p2
mkfs.fat -F 16 /dev/nvme0n1p3
echo a>/etc/hostname
mount /dev/nvme0n1p1 /mnt
mmdebstrap --components=main,contrib,non-free,non-free-firmware --include=linux-image-amd64,network-manager,systemd-timesyncd unstable /mnt
mkdir /mnt/efi
echo -e /dev/disk/by-id/nvme-WDS250G3X0C-00SJG0_185250422455-part3 /efi'\'n/dev/disk/by-id/nvme-WDS250G3X0C-00SJG0_185250422455-part2 none swap>/mnt/etc/fstab
rm /mnt/var/log/wtmp /mnt/var/log/btmp /mnt/var/log/lastlog
sed -i 1s/x// /mnt/etc/passwd
echo unset HISTFILE>>/mnt/etc/bash.bashrc
echo deb-src http://deb.debian.org/debian unstable main contrib non-free non-free-firmware>>/mnt/etc/apt/sources.list
echo -e '#!'/bin/sh'\'nukify build --linux=/vmlinuz --initrd=/initrd.img --cmdline=\'root=/dev/disk/by-id/nvme-WDS250G3X0C-00SJG0_185250422455-part1 resume=/dev/disk/by-id/nvme-WDS250G3X0C-00SJG0_185250422455-part2 rw nvidia-drm.modeset=1\' -o /efi/efi/boot/bootx64.efi>/mnt/etc/kernel/postinst.d/zz-ukify
chmod +x /mnt/etc/kernel/postinst.d/zz-ukify
mkdir /mnt/etc/initramfs
mkdir /mnt/etc/initramfs/post-update.d
ln /mnt/etc/kernel/postinst.d/zz-ukify /mnt/etc/initramfs/post-update.d/zz-ukify
mount /dev/nvme0n1p3 /mnt/efi
mkdir /mnt/efi/efi
mkdir /mnt/efi/efi/boot
ukify build --linux=/mnt/vmlinuz --initrd=/mnt/initrd.img --cmdline='root=/dev/disk/by-id/nvme-WDS250G3X0C-00SJG0_185250422455-part1 resume=/dev/disk/by-id/nvme-WDS250G3X0C-00SJG0_185250422455-part2 rw nvidia-drm.modeset=1' -o /mnt/efi/efi/boot/bootx64.efi
reboot

Code: Select all

Command (m for help): n
Partition number (1-128, default 1):
First sector (2048-488397134, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-488397134, default 488396799): 471357774

Created a new partition 1 of type 'Linux filesystem' and of size 224.8 GiB.

Command (m for help): n
Partition number (2-128, default 2):
First sector (471357775-488397134, default 471359488): 471357775
Last sector, +/-sectors or +/-size{K,M,G,T,P} (471357775-488397134, default 488396799): 488134990

Created a new partition 2 of type 'Linux filesystem' and of size 8 GiB.

Command (m for help): n
Partition number (3-128, default 3):
First sector (488134991-488397134, default 488136704): 488134991
Last sector, +/-sectors or +/-size{K,M,G,T,P} (488134991-488397134, default 488396799): 488397134

Created a new partition 3 of type 'Linux filesystem' and of size 128 MiB.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
n to create a new partition, w to write. 3 partitions: the 1st for the OS, the 2nd for the swap, the 3rd for the ESP (EFI system partition).
Options:
echo a>/etc/hostname to change the hostname of the future OS from debian to e.g. a.
rm /mnt/var/log/wtmp /mnt/var/log/btmp /mnt/var/log/lastlog to remove the log in/log out & boot/shutdown histories.
sed -i 1s/x// /mnt/etc/passwd to remove the password check of root removing x: root::.
echo unset HISTFILE>>/mnt/etc/bash.bashrc to not save the bash command(s) history to .bash_history.
echo deb-src http://deb.debian.org/debian unstable main contrib non-free non-free-firmware>>/mnt/etc/apt/sources.list to get source packages.

Log in as

Code: Select all

root

Code: Select all

adduser a
sed -i '$'s/x// /etc/passwd
exit
Option: sed -i '$'s/x// /etc/passwd to remove the password check of a removing x: a::.

Log in as

Code: Select all

a

Code: Select all

su -

Code: Select all

apt update
mount /dev/sdb1 /mnt
apt install ca-certificates /mnt/cuda-keyring_1.1-1_all.deb --autoremove
apt clean
apt update
apt install f2fs-tools systemd-ukify linux-headers-amd64 nvidia-open kde-full *nouveau*- --autoremove
apt clean
reboot
Patch: viewtopic.php?p=813888#p813888.

Welcome to your new Debian unstable KDE!


Warning! Do not unmount /efi (to update it if).

Set KDE Plasma:
kde-plasma-desktop or kde-standard instead of kde-full.

Scripts:
Obviously possible to make convenient scripts, instead of writing everything in the CLI.

Feature request: F2FS support for the BIOS:
viewtopic.php?t=160930.

GUI instead of CLI:
Possible e.g. KDE Partition Manager instead of fdisk, mfks.f2fs, mkswap, mkfs.fat.

Debian instead of Debian live:
Obviously possible to install from Debian.

Update of Linux:
Synaptic (Installed (local or obsolete)) or apt: possible to remove the old Linux.

Nvidia driver:
I had bad experiences using nvidia-driver 535.183.01-1 (545.23.06-3 at this time) of Debian (https://packages.debian.org/search?keyw ... ection=all): e.g. Black Mesa lags a lot, unplayable (move the look quickly to avoid lag...), Serious Sam Fusion 2017 (beta) & Counter-Strike 2 have screen tearing despite VSync on.

viewtopic.php?t=161410.

Debian stable:
Unfortunately systemd-ukify isn't available in stable (at this time) https://packages.debian.org/search?keyw ... ection=all...

Debian testing:
Replace unstable by testing in mmdebstrap ... & echo deb-src ....

Beware of testing viewtopic.php?t=157575.

Inspiration:
https://www.debian.org/releases/testing ... 03.en.html
https://gist.github.com/varqox/42e213b6b2dde2b636ef
https://wiki.debian.org/EFIStub
https://docs.nvidia.com/datacenter/tesl ... tml#debian.

debootstrap:
viewtopic.php?t=160578.
Last edited by jebez on 2025-01-11 21:45, edited 167 times in total.
Debian unstable KDE Wayland NVIDIA-Linux-x86_64-565.77.run ukify

jebez
Posts: 108
Joined: 2024-07-01 15:21
Been thanked: 1 time

Re: [HowTo] Installation of Debian testing KDE by debootstrap from a live testing

#2 Post by jebez »

Using a boot entry by efibootmgr:

Using nvidia-driver of Nvidia (in https://developer.download.nvidia.com/c ... 12/x86_64/).

Warning! No Wayland (at this time, nvidia-driver 565.57.01-1) viewtopic.php?p=814239#p814239.

PC: 64-bit
Motherboard: Gigabyte B450M DS3H
CPU: 12 × AMD Ryzen 5 2600 Six-Core Processor
GPU: NVIDIA GeForce GTX 1660 SUPER/PCIe/SSE2
BIOS EFI: supports FAT & NTFS

Download a live testing from https://cdimage.debian.org/cdimage/week ... so-hybrid/.
Burn it to a DVD-RW
or
mount it then copy paste all its contents to a NTFS partition (since the BIOS supports NTFS) on e.g. a USB flash drive
or

Code: Select all

cp .../debian-live-testing-amd64-*.iso /dev/sdb
Download https://developer.download.nvidia.com/c ... -1_all.deb (here to /dev/sdb1).
Boot the live.

Code: Select all

sudo sed -i 1s/x// /etc/passwd
su -

Code: Select all

fdisk -l
ls -l /dev/disk/by-id
fdisk -l nvme0n1 is the drive of the future OS. Make sure its disklabel type is GPT instead of the old MBR.
ls -l /dev/disk/by-id the value of nvme0n1 to set to root=/dev/disk/by-id/...-part1 & resume=/dev/disk/by-id/...-part2.

Code: Select all

fdisk /dev/nvme0n1
apt update
apt upgrade
apt install f2fs-tools mmdebstrap efibootmgr --autoremove
apt clean
mkfs.f2fs /dev/nvme0n1p1
mkswap /dev/nvme0n1p2
mkfs.fat -F 16 /dev/nvme0n1p3
echo a>/etc/hostname
mount /dev/nvme0n1p1 /mnt
mmdebstrap --setup-hook='mount /dev/nvme0n1p3 /mnt/boot' --components=main,contrib,non-free,non-free-firmware --include=linux-image-amd64,network-manager,systemd-timesyncd unstable /mnt
echo -e /dev/disk/by-id/nvme-WDS250G3X0C-00SJG0_185250422455-part3 /efi'\'n/dev/disk/by-id/nvme-WDS250G3X0C-00SJG0_185250422455-part2 none swap>/mnt/etc/fstab
rm /mnt/var/log/wtmp /mnt/var/log/btmp /mnt/var/log/lastlog
sed -i 1s/x// /mnt/etc/passwd
echo unset HISTFILE>>/mnt/etc/bash.bashrc
echo deb-src http://deb.debian.org/debian unstable main contrib non-free non-free-firmware>>/mnt/etc/apt/sources.list
echo -e '#!'/bin/sh'\'nefibootmgr -c -d /dev/nvme0n1 -p 3 -l '`readlink /vmlinuz|xargs basename`' -u \'root=/dev/disk/by-id/nvme-WDS250G3X0C-00SJG0_185250422455-part1 resume=/dev/disk/by-id/nvme-WDS250G3X0C-00SJG0_185250422455-part2 rw nvidia-drm.modeset=1\'>/mnt/etc/kernel/postinst.d/zz-efibootmgr
chmod +x /mnt/etc/kernel/postinst.d/zz-efibootmgr
efibootmgr -c -d /dev/nvme0n1 -p 3 -l `readlink /mnt/vmlinuz|xargs basename` -u 'root=/dev/disk/by-id/nvme-WDS250G3X0C-00SJG0_185250422455-part1 resume=/dev/disk/by-id/nvme-WDS250G3X0C-00SJG0_185250422455-part2 rw nvidia-drm.modeset=1'
reboot

Code: Select all

Command (m for help): n
Partition number (1-128, default 1):
First sector (2048-488397134, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-488397134, default 488396799): 471357774

Created a new partition 1 of type 'Linux filesystem' and of size 224.8 GiB.

Command (m for help): n
Partition number (2-128, default 2):
First sector (471357775-488397134, default 471359488): 471357775
Last sector, +/-sectors or +/-size{K,M,G,T,P} (471357775-488397134, default 488396799): 488134990

Created a new partition 2 of type 'Linux filesystem' and of size 8 GiB.

Command (m for help): n
Partition number (3-128, default 3):
First sector (488134991-488397134, default 488136704): 488134991
Last sector, +/-sectors or +/-size{K,M,G,T,P} (488134991-488397134, default 488396799): 488397134

Created a new partition 3 of type 'Linux filesystem' and of size 128 MiB.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
n to create a new partition, w to write. 3 partitions: the 1st for the OS, the 2nd for the swap, the 3rd for the ESP (EFI system partition).
Options:
echo a>/etc/hostname to change the hostname of the future OS from debian to e.g. a.
rm /mnt/var/log/wtmp /mnt/var/log/btmp /mnt/var/log/lastlog to remove the log in/log out & boot/shutdown histories.
sed -i 1s/x// /mnt/etc/passwd to remove the password check of root removing x: root::.
echo unset HISTFILE>>/mnt/etc/bash.bashrc to not save the bash command(s) history to .bash_history.
echo deb-src http://deb.debian.org/debian unstable main contrib non-free non-free-firmware>>/mnt/etc/apt/sources.list to get source packages.

Log in as

Code: Select all

root

Code: Select all

adduser a
sed -i '$'s/x// /etc/passwd
exit
Option: sed -i '$'s/x// /etc/passwd to remove the password check of a removing x: a::.

Log in as

Code: Select all

a

Code: Select all

su -

Code: Select all

apt update
mount /dev/sdb1 /mnt
apt install ca-certificates /mnt/cuda-keyring_1.1-1_all.deb --autoremove
apt clean
apt update
apt install f2fs-tools efibootmgr linux-headers-amd64 nvidia-open kde-full *nouveau*- --autoremove
apt clean
reboot
Patch: viewtopic.php?p=813888#p813888.

Welcome to your new Debian unstable KDE!


Warning!
Do not unmount /boot (to update it if).
If the ESP is unplugged from the PC then the PC booted, the boot entry is deleted.

Set KDE Plasma:
kde-plasma-desktop or kde-standard instead of kde-full.

Scripts:
Obviously possible to make convenient scripts, instead of writing everything in the CLI.

Feature request: F2FS support for the BIOS:
viewtopic.php?t=160930.

GUI instead of CLI:
Possible e.g. KDE Partition Manager instead of fdisk, mfks.f2fs, mkswap, mkfs.fat.

Debian instead of Debian live:
Obviously possible to install from Debian.

Update of Linux:
Synaptic (Installed (local or obsolete)) or apt: possible to remove the old Linux.

Nvidia driver:
I had bad experiences using nvidia-driver 535.183.01-1 (545.23.06-3 at this time) of Debian (https://packages.debian.org/search?keyw ... ection=all): e.g. Black Mesa lags a lot, unplayable (move the look quickly to avoid lag...), Serious Sam Fusion 2017 (beta) & Counter-Strike 2 have screen tearing despite VSync on.

viewtopic.php?t=161410.

Debian stable & testing:
Replace unstable by stable or testing in mmdebstrap ... & echo deb-src ....

Beware of testing viewtopic.php?t=157575.

Inspiration:
https://www.debian.org/releases/testing ... 03.en.html
https://gist.github.com/varqox/42e213b6b2dde2b636ef
https://wiki.debian.org/EFIStub
https://docs.nvidia.com/datacenter/tesl ... tml#debian.

debootstrap:
viewtopic.php?t=160578.
Last edited by jebez on 2025-01-11 21:46, edited 54 times in total.
Debian unstable KDE Wayland NVIDIA-Linux-x86_64-565.77.run ukify

jebez
Posts: 108
Joined: 2024-07-01 15:21
Been thanked: 1 time

Re: [HowTo] Installation of Debian testing KDE by debootstrap from a live testing

#3 Post by jebez »

Using efi/boot/bootx64.efi (auto detected by the BIOS EFI) by ukify:

Using NVIDIA-Linux-x86_64-*.run (if the version of NVIDIA-Linux-x86_64-*.run > nvidia-driver of Nvidia, otherwise better to use the latter).

Done on 6/1/2025.

PC: 64-bit
Motherboard: Gigabyte B450M DS3H
CPU: 12 × AMD Ryzen 5 2600 Six-Core Processor
GPU: NVIDIA GeForce GTX 1660 SUPER/PCIe/SSE2
BIOS EFI: supports FAT & NTFS

Download a live testing from https://cdimage.debian.org/cdimage/week ... so-hybrid/.
Burn it to a DVD-RW
or
mount it then copy paste all its contents to a NTFS partition (since the BIOS supports NTFS) on e.g. a USB flash drive
or

Code: Select all

cp .../debian-live-testing-amd64-*.iso /dev/sdb
Download the last Linux Nvidia driver (NVIDIA-Linux-x86_64-565.77.run at this time) from https://www.nvidia.com/en-us/drivers/ on e.g. a USB flash drive (here /dev/sdb1).
Boot the live.

Code: Select all

sudo sed -i 1s/x// /etc/passwd
su -

Code: Select all

fdisk -l
ls -l /dev/disk/by-id
fdisk -l nvme0n1 is the drive of the future OS. Make sure its disklabel type is GPT instead of the old MBR.
ls -l /dev/disk/by-id the value of nvme0n1 to set to root=/dev/disk/by-id/...-part1 & resume=/dev/disk/by-id/...-part2.

Code: Select all

fdisk /dev/nvme0n1
apt update
apt upgrade
apt install f2fs-tools mmdebstrap systemd-ukify --autoremove
apt clean
mkfs.f2fs /dev/nvme0n1p1
mkswap /dev/nvme0n1p2
mkfs.fat -F 16 /dev/nvme0n1p3
echo a>/etc/hostname
mount /dev/nvme0n1p1 /mnt
mmdebstrap --components=main,contrib,non-free,non-free-firmware --include=linux-image-amd64,network-manager,systemd-timesyncd unstable /mnt
mkdir /mnt/efi
echo -e /dev/disk/by-id/nvme-WDS250G3X0C-00SJG0_185250422455-part3 /efi'\'n/dev/disk/by-id/nvme-WDS250G3X0C-00SJG0_185250422455-part2 none swap>/mnt/etc/fstab
rm /mnt/var/log/wtmp /mnt/var/log/btmp /mnt/var/log/lastlog
sed -i 1s/x// /mnt/etc/passwd
echo unset HISTFILE>>/mnt/etc/bash.bashrc
echo deb-src http://deb.debian.org/debian unstable main contrib non-free non-free-firmware>>/mnt/etc/apt/sources.list
echo -e '#!'/bin/sh'\'nukify build --linux=/vmlinuz --initrd=/initrd.img --cmdline=\'root=/dev/disk/by-id/nvme-WDS250G3X0C-00SJG0_185250422455-part1 resume=/dev/disk/by-id/nvme-WDS250G3X0C-00SJG0_185250422455-part2 rw nvidia-drm.modeset=1\' -o /efi/efi/boot/bootx64.efi>/mnt/etc/kernel/postinst.d/zz-ukify
chmod +x /mnt/etc/kernel/postinst.d/zz-ukify
mkdir /mnt/etc/initramfs
mkdir /mnt/etc/initramfs/post-update.d
ln /mnt/etc/kernel/postinst.d/zz-ukify /mnt/etc/initramfs/post-update.d/zz-ukify
mount /dev/nvme0n1p3 /mnt/efi
mkdir /mnt/efi/efi
mkdir /mnt/efi/efi/boot
ukify build --linux=/mnt/vmlinuz --initrd=/mnt/initrd.img --cmdline='root=/dev/disk/by-id/nvme-WDS250G3X0C-00SJG0_185250422455-part1 resume=/dev/disk/by-id/nvme-WDS250G3X0C-00SJG0_185250422455-part2 rw nvidia-drm.modeset=1' -o /mnt/efi/efi/boot/bootx64.efi
reboot

Code: Select all

Command (m for help): n
Partition number (1-128, default 1):
First sector (2048-488397134, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-488397134, default 488396799): 471357774

Created a new partition 1 of type 'Linux filesystem' and of size 224.8 GiB.

Command (m for help): n
Partition number (2-128, default 2):
First sector (471357775-488397134, default 471359488): 471357775
Last sector, +/-sectors or +/-size{K,M,G,T,P} (471357775-488397134, default 488396799): 488134990

Created a new partition 2 of type 'Linux filesystem' and of size 8 GiB.

Command (m for help): n
Partition number (3-128, default 3):
First sector (488134991-488397134, default 488136704): 488134991
Last sector, +/-sectors or +/-size{K,M,G,T,P} (488134991-488397134, default 488396799): 488397134

Created a new partition 3 of type 'Linux filesystem' and of size 128 MiB.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
n to create a new partition, w to write. 3 partitions: the 1st for the OS, the 2nd for the swap, the 3rd for the ESP (EFI system partition).
Options:
echo a>/etc/hostname to change the hostname of the future OS from debian to e.g. a.
rm /mnt/var/log/wtmp /mnt/var/log/btmp /mnt/var/log/lastlog to remove the log in/log out & boot/shutdown histories.
sed -i 1s/x// /mnt/etc/passwd to remove the password check of root removing x: root::.
echo unset HISTFILE>>/mnt/etc/bash.bashrc to not save the bash command(s) history to .bash_history.
echo deb-src http://deb.debian.org/debian unstable main contrib non-free non-free-firmware>>/mnt/etc/apt/sources.list to get source packages.

Log in as

Code: Select all

root

Code: Select all

adduser a
sed -i '$'s/x// /etc/passwd
exit
Option: sed -i '$'s/x// /etc/passwd to remove the password check of a removing x: a::.

Log in as

Code: Select all

a

Code: Select all

su -

Code: Select all

apt update
apt install systemd-ukify gcc make --autoremove
apt clean
mount /dev/sdb1 /mnt
/mnt/NVIDIA-Linux-x86_64-*.run
reboot
According to the messages of NVIDIA-Linux-x86_64-565.77.run if gcc make not installed.

Log in as

Code: Select all

a

Code: Select all

su -

Code: Select all

dpkg --add-architecture i386
apt update
apt install f2fs-tools linux-headers-amd64 kde-full steam-installer dkms pkg-config libglvnd-dev *nouveau*- *nvidia*- --autoremove
apt clean
mount /dev/sdb1 /mnt
/mnt/NVIDIA-Linux-x86_64-*.run
reboot
According to the messages of NVIDIA-Linux-x86_64-565.77.run if linux-headers-amd64 kde-full steam-installer pkg-config libglvnd-dev not installed (steam-installer for 32-bit compatibility).

Welcome to your new Debian unstable KDE!


Warning! Do not unmount /efi (to update it if).

Set KDE Plasma:
kde-plasma-desktop or kde-standard instead of kde-full.

NVIDIA-Linux-x86_64-565.77.run:
Just keep pressing Enter, unless at the end "Would you like to run the nvidia-xconfig utility..." where you can select Yes.

Scripts:
Obviously possible to make convenient scripts, instead of writing everything in the CLI.

Feature request: F2FS support for the BIOS:
viewtopic.php?t=160930.

GUI instead of CLI:
Possible e.g. KDE Partition Manager instead of fdisk, mfks.f2fs, mkswap, mkfs.fat.

Debian instead of Debian live:
Obviously possible to install from Debian.

Update of Linux:
Synaptic (Installed (local or obsolete)) or apt: possible to remove the old Linux.

Update of the Nvidia driver:
The new NVIDIA-Linux-x86_64-*.run can say "Installing the NVIDIA driver while X is running is not recommended":

Code: Select all

su -

Code: Select all

init 3
Log in as

Code: Select all

a

Code: Select all

su -

Code: Select all

killall kwin_wayland
mount /dev/sdb1 /mnt
/mnt/NVIDIA-Linux-x86_64-*.run
reboot
Bugs found:
Sleep: black screen & pointer stuck after resuming.
Hibernate: desktop messed up after resuming so:

Code: Select all

su -

Code: Select all

systemctl --user restart plasma-plasmashell
Nvidia driver:
I had bad experiences using nvidia-driver 535.183.01-1 (545.23.06-3 at this time) of Debian (https://packages.debian.org/search?keyw ... ection=all): e.g. Black Mesa lags a lot, unplayable (move the look quickly to avoid lag...), Serious Sam Fusion 2017 (beta) & Counter-Strike 2 have screen tearing despite VSync on.

viewtopic.php?t=161410.

Debian stable:
Unfortunately systemd-ukify isn't available in stable (at this time) https://packages.debian.org/search?keyw ... ection=all...

Debian testing:
Replace unstable by testing in mmdebstrap ... & echo deb-src ....

Beware of testing viewtopic.php?t=157575.

Inspiration:
https://www.debian.org/releases/testing ... 03.en.html
https://gist.github.com/varqox/42e213b6b2dde2b636ef
https://wiki.debian.org/EFIStub.

debootstrap:
viewtopic.php?t=160578.
Last edited by jebez on 2025-01-11 21:46, edited 3 times in total.
Debian unstable KDE Wayland NVIDIA-Linux-x86_64-565.77.run ukify

jebez
Posts: 108
Joined: 2024-07-01 15:21
Been thanked: 1 time

Re: [HowTo] Install Debian unstable KDE by mmdebstrap from a live testing

#4 Post by jebez »

Using a boot entry by efibootmgr:

Using NVIDIA-Linux-x86_64-*.run (if the version of NVIDIA-Linux-x86_64-*.run > nvidia-driver of Nvidia, otherwise better to use the latter).

PC: 64-bit
Motherboard: Gigabyte B450M DS3H
CPU: 12 × AMD Ryzen 5 2600 Six-Core Processor
GPU: NVIDIA GeForce GTX 1660 SUPER/PCIe/SSE2
BIOS EFI: supports FAT & NTFS

Download a live testing from https://cdimage.debian.org/cdimage/week ... so-hybrid/.
Burn it to a DVD-RW
or
mount it then copy paste all its contents to a NTFS partition (since the BIOS supports NTFS) on e.g. a USB flash drive
or

Code: Select all

cp .../debian-live-testing-amd64-*.iso /dev/sdb
Download the last Linux Nvidia driver (NVIDIA-Linux-x86_64-565.77.run at this time) from https://www.nvidia.com/en-us/drivers/ on e.g. a USB flash drive (here /dev/sdb1).
Boot the live.

Code: Select all

sudo sed -i 1s/x// /etc/passwd
su -

Code: Select all

fdisk -l
ls -l /dev/disk/by-id
fdisk -l nvme0n1 is the drive of the future OS. Make sure its disklabel type is GPT instead of the old MBR.
ls -l /dev/disk/by-id the value of nvme0n1 to set to root=/dev/disk/by-id/...-part1 & resume=/dev/disk/by-id/...-part2.

Code: Select all

fdisk /dev/nvme0n1
apt update
apt upgrade
apt install f2fs-tools mmdebstrap efibootmgr --autoremove
apt clean
mkfs.f2fs /dev/nvme0n1p1
mkswap /dev/nvme0n1p2
mkfs.fat -F 16 /dev/nvme0n1p3
echo a>/etc/hostname
mount /dev/nvme0n1p1 /mnt
mmdebstrap --setup-hook='mount /dev/nvme0n1p3 /mnt/boot' --components=main,contrib,non-free,non-free-firmware --include=linux-image-amd64,network-manager,systemd-timesyncd unstable /mnt
echo -e /dev/disk/by-id/nvme-WDS250G3X0C-00SJG0_185250422455-part3 /efi'\'n/dev/disk/by-id/nvme-WDS250G3X0C-00SJG0_185250422455-part2 none swap>/mnt/etc/fstab
rm /mnt/var/log/wtmp /mnt/var/log/btmp /mnt/var/log/lastlog
sed -i 1s/x// /mnt/etc/passwd
echo unset HISTFILE>>/mnt/etc/bash.bashrc
echo deb-src http://deb.debian.org/debian unstable main contrib non-free non-free-firmware>>/mnt/etc/apt/sources.list
echo -e '#!'/bin/sh'\'nefibootmgr -c -d /dev/nvme0n1 -p 3 -l '`readlink /vmlinuz|xargs basename`' -u \'root=/dev/disk/by-id/nvme-WDS250G3X0C-00SJG0_185250422455-part1 resume=/dev/disk/by-id/nvme-WDS250G3X0C-00SJG0_185250422455-part2 rw nvidia-drm.modeset=1\'>/mnt/etc/kernel/postinst.d/zz-efibootmgr
chmod +x /mnt/etc/kernel/postinst.d/zz-efibootmgr
efibootmgr -c -d /dev/nvme0n1 -p 3 -l `readlink /mnt/vmlinuz|xargs basename` -u 'root=/dev/disk/by-id/nvme-WDS250G3X0C-00SJG0_185250422455-part1 resume=/dev/disk/by-id/nvme-WDS250G3X0C-00SJG0_185250422455-part2 rw nvidia-drm.modeset=1'
reboot

Code: Select all

Command (m for help): n
Partition number (1-128, default 1):
First sector (2048-488397134, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-488397134, default 488396799): 471357774

Created a new partition 1 of type 'Linux filesystem' and of size 224.8 GiB.

Command (m for help): n
Partition number (2-128, default 2):
First sector (471357775-488397134, default 471359488): 471357775
Last sector, +/-sectors or +/-size{K,M,G,T,P} (471357775-488397134, default 488396799): 488134990

Created a new partition 2 of type 'Linux filesystem' and of size 8 GiB.

Command (m for help): n
Partition number (3-128, default 3):
First sector (488134991-488397134, default 488136704): 488134991
Last sector, +/-sectors or +/-size{K,M,G,T,P} (488134991-488397134, default 488396799): 488397134

Created a new partition 3 of type 'Linux filesystem' and of size 128 MiB.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
n to create a new partition, w to write. 3 partitions: the 1st for the OS, the 2nd for the swap, the 3rd for the ESP (EFI system partition).
Options:
echo a>/etc/hostname to change the hostname of the future OS from debian to e.g. a.
rm /mnt/var/log/wtmp /mnt/var/log/btmp /mnt/var/log/lastlog to remove the log in/log out & boot/shutdown histories.
sed -i 1s/x// /mnt/etc/passwd to remove the password check of root removing x: root::.
echo unset HISTFILE>>/mnt/etc/bash.bashrc to not save the bash command(s) history to .bash_history.
echo deb-src http://deb.debian.org/debian unstable main contrib non-free non-free-firmware>>/mnt/etc/apt/sources.list to get source packages.

Log in as

Code: Select all

root

Code: Select all

adduser a
sed -i '$'s/x// /etc/passwd
exit
Option: sed -i '$'s/x// /etc/passwd to remove the password check of a removing x: a::.

Log in as

Code: Select all

a

Code: Select all

su -

Code: Select all

apt update
apt install systemd-ukify gcc make --autoremove
apt clean
mount /dev/sdb1 /mnt
/mnt/NVIDIA-Linux-x86_64-*.run
reboot
According to the messages of NVIDIA-Linux-x86_64-565.77.run if gcc make not installed.

Log in as

Code: Select all

a

Code: Select all

su -

Code: Select all

dpkg --add-architecture i386
apt update
apt install f2fs-tools linux-headers-amd64 kde-full steam-installer dkms pkg-config libglvnd-dev *nouveau*- *nvidia*- --autoremove
apt clean
mount /dev/sdb1 /mnt
/mnt/NVIDIA-Linux-x86_64-*.run
reboot
According to the messages of NVIDIA-Linux-x86_64-565.77.run if linux-headers-amd64 kde-full steam-installer pkg-config libglvnd-dev not installed (steam-installer for 32-bit compatibility).

Welcome to your new Debian unstable KDE!


Warning!
Do not unmount /boot (to update it if).
If the ESP is unplugged from the PC then the PC booted, the boot entry is deleted.

Set KDE Plasma:
kde-plasma-desktop or kde-standard instead of kde-full.

NVIDIA-Linux-x86_64-565.77.run:
Just keep pressing Enter, unless at the end "Would you like to run the nvidia-xconfig utility..." where you can select Yes.

Scripts:
Obviously possible to make convenient scripts, instead of writing everything in the CLI.

Feature request: F2FS support for the BIOS:
viewtopic.php?t=160930.

GUI instead of CLI:
Possible e.g. KDE Partition Manager instead of fdisk, mfks.f2fs, mkswap, mkfs.fat.

Debian instead of Debian live:
Obviously possible to install from Debian.

Update of Linux:
Synaptic (Installed (local or obsolete)) or apt: possible to remove the old Linux.

Update of the Nvidia driver:
The new NVIDIA-Linux-x86_64-*.run can say "Installing the NVIDIA driver while X is running is not recommended":

Code: Select all

su -

Code: Select all

init 3
Log in as

Code: Select all

a

Code: Select all

su -

Code: Select all

killall kwin_wayland
mount /dev/sdb1 /mnt
/mnt/NVIDIA-Linux-x86_64-*.run
reboot
Bugs found:
Sleep: black screen & pointer stuck after resuming.
Hibernate: desktop messed up after resuming so:

Code: Select all

su -

Code: Select all

systemctl --user restart plasma-plasmashell
Nvidia driver:
I had bad experiences using nvidia-driver 535.183.01-1 (545.23.06-3 at this time) of Debian (https://packages.debian.org/search?keyw ... ection=all): e.g. Black Mesa lags a lot, unplayable (move the look quickly to avoid lag...), Serious Sam Fusion 2017 (beta) & Counter-Strike 2 have screen tearing despite VSync on.

viewtopic.php?t=161410.

Debian stable & testing:
Replace unstable by stable or testing in mmdebstrap ... & echo deb-src ....

Beware of testing viewtopic.php?t=157575.

Inspiration:
https://www.debian.org/releases/testing ... 03.en.html
https://gist.github.com/varqox/42e213b6b2dde2b636ef
https://wiki.debian.org/EFIStub.

debootstrap:
viewtopic.php?t=160578.
Debian unstable KDE Wayland NVIDIA-Linux-x86_64-565.77.run ukify

Post Reply