You can install Ubuntu directly from Linux using debootstrap. Debootstrap installs some essential packages in a directory for use
with chroot. Note that the essential packages does not in itself make the system bootable. It just installs what you need to chroot
to that directory and use apt-get to install other packages which make Ubuntu usable.
Step 1 : First check that you have debootstrap installed.
sudo apt-get install debootstrap
(NOTE: if you want to install a newer release than your current system, you normally need to install
the backported debootstrap version,
Step 2 :Partition device and make a filesystem.
We will assume /dev/sda is the storage device for your fresh install.
Remove former partitions and create the new one.
sudo fdisk /dev/sda
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help): p
Disk /dev/sda: 250.0 GB, 250000000000 bytes
255 heads, 63 sectors/track, 30394 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00031196
Device Boot Start End Blocks Id System
/dev/sda1 * 1 2550 20482843+ 83 Linux
/dev/sda2 2551 30394 223656930 8e Linux LVM
Command (m for help): d
Partition number (1-4): 1
Command (m for help): d
Selected partition 2
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-30394, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-30394, default 30394):
Using default value 30394
Command (m for help): p
Disk /dev/sda: 250.0 GB, 250000000000 bytes
255 heads, 63 sectors/track, 30394 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00031196
Device Boot Start End Blocks Id System
/dev/sda1 1 30394 244139773+ 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
Make the filesystem
sudo mkfs.ext4 /dev/sda1
Step 3 :Mount that new partition.
sudo mkdir /mnt/installer
sudo mount /dev/sda1 /mnt/installer
Step 4 : Download and install base system packages.
sudo debootstrap lucid /mnt/installer
Step 5 : Copy files to the new install to keep your repositories
sudo cp /etc/apt/sources.list /mnt/installer/etc/apt/
Step 6 : Chroot to your new install
sudo mount --bind /dev /mnt/installer/dev
sudo mount --bind /dev/pts /mnt/installer/dev/pts
sudo mount -t proc proc /mnt/installer/proc
sudo mount -t sysfs sys /mnt/installer/sys
sudo chroot /mnt/installer
Step 7 :Locale and language settings To make dpkg run without warning you need to set this settings first
cp /usr/share/zoneinfo/America/Sao_Paulo /etc/localtime
echo 'LANG="pt_BR.UTF-8' > /etc/default/locale
echo 'LANG="pt_BR:pt:us' >> /etc/default/locale
echo 'America/Sao_Paulo' > /etc/timezone
locale-gen pt_BR.UTF-8
dpkg-reconfigure -f non-interactive tzdata
## All this inside chroot!
Step 8 : Upgrade the new install. Install your local "language-pack-en-base".
apt-get update
apt-get install language-pack-en-base
apt-get upgrade
If you are using Software RAID and/or LVM, you should install these packages before installing a kernel:
apt-get install mdadm lvm2
Step 9 :Install Grub and Linux Kernel.
apt-get install grub-pc linux-image
Step 10 : Add user and/or set root password.
To add a user and set a password for that user.
adduser <username>
You may also want to add your user to the sudo group so that user can run programs as root.
gpasswd -a <username> sudo
To set a root password:
(NOTE: You must at least set a root password if you aren't adding a user)
passwd
Step 11 : Create fstab. A simple example of fstab is
echo "/dev/sda1 / ext4 errors=remount-ro 0 1" >> /etc/fstab
## Inside chroot!
It should now be safe to reboot; you may want the next few things.
Step 12 :If you want to access it with ssh after reboot.
Use vi or install nano to edit /etc/hostname.
Remove any text in this file and add the hostname you would like.
vi /etc/hostname
edit /etc/network/interfaces
vi /etc/network/interfaces
Add these lines to /etc/network/interfaces. This will start eth0 at boot and request an IPv4 address with dhclient.
auto eth0
iface eth0 inet dhcp
Next you need to install ssh
apt-get install openssh-server
Your computer should be safe to reboot now. If you want the Ubuntu Gnome desktop, continue with Step 13
Step 13 : Install ubuntu-desktop.
apt-get install ubuntu-desktop ubuntu-standard
ToDo:
mkswap /dev/sdbXy
? edit /etc/hosts
? edit default language
? edit /etc/environment
? edit autologin
? edit /etc/lightdm/lightdm.conf
Step 14 : Reboot and keep those fingers crossed.