Mets Minor League Blog

Music theory, instruments and musicians

Mets Minor League Blog

Music theory, instruments and musicians

10 Essential Things to Do After Installing Debian Linux

10 Essential Things to Do After Installing Debian Linux

Installing Debian is an exciting first step toward a powerful, stable Linux experience. Whether you’re a newcomer setting up your first Linux system or a seasoned user deploying a fresh Debian install, this list covers ten essential tasks to optimize, secure, and personalize your new operating system. From updating your software sources to configuring key services, these steps will help you get the most out of Debian right from the start.

1. Update and Upgrade Your System

After installing Debian, the first and most important step is to update the package list and upgrade all installed packages. Run sudo apt update followed by sudo apt upgrade to fetch the latest package information and install updates. This ensures you have all security patches and bug fixes, providing a more stable and secure system from day one.

2. Enable Non-Free Repositories

Debian by default uses only free software repositories, but many useful drivers and software require the non-free or contrib repositories. Edit your /etc/apt/sources.list to include lines like deb http://deb.debian.org/debian/ bullseye main contrib non-free. This enables access to proprietary firmware (e.g., for Wi-Fi cards), multimedia codecs, and other essential non-free packages.

3. Install Essential Build Tools

If you plan to compile software or develop on your Debian system, install the build-essential package, which includes the GCC compiler, make, and related tools. Use sudo apt install build-essential. This package is the cornerstone for compiling software from source, and many other packages depend on it during installation.

4. Set Up a Firewall with UFW

While Debian is relatively secure by default, setting up a firewall adds an extra layer of protection. UFW (Uncomplicated Firewall) is a user-friendly frontend for iptables. Install it with sudo apt install ufw, then enable it using sudo ufw enable. You can open or close ports easily (e.g., sudo ufw allow ssh) to control incoming traffic.

5. Install Multimedia Codecs and Players

Debian does not include many multimedia codecs by default due to licensing issues. To play MP3s, videos, and other proprietary formats, install packages like ffmpeg, vlc, and libavcodec-extra using sudo apt install vlc ffmpeg libavcodec-extra. This setup enables you to enjoy a wide range of audio and video files without hassle.

6. Configure Your Timezone and Locale

Ensuring your system shows the correct time and language settings is crucial for user experience and logging. Run sudo dpkg-reconfigure tzdata to select your timezone and sudo dpkg-reconfigure locales to generate and set your preferred locale. This is especially important if you work across time zones or in multiple languages.

7. Install a Graphical Desktop Environment

If you installed Debian without a desktop environment or want to switch, you can install popular DEs like GNOME, KDE Plasma, XFCE, or LXDE. For example, to install GNOME, run sudo apt install task-gnome-desktop. Choosing the right desktop environment can significantly affect system performance and usability depending on your hardware.

8. Set Up Backup Solutions

Backing up your data is critical. Debian offers several tools such as rsync, timeshift, and deja-dup for backups. Installing and configuring Timeshift (sudo apt install timeshift) allows you to create system snapshots, enabling easy recovery from errors or system failures.

9. Harden SSH Security

If you plan to remotely access your Debian machine via SSH, securing it is essential. Change the default SSH port from 22 to a custom port by editing /etc/ssh/sshd_config, disable root login by setting PermitRootLogin no, and consider using key-based authentication instead of passwords. Finally, restart SSH with sudo systemctl restart ssh to apply changes.

10. Install and Configure a Package Manager Frontend

While apt works well in the terminal, GUI frontends like Synaptic provide a graphical interface for package management. Install it with sudo apt install synaptic. This tool makes it easier for users unfamiliar with command-line package management to search, install, and manage software packages on Debian.

How to Choose

The order and priority of these tasks depend on your use case. If you need a secure server, focus first on updates, firewall, and SSH hardening. Desktop users benefit most from installing multimedia codecs, a desktop environment, and backup solutions early on. Developers should prioritize build tools and package managers. Ultimately, choose based on your hardware capabilities, security needs, and workflow preferences.

Frequently Asked Questions

Q: Is it necessary to enable non-free repositories?
Only if you need proprietary drivers or software not included in Debian’s free repositories, such as certain Wi-Fi firmware or multimedia codecs.

Q: Can I upgrade Debian directly from an old release?
Yes, but it’s recommended to read the official release notes and upgrade step-by-step between stable versions to avoid dependency issues.

Q: How do I check which Debian version I am running?
Use cat /etc/debian_version or lsb_release -a to see detailed version information.

Q: What’s the difference between apt and apt-get?
apt is a newer, user-friendly command-line tool built on top of apt-get and apt-cache, combining their functionalities with improved output formatting.

Q: How do I enable automatic security updates?
Install the unattended-upgrades package and configure it to automatically install security updates, ensuring your system stays secure without manual intervention.

Final Thoughts

Setting up Debian after installation might seem daunting, but focusing on these ten essential tasks will provide a stable, secure, and user-friendly system tailored to your needs. Whether you are building a server, workstation, or general-purpose desktop, these steps cover the foundational elements needed to get started confidently. Keep exploring Debian’s vast ecosystem, and don’t hesitate to customize further as you become more comfortable with the system.

11. Configure System Time and Timezone

Accurate system time is crucial for logging, scheduling tasks, and security mechanisms. After installing Debian, verify that your system clock and timezone are correctly set. Use the timedatectl command to check the current settings:

timedatectl status

To set your timezone, list available timezones with timedatectl list-timezones and then set the appropriate one, for example:

sudo timedatectl set-timezone Europe/London

If your system clock is off, synchronize it with an NTP server by installing and enabling the systemd-timesyncd service or using ntp:

sudo apt install systemd-timesyncd
sudo systemctl enable systemd-timesyncd
sudo systemctl start systemd-timesyncd

This ensures your system time is automatically kept accurate.

12. Set Up User Accounts and Permissions

By default, Debian creates a root account and, optionally, a primary user during installation. It’s important to manage user accounts and permissions carefully to enhance security and usability. Avoid using the root account for daily activities; instead, use sudo privileges from a regular user account.

  • adduser username – Create new users with a friendly prompt-based interface.
  • usermod -aG sudo username – Add a user to the sudo group to grant administrative privileges.
  • passwd username – Change passwords to maintain account security.

Consider setting up groups tailored to your workflow to manage access to files and resources efficiently.

13. Install Essential Build Tools and Development Packages

If you plan to develop software or compile packages from source, installing build tools like build-essential is crucial. This package installs GCC, g++, make, and other utilities:

sudo apt install build-essential

Additionally, install packages such as git for version control, curl or wget for downloading files, and pkg-config to manage compile and link flags:

sudo apt install git curl wget pkg-config

This setup enables you to compile software, manage source code repositories, and fetch dependencies efficiently.

14. Enable and Configure Swap Space

Swap space acts as an overflow area for RAM, helping maintain system stability under heavy load or when running memory-intensive applications. Debian typically creates a swap partition or swap file during installation, but it’s good to verify swap availability:

sudo swapon --show

If no swap is present or you want to create a swap file, follow these steps:

  • Create a swap file, for example 2GB:
  • sudo fallocate -l 2G /swapfile
  • Set correct permissions:
  • sudo chmod 600 /swapfile
  • Format it as swap:
  • sudo mkswap /swapfile
  • Enable swap:
  • sudo swapon /swapfile
  • Make it persistent by adding to /etc/fstab:
  • /swapfile none swap sw 0 0

This ensures your system can handle memory spikes gracefully.

15. Customize Shell Environment

Optimizing your shell environment can enhance productivity. Debian defaults to Bash, but you may want to install and configure alternatives like Zsh for powerful features and extensibility:

sudo apt install zsh

After installation, change your default shell with:

chsh -s $(which zsh)

Consider installing oh-my-zsh, a framework for managing Zsh configuration:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Customizing your prompt, enabling syntax highlighting, and adding useful plugins can make terminal sessions more efficient and visually appealing.

16. Set Up a Backup Strategy

Protecting your data is vital. Debian offers several tools for backups, from simple file copies to automated incremental backups. Start by identifying what needs backing up—documents, configuration files, databases, etc.

  • rsync: A powerful command-line utility to copy and synchronize files locally or across networks.
  • Deja Dup: A simple GUI backup tool suitable for desktop users.
  • BorgBackup: An efficient deduplicating backup program supporting encryption and compression.

Set regular cron jobs or systemd timers to automate backups, and ensure that backup data is stored on a separate device or remote location to prevent data loss.

17. Configure Firewall with UFW

While Debian includes iptables by default, the uncomplicated firewall (ufw) offers a user-friendly interface to configure firewall rules. Install and enable UFW with:

sudo apt install ufw
sudo ufw enable

Allow or deny ports as needed, for example, to allow SSH on a custom port:

sudo ufw allow 2222/tcp

Check status and rules with:

sudo ufw status verbose

Firewall configuration is essential to secure your system against unauthorized access and network threats.

18. Install Multimedia Codecs and Drivers

Debian prioritizes free software and excludes many proprietary codecs and drivers from the default install. For desktop users wanting to play various media formats, installing non-free codecs is necessary.

Enable non-free and contrib repositories in /etc/apt/sources.list by adding:

deb http://deb.debian.org/debian/ stable main contrib non-free

Update package lists:

sudo apt update

Then install common multimedia codecs and drivers:

sudo apt install firmware-linux-nonfree libavcodec-extra ffmpeg

Also, install proprietary graphics drivers if necessary, such as NVIDIA drivers:

sudo apt install nvidia-driver

This ensures a smooth multimedia experience and better hardware support.

19. Optimize System Performance

After installation, you might want to tune your Debian system for better performance. This can include:

  • Enabling CPU frequency scaling: Install and configure cpufrequtils to dynamically adjust CPU speed based on load, saving power and reducing heat.
  • Disabling unnecessary services: Use systemctl to review and disable services you don’t need, reducing resource consumption.
  • Using lightweight alternatives: For desktops, consider using lighter window managers like XFCE or LXDE instead of GNOME or KDE.
  • Configuring I/O scheduler: Set the disk I/O scheduler to deadline or noop for SSDs to improve responsiveness.

These tweaks help tailor Debian’s behavior to your hardware and use case.

20. Explore Debian Documentation and Community Resources

Debian’s extensive documentation is invaluable for troubleshooting and learning advanced techniques. Visit the official Debian Wiki (wiki.debian.org) and the Debian Reference manual for detailed guides.

Participate in community forums, mailing lists, and IRC channels to seek advice and contribute back. Subscribing to security mailing lists will keep you informed about vulnerabilities and updates.

Engaging with the Debian community not only helps solve problems but also enriches your experience and understanding of this versatile operating system.

Related

10 Essential Things to Do After Installing Debian Linux
Scroll to top