Is there a program to install Ubuntu from a Linux system?

I need to upgrade my very old SUSE Linux and I want to switch from SUSE to Ubuntu.

I was in the process of finding out how to create a bootable USB stick, when I realized that the oldest and smallest of my spare sticks has an .exe (wubi) which, if its readme is true, would allow me to install Ubuntu starting from a Windows machine.

Now I wonder if such installers exist that run on Linux too. This would be far easier than burning an ISO image, taking the risk that the target box can't boot from USB, etc.

Edit 1:

Meanwhile I found a small ISO image for Ubuntu 7 (yes, 7, not 17, no typo) that fits on my 1GB stick. I managed to burn it on the stick, using my other computer (System->Administration->USB startup disc creation) and succeeded to start the box, using this image.

It leads me to some kind of shell that has BusyBox v1.1.3 with (initramfs) as prompt. I can do pwd and even apt-get, but apt-get tells me that libapt-pkg-libc6.6-... is missing. I don't think this is supposed to happen.

The next part of the adventure is that I'm downloading an iso image of ubuntu16.04.3 (1.5GB), find the next bigger stick and try it again.

Edit 2:

Now I have downloaded what I hope is an up-to-date iso-image, cksum gives me

1089871577 1587609600 ubuntu-16.04.3-desktop-amd64.iso

After some skirmishing with the old Acer BIOS, the box tries to boot from the USB, but gives Warnings:

Missing parameter in configuration file.
Unknown keyword in configuration file.

Upon that, I see what looks like a prompt boot: that reacts to nothing but a hard reset via the power switch, except that after what seems about half an hour, the box loses patience and boots anew, with the same result.

Edit 3:

The ISO image of Ubuntu 16 can now be booted. The trick was simply to type "help" into the prompt and wait for things to happen.

One last problem remains: it only boots Ubuntu, but does not install it. What is missing?


debootstrap

Bootstrap a basic Debian system

debootstrap is used to create a Debian base system from scratch, without requiring the availability of dpkg or apt. It does this by downloading .deb files from a mirror site, and carefully unpacking them into a directory which can eventually be chrooted into.

debootstrap is not far easier than creating a bootable Ubuntu live USB or burning an Ubuntu ISO image. It is not even easier than booting from the Ubuntu Minimal CD which is a lightweight, text-only Ubuntu installer that can boot on many computers which can't boot the full-sized Ubuntu installer media. The Ubuntu Minimal CD allows you to install package groups which is very convenient, and you can also install the same package groups without using the Ubuntu Minimal CD by installing the tasksel package.


How to install Linux using debootstrap

Install debootstrap

If you are installing from a non-Debian based distribution, your distribution may or may not have debootstrap available. To get debootstrap, you can download it directly from a Debian mirror.

To view the packages available, use a web browser, or use this command:

wget --no-remove-listing -O /tmp/deboot.html -q http://ftp.us.debian.org/debian/pool/main/d/debootstrap && grep 'all.deb' /tmp/deboot.html | awk -F 'href' '{print $2}' | cut -d '"' -f2

The latest version of debootstrap is debootstrap_1.0.123_all.deb

wget -P /tmp/debootstrap http://ftp.us.debian.org/debian/pool/main/d/debootstrap/debootstrap_1.0.123_all.deb

Unpacking the .deb file

cd /tmp/debootstrap  
ar vx debootstrap_1.0.123_all.deb  
tar -xf data.tar.gz 

Temporary setup

sudo ln -s /tmp/debootstrap/usr/sbin/debootstrap /usr/sbin/debootstrap  
sudo ln -s /tmp/debootstrap/usr/share/debootstrap /usr/share/debootstrap

Setup the target partition for install

Create your filesystem, your mount point, and mount your partition:

sudo mkfs.ext4 -L Debian /dev/sda1  
sudo mkdir /mnt/deboot  
sudo mount -t ext4 /dev/sda1 /mnt/deboot  

Installing the base system with network access

sudo debootstrap --arch amd64 focal /mnt/deboot http://archive.ubuntu.com/ubuntu

Preparing the chroot environment

Copy the mounted file systems table. It keeps the df command happy. (It will be overwritten upon boot.)

sudo cp /etc/mtab /mnt/deboot/etc/mtab

Binding the virtual filesystems. Until your new install is booting on it's own, we'll borrow these from the host.

sudo mount -o bind /dev /mnt/deboot/dev  
sudo mount -o bind /proc /mnt/deboot/proc  
sudo mount -o bind /sys /mnt/deboot/sys  

Continuing the installation within chroot

Entering the chroot environment:

sudo chroot /mnt/deboot /bin/bash

Since we used the --include option to get grub, it was installed, but not configured.

sudo grub-install /dev/sda    
sudo update-grub  

Setting up /etc/fstab for the root filesystem. Use the blkid command to get the UUID of /dev/sda1.

sudo blkid /dev/sda1

Then add this entry to /etc/fstab using the UUID output from the command above:

sudo UUID=79168060-9d9c-4cf6-8ee9-bb846aee589b / ext4 defaults,errors=remount-ro 0 1

Give your new install a name. If not, your new install won't have a name, or inherit the name of the host you are installing from.

sudo echo "<name-your-host>" > /etc/hostname

Configure your locale.

sudo dpkg-reconfigure locales

Create a password for root.

sudo chroot# passwd

Create a normal user.

sudo adduser <your-user-name>

Setting up the network (eth0)

Some basic tools are already included to manage your network, but nothing is configured for you yet. If you plan on installing a desktop environment, that may bring in tools such as network-manager or wicd to automatically configure your network.

You can bring up your network manually each boot with the tools dhclient or ifconfig.

For a dynamic IP (DHCP):

sudo dhclient -v eth0

For a static IP:

sudo ifconfig -v eth0 192.0.2.7 netmask 255.255.255.0 up

You can have this automatically done for you when the system boots by editing the file below.

For DHCP, the /etc/network/interfaces file should look like this:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp

For a static IP, the /etc/network/interfaces file should look like this:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
   address 192.0.2.7
   netmask 255.255.255.0
   gateway 192.0.2.254

Install a display manager and a window manager

Unless you're using this for a headless server, might be nice to have some sort of desktop to play with. Don't forget to update the package manager if you wish to install new packages:

sudo apt-get update

Here are some examples of installing a desktop:

sudo apt install xserver-xorg wdm fluxbox xterm # -or -  
sudo apt install xserver-xorg lightdm xfce4 # -or -  
sudo apt install gdm3 gnome # -or -  
sudo apt install kdm kde-standard  

You can use also use tasksel to install a desktop for you. To see the available options:

sudo tasksel --new-install

Finishing the install

Clean the package cache:

sudo apt-get clean

Update the ramdisk:

sudo update-initramfs -u -k all

Exit the chroot environment:

sudo exit

Source: How to install to install Linux using debootstrap