Skip to content

How to install and configure Debian

Make a bootable stick

Download Debian and make a bootable stick with it.
You can use Balena Etcher (on Linux or MacOS) or Rufus on Windows. Or any other software you prefer. It's your choice.

Installation

After booting, select the following options:

  • Graphical Install
  • Language: English (this is the installer language)
  • Your location: Romania or Spain
  • Configure Locales: United States - en_US.UTF-8 (Yes — even though your country is Romania/Spain)
  • Keyboard Layout: American English
  • Hostname: whatever you want
  • Domain name: whatever you want or leave blank
  • Set strong password for the usernames
  • Partition disks: Guided - use entire disk
  • Partition disks: All files in one partition
  • Software selection:
    • check SSH server
    • check standard system utilities
    • uncheck everything else

Connect via SSH

After installing Debian, you can connect via SSH:

ssh dan@192.168.100.??
Also, you can remove

  • the mouse USB stick
  • the keyboard USB stick
  • the boot stick

Switch to root

su -

Fix the annoying "Media change" error

When you try to install anything via apt-get (from root or via sudo), you'll probably get an annoying error saying “Media change: please insert the disc labeled ...”.

Tip

If you don't have this problem, just skip this next step!

In short, the problem is that Debian tries to use the device's CD-ROM as the main source when trying to install anything (including via apt install). This is probably for historical reasons.

Anyway, follow the steps described here to get rid of it.
Basically you just have to open /etc/apt/sources.list and comment the line with cdrom (probably the first or second).

While in root, write:

nano /etc/apt/sources.list

Install sudo

By default, sudo won't work on a clean Debian install. (I know, I was shocked, too).
So you'll need to switch to the root user and "install" sudo.

To "install" it, follow the steps described here.

Basically, you have to do the following:

su -
apt-get install sudo -y
usermod -aG sudo dan
visudo
## make sure the following lines exist:
## Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

That's it!
Now switch back to the main user and see if sudo works.

su dan
cd ~
sudo whoami

Install timeshift (optional)

sudo apt update
sudo apt upgrade
sudo apt install timeshift -y
sudo timeshift --create --comment "clean install"
sudo timeshift --list ## make sure it was created

Configure locales

Update your locale settings: Ensure your system is using the correct locales by editing the /etc/default/locale file.

sudo nano /etc/default/locale

Add or modify the following lines:

LANG=en_US.UTF-8
LC_TIME=en_GB.UTF-8
LC_MONETARY=en_US.UTF-8

Make sure the locales are now ok by running:

locale

Optional installations and configurations

Install some utilities

sudo apt-get install curl ffmpeg -y

Install tuptime

Just for statistical purposes, you can install the tuptime utility.

You can install it via apt:

sudo apt -y install tuptime

Update alias

alias update='sudo apt-get update && sudo apt-get upgrade -y && echo "System updates were installed at $(date)" >> $HOME/system_updates.log'