Progress pill
From click to terminal: mastering Linux

Getting started with Ubuntu: everything you need to know

Improve Your Personal Digital Security

Getting started with Ubuntu: everything you need to know

  • Installing the Ubuntu distribution
  • Initial system configuration
  • First steps on the command line
  • Package management: APT, Snap and Flatpak
  • Maintenance and updates
  • Firewall and network hardening
  • Internet connection and network management
  • Installing essential applications
Today, Ubuntu is one of the most accessible gateways to GNU/Linux: a polished GNOME environment, extensive repositories, responsive security updates and a large community. That's why I've chosen to present this distribution.
However, mastering your desktop installation requires an understanding of the fundamental mechanisms of the system: package management, command line, basic security, and daily best practices. In this chapter, I'll take you step by step, from initial configuration to the installation of productivity and development tools, to ensure you have a complete, secure, and efficient desktop.

Installing the Ubuntu distribution

Before you can use Ubuntu, you need to install it on your machine. This step may seem daunting if you've never done it before, but these days it's very easy to do.
Several scenarios are possible, depending on the state of your current computer:
  • If you have a computer with Windows pre-installed, you can either install Ubuntu alongside Windows ("dual boot"), or replace your current system entirely If you opt for dual boot, you can select which operating system to launch at each boot. This is the solution of choice if you simply want to test Ubuntu while retaining access to Windows
  • If you have a new machine without an operating system, you can install Ubuntu directly as the main system
In all cases, the installation process follows the same technical principles, which we're about to discover.

Download Ubuntu

The Ubuntu installation file comes in the form of an ISO image, a file containing everything you need to boot and install the system. To get it, go to the official website.
There are 2 versions of Ubuntu Desktop:
  • LTS (Long Term Support)
  • Latest version
The main difference between an LTS version and a non-LTS version of Ubuntu is the duration of support and stability. An LTS version is supported for 5 years. Conversely, a non-LTS version is only supported for 9 months, so you need to upgrade your system regularly. On the other hand, the latest non-LTS version includes all new features. I recommend the LTS version if you're just starting out, as it's more stable and requires fewer major updates. However, you can opt for the latest non-LTS version if you wish: it will have no impact on the rest of the program.
Simply click on the "Download" button to download the Ubuntu ISO image.

Create a bootable USB key

To install Ubuntu on your computer, you need to make the ISO image bootable from a USB key. This key will serve as installation media.
Plug in a USB flash drive of at least 8 GB (beware, its contents will be erased), then use a tool like BalenaEtcher to create bootable media from the ISO image. Simply select the ISO file, the USB key, and click on "Flash".

Boot from USB key

You now need to boot your computer not from the hard disk, but from the USB key. Restart your machine and access the boot menu or BIOS/UEFI. This is usually done by pressing a key just after booting your computer (often F2, F10, F12, DEL, ESC). Check how to access this menu on your machine.
In the boot menu, select the USB key (it may appear under the key manufacturer's name or as "USB"). Then select "Try or Install Ubuntu". The computer will then boot into Ubuntu in "live" mode: this lets you test the system without modifying anything, or launch the installer directly.

Initial settings

The installer will suggest:
  • choose your language and time zone
  • connect to a Wi-Fi network
  • choose the type of installation (default or extended) depending on whether you want a minimal system or one with many pre-installed applications
  • whether or not to install third-party software (graphics drivers, codecs, etc.)

Choose an installation type

Once you've launched Ubuntu, the installation wizard guides you step by step. Follow each step and choose the options that suit you best. The most important step concerns the type of installation. Depending on your situation, there are three possible cases:
  • Installation alongside Windows (dual boot)
If your computer already contains Windows, Ubuntu will automatically detect this installation and suggest a dual-boot setup for the 2 operating systems:
  • The installer will reduce the Windows partition to free up space
  • Ubuntu will be installed in this free space, with its own partitions
  • A boot manager (GRUB) will be installed, allowing you to choose between Windows and Ubuntu each time the computer boots
Choose this option if you want to keep Windows for certain software applications (e.g. video games) while discovering Linux.
To do this properly, I recommend that you first create an unallocated partition on the disk of your choice in Windows, then manually select this partition when installing Ubuntu. To do this, open the Disk Manager in Windows, right-click on the disk in question and select "Reduce Volume". Then specify the size you wish to reserve for Ubuntu (I recommend a minimum of 80 GB for comfortable use).
  • Complete replacement of Windows
If you want to use Ubuntu only, you can choose to erase the disk completely:
  • This option deletes all existing data, including Windows
  • Ubuntu will then become the only system installed on the machine
Choose this option only if you wish to switch 100% to GNU/Linux. Remember to back up your Windows data before deleting it completely.
  • Installation on a blank computer
If your machine contains no system at all, or if you've wiped the disk beforehand, installation proceeds as in the previous case. Ubuntu will install itself as the main system and automatically configure the necessary partitions.
You will then be asked to set up a user account (name, password, machine name). Choose a strong password: it will enable you to log on to the system, install software or change important settings
For more information on the Ubuntu installer, you can also consult this tutorial:
Once installation is complete, remove the USB key when prompted, then reboot. Ubuntu will now be installed and ready to use on your machine.
Congratulations, you now have a complete GNU/Linux system!

Initial system configuration

As soon as the installation wizard has finished, log in with the new user and open a terminal:
Ctrl+Alt+T

Update

ISO images contain frozen packages several weeks before release, so always synchronize indexes and apply patches first:
sudo apt update && sudo apt full-upgrade sudo apt autoremove --purge
The first command updates the local list of packages, downloads new versions and installs them; the second cleans up any dependencies no longer required.
→ The sudo command executes an action with administrator rights and asks for your password to confirm.
You can then restart your computer:
sudo reboot

Software repositories and channels: understanding where software comes from

Under Ubuntu, software is installed and updated via a system of official repositories. A repository is a server containing thousands of software packages (programs, libraries, drivers...), all organized according to precise rules. These packages are verified, signed and distributed automatically via the apt package manager.
Each repository is divided into sections. By default, Ubuntu activates four main sections:
  • main: free software officially maintained by Canonical. Examples: Firefox, LibreOffice, bash
  • restricted: non-free software that is essential for the hardware to function properly. Examples: NVIDIA drivers, Wi-Fi firmware, proprietary codecs
  • universe: free software maintained by the community. Examples: GIMP, Inkscape, Audacity
  • multiverse: software subject to legal restrictions (patents, non-free licenses). Availability may vary by country. Examples: certain audio/video codecs, Steam
Each component can then be broken down into several channels or branches: release, security, updates, backports, etc., corresponding to the nature of the updates.

First steps on the command line

The graphical interface makes using Ubuntu intuitive, but for certain administration tasks, the terminal remains the most efficient and powerful tool. Under Ubuntu, the default shell is Bash (Bourne Again SHell), a free shell from the Unix tradition.
Using the terminal allows you to manipulate files directly, configure the system precisely, manage packages, automate tasks or diagnose problems. Here's a selection of the essential commands you'll need to get started.
  • Show current directory:
pwd
This command displays the absolute path of the directory you're currently in. Very useful if you want to keep track of your location in the directory tree.
  • List the contents of a directory
ls -lah
This command lists the files and directories in the current directory in a detailed format:
  • -l: "long" mode, which displays permissions, size, user, date...
  • -a: also displays hidden files (those beginning with a dot).
  • -h: "human-readable", displays sizes in readable format (KB, MB...).
Variant:
lsblk
Displays the tree structure of disks and partitions connected to your system. This is very useful for identifying a USB drive, for example.
  • Change directory:
cd /path/to/directory
cd stands for "change directory". This allows you to move around the file tree. For example, with the command cd Music, you will be in the /Music directory.
  • cd ~: returns to the home directory.
  • cd -: returns to the previous directory.
  • Create a directory
To create a new directory inside the current one, use the command:
mkdir name
Simply change "name" to the name of your new directory.
  • Copy a file:
To copy a file, use the cp command, followed by the file name (you must be in the directory where the file is located), then the path to the destination directory.
cp file.txt destination
  • Moving or renaming a file:
mv file.txt /new/directory/
The mv command allows you to move or rename a file or directory. If you specify a path to another directory after the file name, the file will be moved. If you specify a new name in the same directory, the file will be renamed.
  • Deleting a file or directory:
rm file.txt
Warning: this command does not move files to a recycle bin.
  • -r: recursive deletion (for directories).
  • -f: forces deletion without confirmation (dangerous).
To avoid errors with this command, I recommend adding a confirmation prompt by default. Simply execute in your terminal:
echo "alias rm='rm -i'" >> ~/.bashrc source ~/.bashrc
You will be asked to confirm before each deletion.
  • Clearing the terminal
To clear the terminal and start with a blank screen, type:
clear
  • Execute a command as administrator:
sudo command
The sudo keyword (superuser do) allows you to temporarily execute a command with root (system administrator) privileges. You will be asked for your password to confirm this action. Be careful: never use sudo without understanding what the command does.
Tip: to switch to a root shell (administrator session), type:
sudo -i
This opens a full terminal with root privileges. Use with caution and never for extended periods of time.
  • View command help:
man command_name
The man (manual) command opens a command's full documentation. Navigate with the arrow keys and exit with q.
Example:
man cp
For a quick summary, use:
cp --help
These initial commands are all you need to perform most basic operations in your terminal. With a little practice, you'll gain autonomy and speed.
In the following sections, we'll take a closer look at how to use the terminal to manage the system, packages, and security tools.

Package management: APT, Snap and Flatpak

On a GNU/Linux system like Ubuntu, software installation, updating and removal are centralized through package management systems. Unlike Windows, where you download .exe' or .msi' files, Ubuntu uses tools like APT, Snap or Flatpak to automate these operations, guaranteeing system consistency.

APT: Debian's native method

APT (Advanced Package Tool) is Ubuntu's main package manager. It handles packages in .deb format, from the official repositories. Each package contains software, dependencies and metadata. Let's look at some basic commands, using the GIMP image editor as an example.
To search the repositories for an available package (you must, of course, replace "gimp" with the name of the desired software):
apt search gimp
To install the package and all its dependencies:
sudo apt install gimp
Once installation is complete, you'll find the executable in Ubuntu's applications menu, located at the bottom left of the interface.
Even simpler: you can also type the name of the software directly into the terminal (in this case, "gimp") to open it.
To remove software, you can use the following command (replacing "gimp" with the name of the software you wish to uninstall):
sudo apt remove gimp
You can also add --purge to your command to delete the configuration files associated with the software:
sudo apt remove --purge gimp
To update the database of available packages (update) and install the latest versions (upgrade), you can run the following two commands:
sudo apt update sudo apt upgrade
→ APT is fast, lightweight, and very well integrated into Ubuntu. For all software available in the official repositories, this is the preferred method.

Snap: containerized packages from Canonical

Snap is a package format developed by Canonical, designed to be universal, isolated from the main system and self-contained. This means that each snap embeds its own dependencies and runs in a sandboxed environment.
This makes it possible to keep software up to date independently of the system, and works on all Linux distributions that support Snap. On the other hand, it takes longer to start up, can lead to unnecessary stacking of the same dependencies, and desktop integration is sometimes less fluid.
To search for a Snap package in the Snap Store (here for Spotify software):
snap find spotify
To install the package:
sudo snap install spotify
Once the installation is complete, you'll find the executable in Ubuntu's applications menu, located at the bottom left of the interface. Or, even simpler: you can type the name of the software directly into the terminal (in this case, "spotify") to open it.
To update all installed Snap packages:
sudo snap refresh
To delete an application:
sudo snap remove spotify
→ Snap applications are installed in the /var/snap directory and mounted as separate file systems.

Flatpak: a modular alternative

Flatpak is another universal package format, developed by the community (Red Hat, GNOME...). It aims to overcome the limitations of traditional formats, while offering better permissions management than Snap. Each application operates in a sandbox, but with finer granularity of control.
To install Flatpak and its graphical integration:
sudo apt install flatpak gnome-software-plugin-flatpak
To add the main community repository (Flathub):
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
To install an application via Flatpak, use the following command (in this example, to install the VLC software):
flatpak install flathub org.videolan.VLC
In a nutshell:
FormatOriginIsolationSizePerformancePermission Control
APT / .debDebian🟡
SnapCanonical🟡🟡
FlatpakCommunity🟡🟡

App Center: the graphical installer

Ubuntu includes an application called App Center, which serves as a graphical interface for easily searching, installing and uninstalling applications, without using command lines as we've just seen. Technically, App Center acts as an overlay to package managers. It can therefore:
  • Install .deb packages using APT
  • Install Snap packages from the Snap Store
So the App Center store is not an installation system in its own right, but an interface that brings together and unifies several software sources, with a search engine, descriptive information and beginner-friendly installation buttons.

Maintenance and updates

To ensure the stability and security of your system, Ubuntu automatically applies critical updates via a service called unattended-upgrades. This service runs in the background and installs security patches released by the distribution, without your intervention.

Check automatic service status

To make sure this mechanism is active:
sudo systemctl status unattended-upgrades
You should see an output indicating that the service is active (running).
If this is not the case, you can activate it manually:
sudo systemctl enable --now unattended-upgrades
This service protects your system against newly discovered vulnerabilities, without the need to manually check for updates every day. It's particularly useful on workstations that are not closely monitored, such as personal computers, as it guarantees a baseline of security updates.
Please note: unattended-upgrades is limited to security packages from the security repository. It therefore does not apply standard software updates, which you'll have to do manually.

Manually update the entire system

Even if critical patches are installed automatically, it's important to regularly run a full manual update to benefit from the latest versions of software and components not covered by unattended-upgrades. To do this, run the command:
sudo apt update && sudo apt full-upgrade
  • apt update synchronizes the list of available packages
  • apt full-upgrade installs new versions, even if this means modifying certain dependencies (unlike upgrade, which is more conservative)
After the update, you can clean unnecessary files with:
sudo apt autoremove --purge
This command removes obsolete packages and associated configuration files.
If you have installed software via Snap or Flatpak package managers, you can use these two commands to update them as well:
sudo snap refresh flatpak update

Restart after certain updates

Some critical updates, such as those for the Linux kernel or libc (the standard C language library used by most programs), only take effect after a reboot of your machine. To find out whether a reboot is advisable, install the needrestart tool:
sudo apt install needrestart
Then run:
sudo needrestart
This program will analyze any services or processes still running older versions of libraries or kernels, and tell you whether a reboot is required to apply the updates.
Keeping your system and software up to date is an essential reflex when it comes to computer security. Having an up-to-date Linux system is a guarantee of stability, security and performance.

Firewall and network hardening

A firewall is a security tool that controls a computer's incoming and outgoing network connections. On Ubuntu, you'll use it to filter traffic to authorize only legitimate communications and block potentially malicious ones. This prevents unsolicited external intrusions, for example, to further protect your data and your system.
As soon as you install Ubuntu, securing your machine's network communications is an important step. Ubuntu includes a standard firewall: UFW (Uncomplicated Firewall). It allows you to manage incoming and outgoing connections with fine-grained control, without having to manually write complex rules.

Activate firewall

By default, UFW is installed, but inactive. To activate it:
sudo ufw enable
Once activated, you can check its status and current rules with:
sudo ufw status verbose
By default, UFW adopts a strategy of rejecting unsolicited incoming connections while allowing outgoing traffic, which is a good security/functionality compromise for a general-purpose personal machine.

Authorize a service

If you need to make a service accessible remotely (such as an SSH server), you must explicitly authorize it:
sudo ufw allow 22/tcp comment 'SSH'
  • 22 is the default port for the SSH service
  • tcp is the protocol used
  • The comment option lets you add a readable annotation to make it easier to interpret the rules later
You can check the rule with:
sudo ufw status numbered

Define rules by IP range (local use)

It is possible to restrict access to certain services to a range of IP addresses, which can be useful in a local area network (LAN):
sudo ufw allow from 192.168.1.0/24 to any port 6881 proto tcp
This allows TCP connections on port 6881 only from the subnet 192.168.1.0/24 (typically your home Wi-Fi network).

Graphical interface: GUFW

If you're less comfortable with the terminal, there's a graphical interface called GUFW, which makes it easy to manage firewall rules with buttons, drop-down lists, and dialog boxes. To install:
sudo apt install gufw
Once installed, launch it via the applications menu. You'll be able to activate the firewall, authorize or block services and view filtered connections in real time.
Good practices: Even if you don't expose any network services to the outside world, a firewall is still useful for blocking certain types of scans or access. Also remember to disable unnecessary services and always keep your network software up to date. This hardening of the local network is a first line of defense in a broader security strategy, but we'll come back to this later in the course.

Internet connection and network management

Under Ubuntu, network management is handled by NetworkManager, a service that centralizes wired connections, Wi-Fi, VPNs, modems, etc. It works in tandem with netplan, a low-level configuration tool that defines persistent network settings in YAML files. Together, these tools ensure both simplicity for everyday use and robustness for more complex cases (servers, manual configurations, etc.).

Management via graphical interface

For most users, the graphical interface integrated into GNOME (System settings → Network/Wi-Fi) is more than sufficient. It allows you to:
  • Connect to an available Wi-Fi network
  • Manage wired connections, proxies or VPNs
  • View the current status of each network interface
This intuitive management mode covers most of the classic needs of a personal computer.

Using the terminal with nmcli

For troubleshooting or remote access, the nmcli command allows you to manipulate NetworkManager from the command line.
  • To display detected network interfaces:
nmcli device status
  • To scan nearby Wi-Fi networks
nmcli device wifi list
  • To connect to a Wi-Fi network
nmcli device wifi connect "wifi_name" password "password"

Installing essential applications

Once your basic system is up and running, the next step is to install the software you need. Ubuntu offers several installation methods (APT, Snap, Flatpak), which we have detailed above. Here, we use APT whenever possible to maintain native integration with the system.

Web browser

By default, Ubuntu includes the Snap version of Firefox. This format provides better isolation (which is good in terms of security), but results in slower launch times, higher resource consumption, and some system integration limitations (file management, themes...).
If you prefer the native .deb version, you can install it from the official Mozilla PPA:
sudo add-apt-repository ppa:mozillateam/ppa sudo apt update sudo apt install firefox
Then, to prevent the system from automatically reverting to the Snap version during updates:
sudo apt-mark hold firefox
This freezes the currently installed .deb version. It will continue to be updated, but will remain in this format.
We'll look at browsers in more detail in a later chapter, to help you choose the one best suited to your needs, and configure it optimally.

Email

Thunderbird is the leading open-source e-mail client, also developed by Mozilla. It supports IMAP/POP accounts, calendars, extensions and OpenPGP encryption.
sudo apt install thunderbird

Office suite

LibreOffice is the most complete free office suite. It offers alternatives to Word, Excel and PowerPoint, with excellent compatibility with Microsoft Office formats (.docx, .xlsx, .pptx).
sudo apt install libreoffice
If you would like a more focused installation:
sudo apt install libreoffice-writer libreoffice-calc libreoffice-impress
These three packages cover the essentials: word processing, spreadsheet and presentation.
Other alternatives also exist, such as OnlyOffice (closer to interface Microsoft Office), WPS Office (proprietary, but very fluid), or Calligra Suite (KDE project). These options can be installed via Flatpak, Snap or downloaded from their respective sites.

Multimedia

VLC is a universal media player, capable of playing most audio/video formats without additional codecs:
sudo apt install vlc
Ubuntu does not provide certain proprietary codecs (MP3, H.264...) by default, for legal reasons. The following package adds these essential elements:
sudo apt install ubuntu-restricted-extras

Graphics and design

For photo retouching and vector drawing, two open source references are available:
sudo apt install gimp inkscape
GIMP is an advanced photo-editing software, comparable to Adobe Photoshop, and Inkscape is a vector graphics software, comparable to Adobe Illustrator.
For video editing, you can install Kdenlive, which is comprehensive, intuitive and suitable for beginners and advanced users alike:
sudo apt install kdenlive
For audio editing, there's Audacity
sudo apt install audacity
For screen recording, streaming or creating live video content, there's OBS Studio
sudo apt install obs-studio

Development tools

If you are a developer, you can install a basic C/C++ development environment, Git, and other utilities with this command:
sudo apt install build-essential git curl
To install VSCode
sudo snap install code --classic
In addition to these few basic tools, I also recommend that you install essential security tools adapted to your use case, in particular a password manager and a VPN:
Finally, to conclude this chapter, here are a few best practices to follow daily:
  • Use the sudo command only when strictly necessary. This command temporarily elevates your rights to perform an action as administrator. A sudo error (e.g. a rm -rf) can affect the whole system. You should also avoid switching to root mode (sudo -i) for long sessions, unless exceptionally necessary;
  • Although Ubuntu automatically applies certain security patches via the unattended-upgrades service, this does not cover all software. You should perform a full manual update regularly:
sudo apt update && sudo apt upgrade
With this chapter on the basics of Ubuntu, you now have a functional, consistent Linux environment suitable for everyday use. You know how to install software, configure your network, keep your system up to date, and intervene via the command-line terminal.
This technical autonomy is the essential foundation to confidently approach the rest of this course. In the next section, we'll take a closer look at your workstation's security mechanisms and implement the first concrete measures to strengthen its resilience.
Quiz
Quiz1/5
Which command displays the detailed contents of a folder, including hidden files?