Unpopular method of installing Debian GNU

The article is intended for Linux users who have problems installing the Debian GNU/Linux distribution on fresh hardware. From experienced Linux users, I would like to hear constructive criticism and recommendations for improving this installation method. Let’s help Linuxers together not to hang their noses in difficult situations and discover the wonderful world of the console and possibilities.

background

On the Internet, the distribution installation method presented in this article is rarely found. To be honest, I myself have always installed the netinstall version before and did not take a steam bath. But buying a laptop with fresh hardware changed everything. I recently purchased a Xiaomi RedmiBook Pro 15″ 2022 Ryzen Edition (AMD R7-6800H, Radeon 680M). The main problem is that the laptop went on sale in the spring of 2022 and is stuffed with the latest generations of hardware. People who bought it immediately after the release faced with a huge number of bugs in the BIOS firmware and the lack of drivers. separate branchdedicated to this model. Problems with crooked drivers still exist. The first weeks I used the official activated Windows 11, and even there (not surprising?) the Wi-Fi module constantly fell off, Adrenalin crashed, there were problems with the hibernation mode and much more.

After a while, I decided to return to my usual environment and install Debian. Recorded image on a flash drive, installed, rebooted and sunk into darkness. The system did not pull up the graphical shell, worked only in the console interface, threw errors in dmesg and hung tightly after half an hour. It was not possible to find out the reason for this behavior. After trying different options, I was disappointed and postponed the idea for a couple of days. At that moment, I even thought about staying on Windows 11 and using WSL for work tasks there. The devil whispered behind the window? Who knows… On w3bsit3-dns.com they advised me to install Liquorix Kernel. I did not follow the advice and decided to try to roll Kali Linux into branch rolling, since there is a fresher core, and a large amount of pre-installed software, which is necessary for work. This time the graphical shell loaded, the system worked for an hour or two. But the kernel message log continued to throw critical errors, and the system would freeze when it wanted to.

Realizing my position as a Linux user and hanging up my nose, I turned to a competent colleague at work who has been administering networks all his life. When he heard about shaomi, he sent me… But when it came to his favorite distro, he gave out the database and eventually put me on the right path. This installation method is not perfect, as I simply could not understand everything that my colleague suggested to do. And yet, in my case, it worked and made it possible to use my favorite distribution.

Base system installation

Being on Windows, you need to update the BIOS firmware from Xiaomi official website (using VPN), turn off Secure Boot and rub keys.

Downloading a distribution kit with non-free firmware from here. We need the firmware-*-amd64-DVD-1.iso file

We create bootable media and follow the standard installation steps, with the exception of partitioning the drive and choosing ready-made software sets.

Partitioning a drive is a fairly non-trivial installation step for ordinary users. There is little information on it, and it is often important for servers. You can check out Debian recommendations and with this manualto determine if you need it. Regarding client devices, I will say that it is dangerous to play with partitioning. There is a great chance to make a mistake with the amount of allocated space for some / tmp partition, after which some software will not be able to unpack files during installation. If you do not have specific tasks and there is no specific understanding of why to allocate a section, you do not need to do this. In my case, the SSD is 500 GB. I’ve highlighted the following partitions:

1.0 MB FREE SPACE

536.9MB ESP

150.0 GB ext4 /

11.6 GB swap

350.0GB ext4 /home

354.4 kB FREE SPACE

When installing, choose ONLY STANDARD SYSTEM UTILITIES, since you don’t want to pile up the system with unnecessary functionality provided by the graphical shell. In the end, we will install the graphical shell and all the tools necessary for the work ourselves. Carefully check that you have ticked the “Standard system utilities” box with a single checkmark.

After completing the installation, we go into the system under our user and increase the rights to root.

su - root

We bring the contents of the /etc/source.list file to the following form:

deb http://deb.debian.org/debian/ bookworm main contrib non-free non-free-firmware
deb-src http://deb.debian.org/debian/ bookworm main contrib non-free non-free-firmware

deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
deb-src http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware

deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
deb-src http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware

To save time, use selection (Shift + arrows), copy (Alt + 6) and paste (Ctrl + U). Save the file (Ctrl + S) and exit (Ctrl + X).

Update information about packages in the system:

apt update

At some point, the dependency manager prompts us to read the list of changes. Scroll through the changelog and press “q”.

Update installed packages to the latest versions:

apt upgrade -y

Next, the system will offer an automatic restart of services, if necessary for the correct installation of the package. Select “YES” and move on.

We also check if any packages need to be removed for a full upgrade:

apt full-upgrade -y

Reboot the device:

reboot

In my case, after rebooting, the laptop keyboard worked. If you also have a laptop with a resolution of 3200×2000, then you will understand what happiness it is.

Configuring and Compiling the Linux Kernel

Log in as root again and install the list of packages needed to compile the Linux kernel:

apt install wget build-essential dwarves python3 libncurses-dev flex bison libssl-dev bc libelf-dev

Go to the /usr/src directory and download the archive with the latest stable kernel version from official site:

cd /usr/src && wget https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.3.2.tar.xz

Unpack the archive into the current directory:

tar xvf linux-6.3.2.tar.xz

Change to the kernel source directory:

cd linux-6.3.2

Now we copy the current kernel configuration to the configuration file:

cp -v /boot/config-$(uname -r) .config && ls -lah

Adapt the current configuration to the new kernel by running the following command:

yes "" | make oldconfig

The “yes “”” command is required to accept the new options supplied by the fresh kernel as default.

Next, run the tool for configuring kernel parameters:

make menuconfig

Driver for wireless network controller installed in my laptop (Realtek Semiconductor RTL8852BE PCIe 802.11ax), was added to kernel version 6.2. You need to include it in the assembly by going to the following path: Device Drivers – Network Device Support – Wireless LAN – Realtek Devices – Realtek 802.11ax. In addition to including this driver in the assembly, I did not make any changes. In case you need any drivers for your hardware – study the contents of the tool and make the appropriate changes. After that, save the configuration and exit.

Just in case, we clear the directory from all files obtained as a result of compilation with the following command:

make clean

The output will be empty if we did not poke anything extra. If errors occur while compiling the kernel or its modules, this command can clear the directory and roll back the changes.

Next, find out how many processor threads we have at our disposal:

nproc

In my case, there are 16 of them. To parallelize the compilation of the kernel and its modules, I will select 12, which will speed up the process enough.

Run the following command to compile the kernel:

make bzImage -j 12

After compiling the kernel, compile its modules:

make modules -j 12

This process takes a lot of time depending on the processor power and the number of threads allocated for compilation. It took me about 20 minutes to compile the modules.

After completing the previous step, install the compiled modules:

make modules_install -j 12

And finally install the compiled kernel:

make install

Hooray, we’re halfway there. Let’s add lines to the GRUB bootloader configuration (/etc/default/grub) to save the operating system kernel we have chosen:

GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true

Update the bootloader configuration and restart the system:

update-grub && reboot

Firmware installation

Let’s install the sudo package as root, create a file in the /etc/sudoers.d directory and give our main user the ability to obtain privileged rights to execute commands.

su - root
apt install sudo
echo "user    ALL=(ALL:ALL) ALL" > /etc/sudoers.d/myconf
exit

Next, install packages with all possible firmware:

sudo apt install firmware-linux firmware-linux-free firmware-linux-nonfree firmware-misc-nonfre

We will also install the firmware for the microprogram processor and the firmware for the integrated graphics:

sudo apt install amd64-microcode firmware-amd-graphics

In the case of an internal from Intel:

sudo apt install intel-microcode

Installing the GUI

Run the following command to install the GUI and some must have packages:

sudo apt install kde-plasma-desktop xdg-desktop-portal-kde kde-spectacle kate ark gparted gwenview elisa print-manager kcalc ksystemlog

After that, we reboot the operating system, become satisfied with Linux and go to use the best distribution kit with the most beautiful graphical shell.

Demonstration of the KDE Plasma graphical shell

Demonstration of the KDE Plasma graphical shell

Additional optional steps

You can install the following useful packages:

sudo apt install vlc qbittorrent remmina thunderbird filezilla htop krita inxi imagemagick

You can read about each of them. Here.

You can also change the configuration in the /etc/network/interfaces file to transfer control of the interfaces to Network Manager. To do this, you need to bring it to the following form:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

After that, save the changes and restart the services:

sudo service networking restart
sudo service NetworkManager restart

Conclusion

When buying a laptop or personal computer on the latest generation of hardware, you will definitely encounter bugs and lack of drivers. There is a great chance to become disillusioned with Linux already at the deployment stage of the distribution. With the described method of installing Debian, for two days of active work there was not a single unexpected shutdown or failure of the Wi-Fi module. Non-critical GUI bugs, which I associate with the test version of the distribution, do not affect the continuity of work and system performance. ACPI errors that appear in dmesg after connecting and disconnecting the power cable to the physical interface also do not affect operation.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *