Last active
April 4, 2025 19:30
-
-
Save bgarber/e68738a50e3349e8d55fceca67345739 to your computer and use it in GitHub Desktop.
Revisions
-
bgarber revised this gist
Sep 8, 2024 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -181,7 +181,6 @@ Install the `console-setup` package to configure the keyboard layout (won't take Let's setup the time and date for the system. First, adjust if the system should interpret the hardware clock as "UTC" or "LOCAL" time. Generally, choosing UTC makes sense: ``` # vim /etc/adjtime ``` -
bgarber revised this gist
Sep 8, 2024 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -92,7 +92,7 @@ If you created one, mount the EFI system partition to `/mnt/boot`: # mount --mkdir /dev/sda1 /mnt/boot ``` Finally, mount other partitions you created to their respective directories (for example, the home partition to `/mnt/home`, etc.). ### Installing the base packages @@ -102,7 +102,7 @@ Do you remember the `debootstrap` tool we installed before? Here it will come to # debootstrap --arch=amd64 trixie /mnt http://ftp.debian.org/debian ``` Replace the `amd64` arch, the `trixie` suite (current testing as of the writing of this tutorial), and the `http://ftp.debian.org/debian` mirror to more convenient values to you. ### Configuring the `fstab` -
bgarber revised this gist
Sep 8, 2024 . 1 changed file with 6 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ Around 2005, I published in my personal blog in Wordpress a small tutorial on _h As you move on in this tutorial, you will notice it resembles a lot the Arch Linux installation method (hence the title). That's not a surprise since all of this existed even before Arch was popularized. This work grabs some steps from the [Instaling Debian GNU/Linux from a Unix/Linux System](https://www.debian.org/releases/stable/amd64/apds03.en.html), in the Random Bits appendix from the Debian documentation. I decided to create one of my own because some of those steps could be either abbreviated or more detailed. **DISCLAIMER**: as you already suspect, these steps will _potentially break your system_! **Read every step carefully** and check what applies to your scenario. I will try to be the more detailed and thorough I can, but I cannot predict every situation. I recommend practicing these steps in a virtual machine before trying in your real PC. @@ -20,7 +20,7 @@ The first thing you'll need is a running environment to start on. I recommend do I will not go into the details of how to boot from CD or pendrive. I recommend reading your PC manufacturer's manual to do that. Generally, it boils down to enabling media boot and disabling the Secure Boot in the BIOS configuration. After you installed the system, you can move back to the factory defaults. In a virtual environment, this is not needed. Once you booted your live environment, open a terminal and install the `debootstrap` and `vim` tools. If you are on a Debian-based live distro, that would be: ``` $ sudo apt update @@ -55,13 +55,13 @@ If you are in a UEFI system, be sure to create an `EFI System` partition, if it ### Formatting If you created a boot partition, format it as FAT 32, since it is compliant with the UEFI spec. For example: ``` # mkfs.fat -F 32 /dev/sda1 ``` If you created a SWAP partition, format and activate it: ``` # mkswap /dev/sda2 @@ -80,7 +80,7 @@ Now you are ready to install the system. ### Mounting the partitions You'll need to mount all of your partitions in the tree they will end up. The `/mnt` directory in our live system is perfect for that. First, mount the root partition: ``` @@ -92,7 +92,7 @@ If you created one, mount the EFI system partition to `/mnt/boot`: # mount --mkdir /dev/sda1 /mnt/boot ``` Finally, mount other partitions you created to their respective directories (for example `/home`) ### Installing the base packages -
bgarber revised this gist
Mar 30, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -327,6 +327,6 @@ One aspect I like about `lightdm` is that you may configure the look and feel as - the Arctica greeter; - the slick greeter; - and [others](https://packages.debian.org/trixie/lightdm-greeter)... #### Desktop Environments -
bgarber revised this gist
Mar 30, 2024 . 1 changed file with 20 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -307,6 +307,26 @@ There is a list of groups available in any Debian installation [here](https://wi ### Installing the graphical interface Here is where things get cooler. See, up to now, we installed and controlled every single bit of data that entered our installation. One could simply execute in the terminal: ``` $ sudo apt install task-xfce-desktop ``` Or any other of the pre-cooked tasks (anything `task-*-desktop`), and install all packages for running a graphical environment. But that would defeat our purpose here! We want **lean and clean**! #### Display Managers Debian offers a myriad of [Display Managers](https://wiki.debian.org/DisplayManager?highlight=%28display%29%7C%28managers%29) to work with. You can install one of your choice. I like `lightdm`, so I'll keep it: ``` $ sudo apt install lightdm ``` One aspect I like about `lightdm` is that you may configure the look and feel as you wish. This look and feel is called `greeters`. By default, `lightdm` comes with the `lightdm-gtk-greeter`, but you can configure: - the Arctica greeter; - the slick greeter; - and others... #### Desktop Environments -
bgarber revised this gist
Mar 30, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -231,7 +231,7 @@ If you want Grub to automatically detect other OSes, you must uncomment the `GRU # update-grub ``` This should be enough to be able to boot your new environment. If you installed Grub with UEFI system, you may want to enable Secure Boot. Currently, Grub fully supports Secure Boot mode. In my experience, the steps above are enough for booting a system with Secure Boot enabled, but in your case you may need extra steps. They can be found [here](https://wiki.debian.org/SecureBoot) and [here](https://wiki.archlinux.org/title/GRUB#Secure_Boot_support). ## Configuring APT sources and the network -
bgarber revised this gist
Mar 30, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -287,7 +287,7 @@ And exit the live environment. Remember to remove any media before booting the n ### Creating your first un-privileged user We have a nice, running OS now. But we only have root, which is not recommended to be frequently used! Creating your first un-privileged user is as easy as running a single command: ``` # adduser debie -
bgarber revised this gist
Mar 30, 2024 . 1 changed file with 18 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -287,6 +287,24 @@ And exit the live environment. Remember to remove any media before booting the n ### Creating your first un-privileged user We have a nice, running OS now. But we only have root, which is not recommended to be frequently used! Creating your first unprivileged user is as easy as running a single command: ``` # adduser debie ``` This will create an unprivileged user, create the user's group (`debie`, in this case), and this user to the `users` group. Theoretically, this is all your user needs, for now. You can install `sudo` tool and add the new user to the `sudo` group, granting it privileges to run `sudo` commands: ``` # adduser debie sudo ``` There is a list of groups available in any Debian installation [here](https://wiki.debian.org/SystemGroups). You may consider adding your user to `cdrom`, `audio`, `floppy`, and `lp` (if you plan to use a printer) groups. ``` # usermod -aG cdrom,audio,floppy,lp debie ``` ### Installing the graphical interface #### Display Managers -
bgarber revised this gist
Mar 29, 2024 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -215,15 +215,15 @@ Our system is almost complete and bootable by now. But there's no bootloader ins If you want Grub to automatically detect other OSes, you must uncomment the `GRUB_DISABLE_OS_PROBER=false` line at `/etc/default/grub` file. This will enable Grub to execute the `os-prober` to detect other bootable operating systems. → _If you are using BIOS with MBR partition label_, then you can simply execute the following commands: ``` # apt-get install grub-pc # grub-install /dev/sda # update-grub ``` → _If you are using UEFI with GPT partition label_, then you'll need the EFI version of Grub: ``` # apt-get install grub-efi -
bgarber revised this gist
Mar 29, 2024 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -141,15 +141,15 @@ UUID=zzzz none swap sw 0 0 /dev/cdrom /media/cdrom iso9660 noauto,ro,user,exec 0 0 ``` ## Prepare for `chroot` Now it is time to `chroot` to our newly created system. Before going into that, it is good to mount a few things in the structure of the Debian environment, so everything runs Ok: ``` # mount --rbind /dev /mnt/dev # mount --rbind /sys /mnt/sys # mount --rbind /run /mnt/run # mount --rbind /proc /mnt/proc ``` Then the installed system will "act" very much like our live environment. Now we can `chroot` to it: -
bgarber revised this gist
Mar 29, 2024 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,7 +16,7 @@ In the end, you will understand how any Linux Distro works. _Mastering the art o ## Booting and preparing the live environment The first thing you'll need is a running environment to start on. I recommend downloading one of the [Ubuntu live CD's](https://ubuntu.com/download/desktop). Even better are the [Ubuntu flavors](https://ubuntu.com/desktop/flavours), as they are generally smaller than Ubuntu. I'll be using Xubuntu because that's what I had at first, but you can choose any live system you like (with small adaptations). I even have already gone through these steps with a Gentoo live CD! I will not go into the details of how to boot from CD or pendrive. I recommend reading your PC manufacturer's manual to do that. Generally, it boils down to enabling media boot and disabling the Secure Boot in the BIOS configuration. After you installed the system, you can move back to the factory defaults. In a virtual environment, this is not needed. @@ -27,7 +27,7 @@ $ sudo apt update $ sudo apt install debootstrap vim ``` If the package manager of your live environment does not contain `debootstrap` (most of them do), then you'll have to manually download it from the [Debian mirrors](https://www.debian.org/mirror/list). Navigate to one of your preference and go to `pool/main/d/debootstrap/` path. Download the latest `debootstrap_X.Y.ZZZ_all.deb` file, extract, and install it: ``` # ar -x debootstrap_X.Y.ZZZ_all.deb -
bgarber revised this gist
Mar 29, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -55,7 +55,7 @@ If you are in a UEFI system, be sure to create an `EFI System` partition, if it ### Formatting If you created a boot partition, format it as FAT 32, since it is UEFI spec compliant. For example: ``` # mkfs.fat -F 32 /dev/sda1 -
bgarber revised this gist
Mar 29, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -55,7 +55,7 @@ If you are in a UEFI system, be sure to create an `EFI System` partition, if it ### Formatting If you created a boot partition, format it as FAT 32, since it is UEFI spec compliance. For example: ``` # mkfs.fat -F 32 /dev/sda1 -
bgarber revised this gist
Mar 29, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,7 +12,7 @@ This work grabs some steps from the [Instaling Debian GNU/Linux from a Unix/Linu Mainly, for two reasons. First, as a _Linux enthusiast_, I've been a Debian-fan for decades now. Debian pioneered the art of installing software in Linux environments, something they bundled and called _packages_. The `dpkg` and `apt-get` tools revolutionized the way software is installed on Linux, and they remain relevant up to today. Second, as a _software developer_, I like my OS environment **lean and clean**. That means I dislike useless packages floating around my system. Manually installing only what you need gives you the power to build the environment as you like. In the end, you will understand how any Linux Distro works. _Mastering the art of Linux installation_ will give you powers to modify and recover virtually any Linux installation from any situation. ## Booting and preparing the live environment -
bgarber revised this gist
Mar 28, 2024 . 1 changed file with 42 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -235,12 +235,54 @@ This should be enough to be able to boot your new environment. If you installed ## Configuring APT sources and the network If you check the `/etc/apt/sources.list` of our new system, you'll see it only has one entry. A better configuration for it, if you are installing the `testing` release as me, would be: ``` deb http://deb.debian.org/debian trixie main non-free-firmware deb-src http://deb.debian.org/debian trixie main non-free-firmware deb http://deb.debian.org/debian-security/ trixie-security main non-free-firmware deb-src http://deb.debian.org/debian-security/ trixie-security main non-free-firmware ``` Refresh list of packages: ``` # apt update ``` Remember to keep the mirror you chose when executing the `debootstrap`. Now, change your hostname by editing the `/etc/hostname` file: ``` # vim /etc/hostname ``` For configuring connection, you can statically set up the configuration, or you can set up DHCP. Although it is not hard to set up static configuration, it is better to enable DHCP. For this, we'll install the `networkmanager` package: ``` # apt install network-manager ``` ## Cleaning up and rebooting We finally arrived the end of installing a bootable base system. You must set a password for your root user: ``` # passwd ``` Clean up everything: ``` # apt clean ``` And exit the live environment. Remember to remove any media before booting the new system. This will leave you with an extra minimal installation of Debian, fully functional. <img width="391" alt="image" src="https://gist.github.com/assets/1001525/c1d09186-e060-4a22-bf37-b24ddd07aefc"> ## Extra bits ### Creating your first un-privileged user -
bgarber revised this gist
Mar 28, 2024 . 1 changed file with 23 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -158,7 +158,7 @@ Then the installed system will "act" very much like our live environment. Now we # chroot /mnt bash ``` From now on, all commands must be executed in this "chroot'ed" environment, unless when noted otherwise. ## Setup locales and configure the keyboard @@ -211,6 +211,28 @@ Now we need to install a Linux Kernel version for our system. The `debootstrap` ## Installing and configuring the bootloader Our system is almost complete and bootable by now. But there's no bootloader installed yet! The list of available bootloaders for Debian can be found at <https://wiki.debian.org/BootLoader>. A very popular choice is using Grub (GRand Unified Bootloader) and that's the one I'll be using. If you want Grub to automatically detect other OSes, you must uncomment the `GRUB_DISABLE_OS_PROBER=false` line at `/etc/default/grub` file. This will enable Grub to execute the `os-prober` to detect other bootable operating systems. If you are using BIOS with MBR partition label, then you can simply execute the following commands: ``` # apt-get install grub-pc # grub-install /dev/sda # update-grub ``` If you are using UEFI with GPT partition label, then you'll need the EFI version of Grub: ``` # apt-get install grub-efi # grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB # update-grub ``` This should be enough to be able to boot your new environment. If you installed Grub with UEFI system, you may want to enable Secure Boot. Grub fully supports Secure Boot mode, but you'll need more steps to enable that. Those steps can be found [here](https://wiki.debian.org/SecureBoot). ## Configuring APT sources and the network ## Cleaning up and rebooting -
bgarber revised this gist
Mar 28, 2024 . 1 changed file with 42 additions and 15 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,7 +18,7 @@ In the end, you will understand how any Linux Distro works. _Mastering the art o The first thing you'll need to have is a running environment to start on. I recommend downloading one of the [Ubuntu live CD's](https://ubuntu.com/download/desktop). Even better are the [Ubuntu flavors](https://ubuntu.com/desktop/flavours), as they are generally smaller than Ubuntu. I'll be using Xubuntu because that's what I had at first, but you can choose any live system you like (with small adaptations). I even have already gone through these steps with a Gentoo live CD! I will not go into the details of how to boot from CD or pendrive. I recommend reading your PC manufacturer's manual to do that. Generally, it boils down to enabling media boot and disabling the Secure Boot in the BIOS configuration. After you installed the system, you can move back to the factory defaults. In a virtual environment, this is not needed. Once you booted your live environment, open a terminal and install the `debootstrap` tool. If you are on a Debian-based live distro, that would be: @@ -39,9 +39,9 @@ That's all for this step! ## Partitioning the disk and formatting Before going into this, if your disk is already partitioned, make sure that your SWAP partition is not already in use, if you have one. If it is in use, it will prevent synchronizing the changes you make. If that's the case, simply `swapoff /dev/sdXY`, where `sdXY` is your SWAP partition. I'll use `cfdisk` for partitioning the disk since I find it easier to use than `fdisk`. You can use any partitioning tool you feel comfortable with. You can even use `gparted`, if you have a graphical live environment. Usually, you'll need at least two partitions, one for your OS and one for swap. If you opt to use a swapfile instead of a partition, then all you need is the OS partition. <img width="530" alt="image" src="https://gist.github.com/assets/1001525/b39b3c99-ed17-451a-a868-6e9cfdacc04a"> @@ -55,13 +55,13 @@ If you are in a UEFI system, be sure to create an `EFI System` partition, if it ### Formatting If you created a boot partition, format it as FAT 32, UEFI spec compliance. For example: ``` # mkfs.fat -F 32 /dev/sda1 ``` If you created a SWAP partition, format it and activate it: ``` # mkswap /dev/sda2 @@ -141,7 +141,26 @@ UUID=zzzz none swap sw 0 0 /dev/cdrom /media/cdrom iso9660 noauto,ro,user,exec 0 0 ``` ## Mount the partitions created and `chroot` Now it is time to `chroot` to our newly created system. Before going into that, it is good to mount a few things in the structure of the Debian environment, so everything runs Ok: ``` # mount --rbind /dev /mnt/dev # mount --rbind /proc /mnt/proc # mount --rbind /sys /mnt/sys # mount --rbind /run /mnt/run ``` Then the installed system will "act" very much like our live environment. Now we can `chroot` to it: ``` # chroot /mnt bash ``` From now on, most of the time we will work in this "chroot'ed" environment, unless when noted otherwise. ## Setup locales and configure the keyboard Install the `locales` package and configure it. Select all languages that make sense to you. @@ -157,24 +176,32 @@ Install the `console-setup` package to configure the keyboard layout (won't take # dpkg-reconfigure keyboard-configuration ``` ## Adjust time and date Let's setup the time and date for the system. First, adjust if the system should interpret the hardware clock as "UTC" or "LOCAL" time. Generally, choosing UTC makes sense: ``` # apt-get install vim # vim /etc/adjtime ``` Insert the following contet: ``` 0.0 0 0.0 0 UTC ``` Now, configure your timezone: ``` # dpkg-reconfigure tzdata ``` ## Installing the Kernel Now we need to install a Linux Kernel version for our system. The `debootstrap` tool will leave you with a really bare minimal system. You can pick up the one available using `apt-cache search linux-image`, or simply use the meta-package to install the latest one: ``` # apt-get install linux-image-amd64 linux-headers-amd64 -
bgarber revised this gist
Mar 28, 2024 . 1 changed file with 76 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,7 +24,7 @@ Once you booted your live environment, open a terminal and install the `debootst ``` $ sudo apt update $ sudo apt install debootstrap vim ``` If the package manager of your live environment does not have the debootstrap (most of them have), then you'll have to manually download it from the [Debian mirrors](https://www.debian.org/mirror/list). Navigate to one of your preference and go to `pool/main/d/debootstrap/` path. Download the latest `debootstrap_X.Y.ZZZ_all.deb` file, extract, and install it: @@ -106,11 +106,85 @@ Replace the `amd64` arch, the `trixie` (current testing as of the writing of thi ### Configuring the `fstab` Now, if you list the directories in `/mnt`, you'll see the basic structure of a Linux installation. <img width="463" alt="image" src="https://gist.github.com/assets/1001525/49c7e7e1-1b33-42b4-96c2-b5aca0e80860"> It is time to configure the `fstab` file for this environment. If you open it, it should be empty. Start it by dumping the partitions UUIDs into it: ``` # blkid >> /mnt/etc/fstab ``` And edit it with your favorite editor (I use VIM, BTW): ``` # vim /mnt/etc/fstab ``` Add the following content, using the `blkid` dump already present in the file to complete the required values. ``` # /etc/fstab: static file system information. # # file system mount point type options dump pass # /dev/sda3 UUID=xxxx / ext4 defaults 0 1 # /dev/sda1 UUID=yyyy /boot vfat ro,nosuid,nodev 0 2 # /dev/sda2 UUID=zzzz none swap sw 0 0 # cdrom /dev/cdrom /media/cdrom iso9660 noauto,ro,user,exec 0 0 ``` ## Setup locales and keyboard Install the `locales` package and configure it. Select all languages that make sense to you. ``` # apt-get install locales # dpkg-reconfigure locales ``` Install the `console-setup` package to configure the keyboard layout (won't take effect until reboot): ``` # apt-get install console-setup # dpkg-reconfigure keyboard-configuration ``` ## Installing the Kernel Now it is time to `chroot` to our newly created system. Before going into that, it is good to mount a few things in the structure of the Debian environment, so everything runs Ok: ``` # mount --rbind /dev /mnt/dev # mount --rbind /proc /mnt/proc # mount --rbind /sys /mnt/sys # mount --rbind /run /mnt/run ``` Then the installed system will "act" very much like our live environment. Now we can `chroot` to it: ``` # chroot /mnt bash ``` The first thing to install is a version of the Linux Kernel. You can pick up the one available using `apt-cache search linux-image`, or simply use the meta-package to install the latest one: ``` # apt-get install linux-image-amd64 linux-headers-amd64 ``` (Install the Linux headers only if you want to install specific drivers; it is not required.) ## Installing and configuring the bootloader ## Configuring APT sources and the network ## Cleaning up and rebooting -
bgarber revised this gist
Mar 28, 2024 . 1 changed file with 30 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -74,8 +74,38 @@ Any other data partition, you may format with the file system you want. Every FS # mkfs.ext4 /dev/sda3 ``` Now you are ready to install the system. ## Installing the basic system ### Mounting the partitions You'll need to mount all of your partitions in the tree they will end up. The `/mnt` directory in our live system is perfect that. First, mount the root partition: ``` # mount /dev/sda3 /mnt ``` If you created one, mount the EFI system partition to `/mnt/boot`: ``` # mount --mkdir /dev/sda1 /mnt/boot ``` Finally, mount every other partition you created to their respective directories (for example `/home`) ### Installing the base packages Do you remember the `debootstrap` tool we installed before? Here it will come to action! ``` # debootstrap --arch=amd64 trixie /mnt http://ftp.debian.org/debian ``` Replace the `amd64` arch, the `trixie` (current testing as of the writing of this tutorial) suite, and the `http://ftp.debian.org/debian` mirror to more convenient values to you. ### Configuring the `fstab` ## Installing the Kernel ## Installing and configuring the bootloader -
bgarber revised this gist
Mar 28, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # The Art of Installing Debian the Arch-way Around 2005, I published in my personal blog in Wordpress a small tutorial on _how to install Debian the Nerd-way_. That post is long gone now, and it was more like a small reference guide for myself than anything else. Recently I tried some of those steps again just for fun to see they still work and they do! As you move on in this tutorial, you will notice it resembles a lot the Arch Linux installation method (hence the title). That's not a surprise since all of this existed even before Arch was popularized. -
bgarber revised this gist
Mar 28, 2024 . 1 changed file with 22 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -37,7 +37,7 @@ If the package manager of your live environment does not have the debootstrap (m That's all for this step! ## Partitioning the disk and formatting Before going into this, if your disk is already partitioned, make sure that your SWAP partition is not already in use, if you have one. If it is in use, it will prevent synchronizing the changes you make. @@ -53,6 +53,27 @@ If you are in a UEFI system, be sure to create an `EFI System` partition, if it | /dev/sda2 | SWAP | | /dev/sda3 | / | ### Formatting If you created a boot partition, format it as FAT 32. For example: ``` # mkfs.fat -F 32 /dev/sda1 ``` If you created a SWAP partition, format it with `mkswap` and activate it with `swapon` ``` # mkswap /dev/sda2 # swapon /dev/sda2 ``` Any other data partition, you may format with the file system you want. Every FS has its pros and cons; I recommend using Ext4, as it is more widely adopted. ``` # mkfs.ext4 /dev/sda3 ``` ## Installing the basic system ## Installing the Kernel -
bgarber revised this gist
Mar 28, 2024 . 1 changed file with 32 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,14 +18,40 @@ In the end, you will understand how any Linux Distro works. _Mastering the art o The first thing you'll need to have is a running environment to start on. I recommend downloading one of the [Ubuntu live CD's](https://ubuntu.com/download/desktop). Even better are the [Ubuntu flavors](https://ubuntu.com/desktop/flavours), as they are generally smaller than Ubuntu. I'll be using Xubuntu because that's what I had at first, but you can choose any live system you like (with small adaptations). I even have already gone through these steps with a Gentoo live CD! I will not go into the details of how to boot from CD or pendrive. I recommend reading your PC manufacturer's manual to do that. Generally, it boils down to enabling media boot and disabling the Secure Boot in the BIOS configuration. After you installed the system you can move back to the factory defaults. In a virtual environment, this is not needed. Once you booted your live environment, open a terminal and install the `debootstrap` tool. If you are on a Debian-based live distro, that would be: ``` $ sudo apt update $ sudo apt install debootstrap ``` If the package manager of your live environment does not have the debootstrap (most of them have), then you'll have to manually download it from the [Debian mirrors](https://www.debian.org/mirror/list). Navigate to one of your preference and go to `pool/main/d/debootstrap/` path. Download the latest `debootstrap_X.Y.ZZZ_all.deb` file, extract, and install it: ``` # ar -x debootstrap_X.Y.ZZZ_all.deb # cd / # zcat /full-path-to-extracted-deb/data.tar.gz | tar xv ``` That's all for this step! ## Partitioning the disk and formating Before going into this, if your disk is already partitioned, make sure that your SWAP partition is not already in use, if you have one. If it is in use, it will prevent synchronizing the changes you make. I'll use `cfdisk` for partitioning the disk since I find it easier to use than `fdisk`. You can use any partitioning tool you feel comfortable, even `gparted` if you have a graphical live environment. Usually, you'll need at least two partitions, one for your OS and one for swap. If you opt to use a swapfile instead of a partition, then all you need is the OS partition. <img width="530" alt="image" src="https://gist.github.com/assets/1001525/b39b3c99-ed17-451a-a868-6e9cfdacc04a"> If you are in a UEFI system, be sure to create an `EFI System` partition, if it is not already existent. Make it at least 1 GiB, and positioned at the beginning of the device. In this case, it's advisable to use GPT as your partition label, instead of MBR, to avoid some headaches with compatibility. One suggestion of layout for an UEFI system partition table is: | dev | mount point | |-----------|-------------| | /dev/sda1 | /boot | | /dev/sda2 | SWAP | | /dev/sda3 | / | ## Installing the basic system @@ -45,4 +71,8 @@ $ sudo apt install debootstrap ### Creating your first un-privileged user ### Installing the graphical interface #### Display Managers #### Desktop Environments -
bgarber revised this gist
Mar 28, 2024 . 1 changed file with 15 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,18 +1,29 @@ # The Art of Installing Debian the Arch-way Around 2005, I published in my personal blog in Wordpress a small tutorial on _how to install Debian the Nerd-way_. That post is long gone now, and it was a small reference guide more for myself than anything else. Recently I tried some of those steps again just for fun to see they still work and they do! As you move on in this tutorial, you will notice it resembles a lot the Arch Linux installation method (hence the title). That's not a surprise since all of this existed even before Arch was popularized. This work grabs some steps from the [Instaling Debian GNU/Linux from a Unix/Linux System](https://www.debian.org/releases/stable/amd64/apds03.en.html), in the Random Bits appendix from the Debian documentation. I decided do create one of my own because some of those steps could be either abbreviated or more detailed. **DISCLAIMER**: as you already suspect, these steps will _potentially break your system_! **Read every step carefully** and check what applies to your scenario. I will try to be the more detailed and thorough I can, but I cannot predict every situation. I recommend practicing these steps in a virtual machine before trying in your real PC. ## Why? Mainly, for two reasons. First, as a _Linux enthusiast_, I've been a Debian-fan for decades now. Debian pioneered the art of installing software in Linux environments, something they bundled and called _packages_. The `dpkg` and `apt-get` tools revolutionized the way software is installed on Linux, and they remain relevant up to today. Second, as a _software developer_, I like my OS environment **lean and clean**. That means I dislike useless packages floating around my system. Manually installing only what you need gives you the power to build the environment as you like. In the end, you will understand how any Linux Distro works. _Mastering the art of Linux installation_ will give you powers to understand how any Distro works, and to change and recover your system from any situation. ## Booting and preparing the live environment The first thing you'll need to have is a running environment to start on. I recommend downloading one of the [Ubuntu live CD's](https://ubuntu.com/download/desktop). Even better are the [Ubuntu flavors](https://ubuntu.com/desktop/flavours), as they are generally smaller than Ubuntu. I'll be using Xubuntu because that's what I had at first, but you can choose any live system you like (with small adaptations). I even have already gone through these steps with a Gentoo live CD! Once you booted your live environment, open a terminal and install the `debootstrap` tool. If you are on a Debian-based live distro, that would be: ``` $ sudo apt update $ sudo apt install debootstrap ``` ## Partitioning the disk -
bgarber revised this gist
Mar 28, 2024 . 1 changed file with 35 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,37 @@ # The Art of Installing Debian the Arch-way Around 2005, I published in my personal blog in Wordpress a small tutorial on _how to install Debian the Nerd-way_. That post is long gone now, and it was a small reference guide more for myself than anything else. Recently I tried some of those steps just for fun to see they still work and they do! As you move on in this tutorial, you will notice it resembles a lot the Arch Linux installation method (hence the title). That's not a surprise, as all of this existed even before Arch was popularized. This work grabs some references from the [Instaling Debian GNU/Linux from a Unix/Linux System](https://www.debian.org/releases/stable/amd64/apds03.en.html), in the Random Bits appendix from the Debian documentation. I decided do create one of my own because some of those steps could be either abbreviated or more detailed. ## Why? Mainly, for two reasons. First, as a _Linux enthusiast_, I've been a Debian-fan for decades now. Debian pioneered the art of installing software in Linux environments, something they bundled and called _packages_. The `dpkg` and `apt-get` tools revolutionized the way software is installed on Linux, and they remain relevant up to today. Second, as a _software developer_, I like my OS environment **lean and clean**. That means I dislike useless packages floating around my system. Manually installing only what you need gives you the power to build the environment as you like. In the end, you will understand how any Linux Distro works. _Mastering the art of Linux installation_ will give you powers to understand how any Distro works, and to change and recover your system from any situation. ## Booting and preparing Live environment ## Partitioning the disk ## Installing the basic system ## Installing the Kernel ## Installing and configuring the bootloader ## Configuring the network ## Cleaning up and rebooting ``` # passwd ``` ## Extra bits ### Creating your first un-privileged user ### Installing the graphical interface -
bgarber created this gist
Mar 28, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ # The Art of Installing Debian the Arch-way Around 2006 - 2008, I published in my personal blog in Wordpress a small tutorial on _how to install Debian the Nerd-way_. That post was a small reference guide, more for myself than anything else.