Install debian in ubuntu

If you’re using Ubuntu and want to try Debian or run it alongside your current system, there are several ways you can install Debian in Ubuntu. This guide will walk you through methods to install Debian either as a dual boot system or within a virtual environment. Let’s explore the different options available.

Why Install Debian on Ubuntu?

Debian and Ubuntu share many similarities, as Ubuntu is derived from Debian. However, Debian is known for its stability and is often used as a base for many other distributions. Installing Debian on an Ubuntu system might be a good choice if you want:

  • Stability: Debian is well-known for its stability and long-term support, making it a great choice for servers or reliable work environments.
  • Learning Experience: Debian gives you more control over your system and a more minimalist approach than Ubuntu.
  • Dual-Boot Setup: If you need both Ubuntu and Debian on the same machine for different purposes, dual booting might be a suitable solution.

Method 1: Dual Boot Ubuntu and Debian

Setting up a dual-boot system with Ubuntu and Debian is relatively simple, and it allows you to choose between the two operating systems when you start your computer.

Step 1: Backup Your Data

Before proceeding, ensure you back up all important files to avoid any loss of data during installation.

Step 2: Create a Partition for Debian

To install Debian alongside Ubuntu, you need to create a new partition for Debian. You can use the Ubuntu Disk Utility tool or GParted to shrink your current partition and create space for Debian.

Step 3: Download Debian ISO

Download the latest stable version of Debian from the official website: Debian Downloads.

Step 4: Create a Bootable USB Drive

Use a tool like Etcher or Rufus (for Windows) to create a bootable USB drive from the Debian ISO.

Step 5: Boot from the USB Drive

Insert the USB drive and reboot your system. Enter the boot menu (usually by pressing F12 or Esc) and select the USB drive to boot from.

Step 6: Install Debian

Once Debian boots up, follow the on-screen instructions to install Debian on the partition you created earlier. During installation, make sure to select the partition that you prepared for Debian.

Step 7: Configure GRUB

After installing Debian, the system will detect both Ubuntu and Debian installations. The GRUB bootloader will allow you to select the OS to boot into. Make sure to install GRUB when prompted.

Step 8: Reboot and Choose Your OS

After the installation finishes, reboot your computer. You should now see the GRUB menu, which lets you choose between Ubuntu and Debian.

Method 2: Install Debian Using VirtualBox

If you prefer not to dual-boot, you can run Debian inside a virtual machine using VirtualBox. This is a great way to test Debian without affecting your current Ubuntu installation.

Step 1: Install VirtualBox

If you don’t already have VirtualBox installed, you can install it using the following commands:

sudo apt update
sudo apt install virtualbox

Step 2: Download Debian ISO

As in the dual-boot method, download the latest stable Debian ISO from the official website.

Step 3: Create a New Virtual Machine

Open VirtualBox and create a new virtual machine. Select “Linux” and then “Debian” as the operating system. Assign memory and disk space based on your system’s resources and the needs of Debian.

Step 4: Install Debian in the Virtual Machine

Start the virtual machine and choose the Debian ISO as the boot disk. Follow the instructions in the Debian installer to install Debian on the virtual machine.

Step 5: Use Debian on Ubuntu

Once installed, you can use Debian within the virtual machine running on Ubuntu. This method allows you to switch between Ubuntu and Debian without rebooting your system.

Method 3: Use Docker to Run Debian Containers

For advanced users, another way to run Debian on Ubuntu is by using Docker to create a Debian-based container. This is a lightweight option and ideal for testing or running specific applications.

Step 1: Install Docker

If you don’t have Docker installed, you can install it by running the following commands:

sudo apt update
sudo apt install docker.io

Step 2: Pull the Debian Image

Once Docker is installed, you can pull the official Debian image from the Docker Hub:

sudo docker pull debian

Step 3: Run the Debian Container

After pulling the Debian image, you can run a container with the following command:

sudo docker run -it debian

Step 4: Interact with Debian

You can now interact with a running Debian system inside the Docker container. You can install packages, run applications, and explore Debian without affecting your main system.

Conclusion

Installing Debian on an Ubuntu system can be done in several ways, depending on your needs and preferences. Whether you choose to dual boot, use a virtual machine, or run a Docker container, each method allows you to experience Debian without having to give up your Ubuntu system. These methods give you the flexibility to explore both operating systems in parallel.