As with Debian, you can use debootstrap to create your base Ubuntu system. You will then have to mount both your dev and proc filesystem for your chroot environment to work properly. Follow these steps for details.

  1. Create a chroot folder
    $ mkdir chroot-ubuntu
  2. Create a base Ubuntu system using debootstrap.
    $ sudo debootstrap --variant=buildd gutsy chroot-ubuntu http://archive.ubuntu.com/ubuntu/


    Change gutsy to any Ubuntu release that you want. E.g. hardy or feisty.

  3. Mount proc and dev filesystem on to the base system.
    $ sudo mount -o bind /dev chroot-ubuntu/dev
    $ sudo mount -o bind /proc chroot-ubuntu/proc
  4. Chroot .
    $ sudo chroot chroot-ubuntu /bin/bash
  5. Unmount both dev and proc filesystem once exiting chroot.
    $ sudo umount chroot-ubuntu/dev chroot-ubuntu/proc

Guide compatibility:

Operating System
Ubuntu 16.04 LTS (Xenial Xerus)
Ubuntu 16.10 (Yakkety Yak)
Ubuntu 17.04 (Zesty Zapus)
Ubuntu 17.10 (Artful Aardvark)
Ubuntu 18.04 LTS (Bionic Beaver)
Ubuntu 18.10 (Cosmic Cuttlefish)
Ubuntu 19.04 (Disco Dingo)
Leave a comment:
Share!