Introduction
Linux distributions differ from each other in many ways, but one of the most significant differences lies in package management and the update model.
Red Hat-based distributions (such as RHEL, CentOS, and Fedora) primarily use RPM packages and Yum/DNF package management. They are often aimed at enterprise use, emphasizing stability, long-term support (LTS), and commercial support. Red Hat distributions are updated regularly, but the latest features arrive more slowly because stability is prioritized.
Debian-based distributions (such as Debian itself and Ubuntu) use DEB packages and APT package management. Debian is known for its stability and wide software support. Updates can be slower in the “Stable” version, but users can also use “Testing” or “Unstable” versions to access newer packages.
In summary, Red Hat derivatives focus on stability and support suitable for enterprise use, while Debian offers a wide range of software and flexibility, especially in open-source environments.
Navigation and File System
In the terminal, you can navigate using the following commands:
Change directory:
cd <directory>
Move one level up:
cd ..
List files:
ls
Creating and Deleting Files and Folders
Create a file using a text editor:
nano <file> tai vim <file>
Create a file using a command:
echo "text" > <file>
Create a folder:
mkdir <folder_name>
Delete a file:
rm <file>
Delete a folder and its contents:
rm -R <folder>
Installing Packages
Debian/Ubuntu
Install:
sudo apt-get install <package>
Remove:
sudo apt-get purge <package>
CentOS/Fedora (<22):
Install:
sudo yum install <package>
Remove:
sudo yum remove <package>
Other Useful Commands
Clear the terminal:
clear
View a file’s contents:
cat <file>
Run a command as an administrator:
sudo <command>
Check the location of a program:
which <program>
Changing Name Servers
If name servers are not working (e.g., error ping: google.com: Temporary failure in name resolution
), you can change them in the file:
/etc/resolv.conf
Add a line in the format:
nameserver <server_IP>
We recommend using one of the following name servers:
google OpenDNS Cloudflare
8.8.8.8 208.67.222.222 1.1.1.1
8.8.4.4 208.67.220.220 1.0.0.1
Updating the Source List (sources.list)
The source list is the file:
/etc/apt/sources.list
APT package manager uses this list to download and update software.
If the source list is broken or outdated:
-
Go to an online source list generator for Ubuntu or Debian (e.g., Repogen
- Select your system details
-
Copy the generated list and replace the contents of
/etc/apt/sources.list
Updates
Red Hat-based distributions
Updates are usually done from the command line as follows:
Fedora / newer RHEL:
sudo dnf update
Older RHEL / CentOS:
sudo yum update
Debian-based distributions
On Debian and Ubuntu systems, use APT:
Update package repository information:
sudo apt update
Upgrade all installed packages to the latest version:
sudo apt upgrade
Debian also has dist-upgrade
or full-upgrade
commands, which can handle dependency changes when new package versions are installed.
For Security
It’s a good idea to follow these instructions: SSH key usage and disabling root login.
Connecting to a Remote Desktop
Editing the Welcome Message in the Terminal
You can edit the message that appears after SSH login as follows:
sudo nano /etc/motd
Write your desired message — in this case, add a cool “Tietokettu” pixel art.
Save (Ctrl+O
, Enter, Ctrl+X
)
Log in again and check the result.
This is how you set a custom welcome message.