Skip to content

Instantly share code, notes, and snippets.

@navin-mohan
Last active April 22, 2017 15:16
Show Gist options
  • Save navin-mohan/be28df52c85eee255bc963be9b1ffb3c to your computer and use it in GitHub Desktop.
Save navin-mohan/be28df52c85eee255bc963be9b1ffb3c to your computer and use it in GitHub Desktop.
installing and setting up debian

Installing and Setting Up Debian

A quick guide on installing and setting up debian.

Getting Debian

You can download the Debian ISO image from the official debian website. It's available for download over HTTP, FTP and BitTorrent. The 64-bit CD version should work on most systems, get the DVD image if you need more packages preinstalled.

Installing Debian

In a Virtual Machine

To install Debian on a VM, create a new VM and choose the downloaded Debian ISO file as the start-up disk. The VM should boot up with the installation screen.

On an Actual Machine

To install Debian on an Actual Machine, you can either write the ISO image into a CD/DVD or create a bootable USB drive and then boot from it.

Creating a Bootable USB
  • If you're on Windows Use a utility like Rufus to create the bootable USB drive. The procedure is pretty straight forward.

  • If you're on Linux The easiest way is to use the dd command although there are some GUI tools out there.

    $ sudo dd if="/path/to/debian/iso" of="/dev/your-usb-device" bs=2M status=progress
    

    Note: only use the device name and omit the partition number (eg. for /dev/sdb2 use /dev/sdb)

    If you're looking for GUI tools here are a few

  • If you're on a Mac Use Unetbootin utility.

Once your installation media is ready, reboot the machine and plug in the USB. Choose the boot device as your installation media from the BIOS options. You will get the installation screen.

Choose Graphical install and move through the options. Setup your hostname, root password and user. Select the disk partitions on which you wish to install Debian. It'll take serveral minutes for the installation to complete.

Follow this guide for detailed steps.

Setting Up Debian

After the installation the system should boot into debian and you'll be greeted by the login screen. Now login as root with the your root password.

Configuring APT

We need to configure the APT package manager to enable us to install new packages.

Change to the apt directory

$ cd /etc/apt/

Create a backup copy of the existing source list

$ cp sources.list sources.list.bak

Generate a new source list from here and replace the contents of sources.list with it.

Update the package list.

$ apt-get update

And that's it.

Set Up Sudo

Working as the root user is not a good idea so let's set up sudo which enables selected users to run commands with root privillage.

Firstly install the sudo package using APT

$ apt-get -y install sudo

Now add your username to the sudoers list using the following command.

$ adduser username sudo

Now you can logout and log back in as a regular user.

Find more info on this Debian wiki page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment