↑ ↓ select, Enter open, Esc close

Debian and APT

Package management on Debian and Ubuntu: install, upgrade, hold versions, repair broken dependencies and find out which package ships which file.

17 one-liners: 12 harmless, 5 caution, 0 destructive

All Debian and APT one-liners

Check whether a reboot is required after updates

$if [ -f /var/run/reboot-required ]; then cat /var/run/reboot-required.pkgs; else echo "Kein Neustart vermerkt"; fi
harmless

Compare installed and available package versions

$apt-cache policy nginx
harmless

Delete downloaded package files from the apt cache

#du -sh /var/cache/apt/archives && apt clean
caution

Find modified package configuration files

#debsums -ce
harmless

Find services using outdated libraries after updates

#needrestart -r l
harmless

Find the package that provides a file not yet installed

$apt-file search bin/mysqldump
harmless

For the websites on your server

Free SEO and PageSpeed check

GENLOC.SEO analyzes any domain for load time, Core Web Vitals and on-page issues and tells you in plain words what is going on. Available in 11 languages.

by GENLOC.NETWORK, the team behind myline.de

Find which installed package a file belongs to

$dpkg -S /usr/bin/curl
harmless

Fix an interrupted installation and broken dependencies

#dpkg --configure -a && apt --fix-broken install
caution

Hold a package at its current version (apt-mark hold)

#apt-mark hold mariadb-server
caution

List installed packages sorted by size

$dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -rn | head -n 20
harmless

Release a held package for updates again

#apt-mark unhold mariadb-server
caution

Remove unused dependencies (apt autoremove)

#apt autoremove
caution

Show available package updates

#apt update && apt list --upgradable
harmless

Show only pending security updates

$apt list --upgradable 2>/dev/null | grep -- -security
harmless

Show the changelog of a package

$apt changelog openssl
harmless

Show the Debian or Ubuntu version of a server

$cat /etc/debian_version && grep -E '^(PRETTY_NAME|VERSION_CODENAME)=' /etc/os-release
harmless

Test automatic updates (unattended-upgrades) with a dry run

#unattended-upgrade --dry-run -d
harmless

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.