Best Case:
do-release-upgrade
do-release-upgrade -d // dev version
Other Cases:
-
Format and Partition Hard Disk
gparted
- making first partition with: - fat32 format - ‘boot’ and ‘esp’ flags - including an extra partition for persistence later - likely useext4
for linux -
Bootstrap the OS
ap_install binutils debootstrap mount /dev/hda1 /mnt /usr/sbin/debootstrap --arch $ARCH $RELEASE $MNT $URL_SRC
- where:
- $ARCH, e.g., amd64
- $RELEASE, e.g., wily
- $MNT, e.g., /mnt
- $URL_SRC, e.g., http://archive.ubuntu.com/ubuntu
- where:
-
Prepare to chroot a.
sysctl kernel.hostname=NEW_HOSTNAME
b. Plan on copying fstab to target disk and using blkid to identify target disk UUID that will replace fstab source disk UUID c. Consider copying network info before rebooting: - /mnt/etc/network/interfaces - /mnt/etc/hosts - /mnt/etc/resolv.conf -
Chroot into target disk/OS
mount -t proc none /mnt2/proc; \ mount -o bind /dev /mnt2/dev; \ LANG= chroot /mnt2 /bin/bash passwd dpkg-reconfigure --default-priority passwd // create a user and switch shadow password on
-
Installing Packages
- Basics:
- apt-get update
- openssh-server
- ubuntu-standard
- linux-image-$ARCH
- Perhaps copy “some” from existing system:
dpkg --get-selections | grep "install" | cut -f1
- one list of transferred packages
- Maybe set some environment vars
- Basics:
locale-gen en_US.UTF-8
echo 'LANG="en_US.UTF-8"' >> /etc/environment
echo 'LANGUAGE="en_US:en"' >> /etc/environment
```
-
Gracefully end chroot
exit cd / for i in /mnt/proc /mnt/dev /mnt do umount $i; done