Skip to content

Instantly share code, notes, and snippets.

@bashelled
Forked from Tookmund/Debootstrap Install.rst
Last active May 21, 2021 20:10
Show Gist options
  • Save bashelled/c7263d1e7b026fe66ebdc7f2d66efe00 to your computer and use it in GitHub Desktop.
Save bashelled/c7263d1e7b026fe66ebdc7f2d66efe00 to your computer and use it in GitHub Desktop.
Install Debian or Ubuntu like Arch, simplified

Install Debian/Ubuntu/Kali like Arch/Gentoo

Indicators:

  • <<>>: Replacable
  • <>: Replace
  1. Download and boot from a Debian/Ubuntu live CD: https://www.debian.org/CD/live/ (if you have an existing Linux system with debootstrap support, skip to step 3)

  2. Login with user:live

  3. Setup and mount disks at /mnt. Arch Linux has a good guide to this: https://wiki.archlinux.org/index.php/Partitioning

Install and run debootstrap

    -   `sudo apt-get install debootstrap` (or `sudo pacman -S debootstrap`, `sudo dnf install debootstrap`, `sudo xbps-install debootstrap`, `emerge -a debootstrap` and so on...)
    -   **Replace RELEASE below with the name of the release you want to install, like `jessie` or `vivid`**
    -   Debian:
        `sudo debootstrap <RELEAS>E /mnt <<http://ftp.debian.org/debian>>`
    -   (If Ubuntu) `sudo apt-get install ubuntu-archive-keyring`
    -   Ubuntu:
        `sudo debootstrap <RELEASE> /mnt <<http://archive.ubuntu.com/ubuntu>>`

Mount Filesystems:

    -   `sudo mount --bind /dev /mnt/dev`
    -   `sudo mount -t proc none /mnt/proc`
    -   `sudo mount -t sysfs sys /mnt/sys`
  1. Chroot into your new system with chroot /mnt /bin/bash

  2. Edit /etc/fstab https://wiki.archlinux.org/index.php/Fstab or install arch-install-scripts and use genfstab /mnt >> /mnt/etc/fstab before you chroot

  3. Set hostname with: echo <host> > /etc/hostname and edit /etc/hosts to match it, although editing /etc/hosts is not required because it is already set

  4. Set timezone with ln -sf /usr/share/zoneinfo/<ZONE>/<SUBZONE> /etc/localtime

  5. Set root password with: passwd, and make a user if needed (adduser <user>) Note: On some systems like Arch Linux, (/usr)/sbin is not in $PATH. Be sure to add it.

  6. Generate Locales

    • apt-get install locales
    • Edit /etc/locale.gen
    • locale-gen
  7. Install a Linux kernel

    • Locate the apropiate one with: apt-cache search linux-image
    • Install it with apt-get install linux-image-<version>
  8. Setup Bootloader (skip to 15 on installed OS)

    • BIOS: apt-get install grub-pc
    • UEFI: apt-get install grub-efi
  9. Install Bootloader with:

    • BIOS: grub-install /dev/<DEVICENAME>
    • UEFI: grub-install --efi-directory=<efi-dir>
  10. Exit Chroot with: exit (installed OS users must update the bootloader, if Debian/Ubuntu isn't recognised, skip back to 13)

  11. Umount everthing:

    • sudo umount /mnt/dev
    • sudo umount /mnt/proc
    • sudo umount /mnt/sys
    • sudo umount /mnt
  12. Reboot with sudo shutdown -r now

  13. Remove installation media,

  14. Enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment