Debian sysadmin - fordsfords/fordsfords.github.io GitHub Wiki

Debian-Specific Features Reference Guide

Many thanks to Claude.ai (and Anthropic) for generating this nice write-up.

For BSD/SunOS Veterans Transitioning to Debian Linux

This guide covers distinctive Debian (and derivative) features that differ from traditional BSD Unix systems.


Package Management

APT (Advanced Package Tool) Debian's high-level package management system. Unlike BSD's pkg_add, APT handles dependencies automatically and uses repositories.

  • apt-get install package - Install software
  • apt-get update - Refresh repository metadata
  • apt-get upgrade - Upgrade installed packages
  • apt search keyword - Search for packages
  • Modern replacement: apt command (cleaner interface)

dpkg (Debian Package) Low-level package manager (analogous to BSD pkg_add but more sophisticated).

  • dpkg -i package.deb - Install a .deb file
  • dpkg -l - List installed packages
  • dpkg -L package - List files in a package
  • dpkg -S /path/to/file - Find which package owns a file

Package Format .deb files are Debian's binary package format. Source packages use .dsc, .orig.tar.gz, and .debian.tar.gz files.


Alternatives System

update-alternatives Manages symbolic links for multiple versions of commands (e.g., multiple Java installations). No BSD equivalent—you manually managed symlinks in /usr/local.

  • update-alternatives --config java - Choose default Java
  • update-alternatives --display java - Show current selection
  • update-alternatives --list java - List available alternatives
  • Requires sudo to change system-wide defaults
  • Users can override via PATH and JAVA_HOME environment variables

Init System

systemd Replaced traditional SysV init (and BSD's /etc/rc.d). Parallel service startup, dependency management, logging integration. Controversial but now standard.

Key differences from BSD init:

  • Services are "units" defined by .service files in /etc/systemd/system/ or /lib/systemd/system/
  • No more /etc/init.d/ scripts (though compatibility layer exists)
  • Binary logs via journald (use journalctl instead of reading /var/log/messages)

Essential commands:

  • systemctl start service - Start a service
  • systemctl stop service - Stop a service
  • systemctl enable service - Start at boot
  • systemctl status service - Check service status
  • systemctl list-units - List all units
  • journalctl -u service - View service logs
  • journalctl -f - Follow system logs (like tail -f)

Directory Structure Differences

Configuration Files

  • /etc/apt/ - APT configuration and repository lists
  • /etc/systemd/ - systemd unit overrides
  • /etc/default/ - Default configuration for services (similar purpose to /etc/rc.conf)
  • /etc/network/interfaces - Network configuration (traditional, now often replaced by NetworkManager)

Binary Locations

  • /usr/bin/ - User commands (merged with /bin in recent Debian)
  • /usr/sbin/ - System administration commands (merged with /sbin)
  • /usr/local/ - Still for locally-installed software not from packages
  • /opt/ - Optional/add-on application software packages

Library and Documentation

  • /usr/share/doc/package/ - Package documentation
  • /usr/lib/ - Libraries
  • /var/lib/ - Variable state information for packages

User and Permission Management

sudo Replaced direct root login for most operations. Not installed by default on pure Debian (is on Ubuntu).

  • Configure via /etc/sudoers (edit with visudo)
  • User-specific configs in /etc/sudoers.d/
  • No more direct editing of system files as root by default

adduser/deluser Debian-specific high-level user management commands (wrappers around useradd/userdel).

  • adduser username - Interactive user creation
  • adduser username groupname - Add user to group
  • deluser username - Remove user
  • More user-friendly than low-level useradd/userdel

Network Management

NetworkManager GUI and CLI tool for network configuration. Replaced traditional /etc/network/interfaces for many use cases (especially desktops).

  • nmcli - Command-line interface
  • nmtui - Text UI interface
  • Configuration stored in /etc/NetworkManager/

Traditional Method Still works on servers: /etc/network/interfaces for static configuration.

DNS Configuration

  • /etc/resolv.conf - Often a symlink managed by systemd-resolved or NetworkManager
  • /etc/hosts - Still works as expected

Logging

journald (systemd-journald) Replaced traditional syslog. Binary logs instead of text files.

  • journalctl - View all logs
  • journalctl -u service - Logs for specific service
  • journalctl -b - Logs since last boot
  • journalctl -f - Follow logs in real-time
  • journalctl --since "1 hour ago" - Time-based filtering

Traditional syslog still available via rsyslog package for compatibility.


Kernel and Boot

GRUB2 Default bootloader. Configuration in /etc/default/grub, generated configs in /boot/grub/.

  • update-grub - Regenerate GRUB configuration after changes
  • More complex than old GRUB or BSD's boot loaders

Kernel Management

  • Kernels installed as packages via APT
  • Multiple kernel versions can coexist
  • /boot/ contains kernel images and initramfs
  • uname -r - Show running kernel version

Debian-Specific Concepts

debian/control Package metadata file in source packages. Defines dependencies, descriptions, maintainer info.

debian/changelog Required file documenting all changes to a package. Defines version numbers.

debian/rules Makefile for building packages. Uses debhelper tools.

Debian Policy Comprehensive standards document defining how packages should be structured and behave. More rigid than BSD's looser conventions.

Release Cycle

  • Stable (current: Bookworm/12) - Rock-solid, older packages
  • Testing (current: Trixie/13) - Packages being prepared for next stable
  • Unstable (always "Sid") - Latest packages, may break
  • Derivatives like Ubuntu add their own cycle on top

Security and Updates

unattended-upgrades Automatic security update installation. Can be configured for automatic reboots.

  • Configuration in /etc/apt/apt.conf.d/50unattended-upgrades

Security Updates Separate security repository with rapid updates for vulnerabilities.

  • Critical patches released independently of regular release cycle

AppArmor Mandatory Access Control system (alternative to SELinux). Enabled by default in recent Debian/Ubuntu.

  • Profiles in /etc/apparmor.d/
  • aa-status - Check AppArmor status

Package Building

debuild/dpkg-buildpackage Tools for building .deb packages from source.

  • Much more structured than BSD's make package

pbuilder/cowbuilder Clean-room package building environments. Ensures packages build with only declared dependencies.


Multiarch Support

Multiarch Allows multiple architectures on same system (e.g., amd64 and i386).

  • dpkg --add-architecture i386 - Enable 32-bit packages on 64-bit system
  • Package names include architecture: libc6:amd64

Time Management

timedatectl Part of systemd. Replaces traditional date/ntpd commands.

  • timedatectl status - Show current time settings
  • timedatectl set-timezone America/New_York - Set timezone
  • timedatectl set-ntp true - Enable NTP

Process Management Additions

systemd-cgls View process hierarchy in cgroups (control groups). More detailed than traditional ps trees.

systemd-analyze Analyze boot time and service dependencies.

  • systemd-analyze blame - Show service startup times

Key Philosophy Differences

The Debian Social Contract Formal commitment to free software and users. Influences package availability and licensing decisions.

Debian Free Software Guidelines (DFSG) Defines what software can be in main repository. Stricter than BSD's licensing approach.

Maintainer-Centric Each package has a designated maintainer. Changes go through maintainer or via NMU (Non-Maintainer Upload) with specific rules.


Quick Command Translations

BSD/SunOS Debian
pkg_add apt-get install
pkg_info dpkg -l
/etc/rc.conf /etc/default/*
/etc/rc.d/* systemctl
tail -f /var/log/messages journalctl -f
halt systemctl poweroff
reboot systemctl reboot

Resources


This is a living document based on Debian 12 (Bookworm) and modern practices. Some items apply to Ubuntu and other Debian derivatives with minor variations.