Pre-req
apt-get install debootstrap arch-install-scripts
arch-install-scripts is optional and from Vanir, useful for getting all mounts setup before chrooting in.
If you’re going to make an encrypted setup, you’ll also need cryptsetup-bin and lvm2
Do any partitioning, should be easy with gparted.
debootstrapping
Create the mountpoint.
mkdir /target
Mount the partition we intend to be root.
mount /dev/sda1 /target
Debootstrap, enabling all repository components.
debootstrap --components=main,restricted,universe,multiverse xenial /target
The rest of these are helpers from arch-install-scripts. First we generate a basic fstab. we may need to tweak it some, adding errors=remount-ro for your rootfs.
genfstab /target > /target/etc/fstab
Then we chroot into the system, bind mounting /sys, /proc, /dev, etc, etc.
arch-chroot /target bash
chrooted
Install the basics
We now install tasks for the base system, standard system, the desktop (or core if available) task for the desired flavor, then install a kernel and grub2.
In this example we use xubuntu-core, but the choices are varied.
apt-get install minimal^ standard^ xubuntu-core^ linux-generic grub2
This should prompt for you to install grub to the MBR.
Add your admin account
Next up, add your user account.
adduser USER
Then add it to the sudo group if you wish to make it an admin (which you should.)
adduser USER sudo
Apt sources
This is the same sources.list as you’d see in an installed system, sans comments.
/etc/apt/sources.list:
deb http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu xenial-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu xenial-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
At this point you can do whatever other changes you may want, and should be ready to boot into the new system.
Unit 193 would run his standard bootstrap.sh script to add the Vanir repo and install a few packages.
Now exit the chroot with exit or Ctrl+d
References
-
http://www.debuntu.org/how-to-encrypted-partitions-over-lvm-with-luks/
-
https://www.debian-administration.org/article/577/How_To_Migrate_to_a_full_encrypted_LVM_system
-
http://blog.tincho.org/posts/Setting_up_my_server:_re-installing_on_an_encripted_LVM/
-
https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system#LVM_on_LUKS