All tags
Start here · ubuntuInstall Pi-hole on Ubuntu, with the script or with Docker Compose4 steps · 4 min read · Beginners with a spare Ubuntu machineStart the guide ubuntu
Narrow down
Guides1
Shell55
- Tip
sudo apt-mark minimize-manualapt-mark minimize-manual marks metapackage dependencies as automaticLets apt autoremove clean up dependencies of metapackages that were once marked manual.3 Dec 2026 - Tip
sudo ufw app update allUfw app update --add-new loads a changed app profile into the firewallAfter you edit or create a ufw application profile, this command makes the firewall use the new version.2 Dec 2026 - Tip
echo 'network: {config: disabled}' | sudo tee /etc/cloud/cloud.cfg.d/99-disable-network-config.cfgStop cloud-init from overwriting your netplan file with one small configHand network settings back to you on images where cloud-init manages them.1 Dec 2026 - Tip
sudo nano /etc/apt/apt.conf.d/52unattended-upgrades-localunattended-upgrades can skip chosen packages with Package-BlacklistKeep automatic updates on while a few sensitive packages wait for you.1 Dec 2026 - Tip
sudo systemctl edit apt-daily-upgrade.timerPick when unattended-upgrades runs by overriding apt-daily-upgrade.timerMove the automatic upgrade run to a quiet hour of your choosing.1 Dec 2026 - Tip
sudo apt install ppa-purgeppa-purge takes an Ubuntu system back to the official packagesRemove an extra PPA and downgrade what came from it.1 Dec 2026 - Tip
grep ^Prompt /etc/update-manager/release-upgradesPrompt= decides which new Ubuntu releases you get offeredStay on long term support releases, or switch the upgrade offers off.1 Dec 2026 - Tip
sudo tee /etc/update-motd.d/60-disk >/dev/null <<'EOF'Ubuntu runs your scripts in /etc/update-motd.d at every loginAdd your own status lines to the message shown when you log in.1 Dec 2026 - Tip
sudo ufw show listeningUfw show listening matches open ports to the rules that cover themLists listening ports with their program and the ufw rule that applies.30 Nov 2026 - Tip
grep -E ' (install|upgrade|remove) ' /var/log/dpkg.log | tail/var/log/dpkg.log records every package change, even ones apt did not makeLists each install, upgrade and removal at dpkg level with versions and times.30 Nov 2026 - Tip
grep IPV6 /etc/default/ufwCheck IPV6=yes in /etc/default/ufw, or your IPv6 ports stay unfiltered by ufwMakes sure ufw writes rules for IPv6 as well as IPv4.30 Nov 2026 - Tip
sudo apt-get -d -y full-upgradeapt-get -d upgrade downloads everything first, so the real upgrade is quickFetches all upgrade packages ahead of time without installing anything.30 Nov 2026 - Tip
sudo ufw allow proto tcp from any to any port 80,443 comment 'web'Ufw allow proto tcp with port 80,443 opens several ports in one ruleCombines a list of ports and port ranges into a single firewall rule.30 Nov 2026 - Tip
sudo ufw deny out to 203.0.113.0/24Ufw deny out to an address stops the server from reaching one hostBlocks outgoing connections from the server to a chosen address or network.30 Nov 2026 - Tip
sudo apt install aideAIDE takes a fingerprint of your system files so a security check shows what changedBuilds a database of file checksums and later reports every file that changed.30 Nov 2026 - Tip
sudo apt-get -s install chrony systemd-timesyncd-A minus after a package name lets apt-get install and remove in one goSwaps one package for another in a single apt transaction.30 Nov 2026 - Tip
sudo apt-mark auto build-essential libssl-devapt-mark auto lets apt autoremove clean up packages you no longer needMarks packages as dependencies so autoremove can remove them when nothing needs them.30 Nov 2026 - Tip
sudo dpkg-reconfigure tzdatadpkg-reconfigure asks a package's apt install questions againReruns the setup questions of an installed package, like time zone or locale.30 Nov 2026 - Tip
sudo journalctl -k --since '10 min ago' | grep 'apparmor="DENIED"'Permission denied with correct permissions often means AppArmor said noFinds AppArmor denials in the kernel log when chmod and chown look right.30 Nov 2026 - Tip
ufw --force enableufw enable with the force flag skips the SSH question, so put it last in a scriptEnables the firewall without the interactive question, for setup scripts.30 Nov 2026 - Tip
sudo ufw allow 8080Ufw allow 53 without /tcp opens both TCP and UDPShows why adding the protocol to a port rule keeps the opening as small as needed.30 Nov 2026 - Tip
sudo apt-get -s autocleanapt-get autoclean keeps the cache but drops .deb files that are out of dateRemoves only cached package files that can no longer be downloaded.30 Nov 2026 - Tip
sudo apt -o Acquire::ForceIPv4=true updateAcquire::ForceIPv4 fixes apt update when it hangs on a broken IPv6 routeMakes apt download over IPv4 only when IPv6 connections stall.30 Nov 2026 - Tip
sudo apt install libpam-pwqualityPwquality.conf sets the password rules for passwd, a security baseline in one fileMakes passwd refuse short or dictionary passwords for local accounts.30 Nov 2026 - Tip
sudo install -d -m 0755 /etc/apt/keyringsSigned-By ties an apt repository to its own key instead of trusting it for everythingLimits a third party key so it can only sign its own repository.30 Nov 2026 - Tip
sudo ufw allow log 22/tcpUfw allow log writes every new connection of one rule to the logLogs connections that match one specific rule, without raising the global log level.30 Nov 2026 - Tip
sudo apt-get checkapt-get check finds broken dependencies, and apt install -f repairs themDiagnoses and fixes a package system left with unmet dependencies.30 Nov 2026 - Tip
sudo journalctl -k --since '1 hour ago' | grep 'UFW BLOCK'Read a [UFW BLOCK] line by its SRC, DPT and PROTO fieldsExplains the fields in a ufw log line so you can see what was blocked.30 Nov 2026 - Tip
sudo less /var/log/apt/term.log/var/log/apt/term.log keeps the full apt output, error messages includedShows the full terminal output of past apt runs, including install script errors.30 Nov 2026 - Tip
sudo aa-complain /usr/sbin/nginxaa-complain lets an AppArmor profile log instead of block while you test security rulesSwitches one AppArmor profile to logging mode, so you can see what it would block.30 Nov 2026 - Tip
sudo apt-get satisfy "libssl-dev (>= 3.0)" "pkg-config"apt-get satisfy installs whatever a dependency string asks forInstalls packages from a dependency line with version constraints, and can remove conflicting ones.28 Nov 2026 - Tip
sudo apt-get install --only-upgrade nginxapt-get install --only-upgrade updates one package and never installs it newUpgrades a named package only if it is already installed, and never installs it as new.28 Nov 2026 - Tip
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.Dpkg --configure -a finishes an install that was cut offFinishes the setup of packages left half installed after an interrupted apt run.27 Nov 2026 - Tip
sudo update-alternatives --config editorupdate-alternatives --config editor picks the editor Ubuntu opensChanges which program Ubuntu starts as the default editor, or any other alternative.27 Nov 2026 - Tip
grep -E '^(HOME_MODE|UMASK)' /etc/login.defsHOME_MODE and DIR_MODE decide the permissions of new home foldersSets how private the home folder of every new user account is.27 Nov 2026 - Tip
sudo apt install --reinstall coreutilsApt install --reinstall brings back files you deleted by mistakeReinstalls a package and restores config files that were deleted.24 Nov 2026 - Tip
sudo apt install ./vendor-tool_2.1_amd64.debApt install ./file.deb installs a local package and resolves its dependenciesInstalls a downloaded .deb file and pulls in the dependencies it needs.24 Nov 2026 - Tip
sudo apt upgradeApt full-upgrade can remove packages that apt upgrade never removesLets apt install or remove packages to finish upgrades that are kept back.24 Nov 2026 - Tip
systemctl --failedsystemctl --failed lists every service that did not startLists every service that failed to start, so you know after a reboot if everything came back.17 Nov 2026 - Tip
sudo unattended-upgrade -v --dry-runDo a dry run before you trust unattended-upgradesSimulates an automatic update run and shows what it would install without changing anything.18 Sep 2026 - Tip
sudo ufw show addedUfw show added lets you check your rules before you enable the firewallLists the firewall rules you have added so you can check them before turning ufw on.11 Sep 2026 - Tip
sudo ufw status numberedUfw status numbered lets you delete a rule by its numberRemoves a firewall rule by its number from the numbered status list.6 Sep 2026 - Tip
sudo ufw limit sshUfw limit slows down anything hammering your SSH portAllows SSH but blocks any address that opens six or more connections in thirty seconds.27 Aug 2026 - Tip
sudo netplan tryNetplan try rolls your network change back if you lose the connectionApplies a netplan change and automatically undoes it unless you confirm it in time.7 Aug 2026 - Tip
sudo snap revert firefoxSnap revert puts a snap back on its previous versionRolls a snap back to the previously installed revision after a bad update.26 Jul 2026 - Tip
sudo snap refresh --hold=72h firefoxSnap refresh --hold pauses one snap without turning updates offPauses automatic updates of one snap for a set time, or forever, and can be undone.18 Jul 2026 - Tip
sudo apt autoremove --purgeApt autoremove --purge also deletes the leftover config filesRemoves unused dependency packages together with their leftover configuration files.11 Jul 2026 - Tip
sudo apt install --no-install-recommends–no-install-recommends stops apt from dragging in extrasInstalls a package with only its required dependencies and skips the merely recommended ones.24 Jun 2026 - Tip
sudo apt-mark hold postgresql-16apt-mark hold keeps one package on the version you haveFreezes one package at its current version while everything else keeps updating.9 Jun 2026 - Tip
sudo ufw insert 1 deny from 203.0.113.7Ufw insert 1 puts a deny rule above your allow rulesAdds a rule at a chosen position so it is evaluated first.15 May 2026 - Tip
sudo netplan generateNetplan generate checks your YAML without touching the networkParses the netplan YAML and reports errors without changing the network.12 May 2026 - Tip
sudo ufw default deny incomingUfw default deny incoming sets the policy for everything without a ruleSets what ufw does with traffic that none of your rules match.10 May 2026 - Tip
sudo ufw delete allow 80/tcpUfw delete allow 80/tcp removes a rule by repeating itRemoves a firewall rule by naming it rather than looking up its number.10 May 2026 - Tip
sudo ufw allow from 192.168.1.0/24 to any port 5432 proto tcpUfw allow from a subnet to one port keeps a service on your LANOpens a port only to one source network instead of to everyone.10 May 2026 - Tip
sudo timedatectl set-timezone Europe/AmsterdamTimedatectl set-timezone fixes the zone of a linux serverSets the system time zone with a name from the official list.12 Apr 2026
Other tips22
- Tip
dpkg --get-selections > packages.txtdpkg --get-selections rebuilds your package set on a new machineSaves the installed package list so another machine can install the same set.3 Dec 2026 - Tip
- to: 192.168.3.0/24Netplan routing-policy sends replies out the interface they came in onWith two network cards on different subnets, source-based rules keep the replies on the right card.2 Dec 2026 - Tip
apt-cache policyunattended-upgrades updates a third party repository with Origins-PatternInclude packages from an extra repository in your automatic updates.1 Dec 2026 - Tip
cat /etc/apt/apt.conf.d/20auto-upgradesTwo APT::Periodic lines decide whether unattended-upgrades runs at allCheck the switch that turns daily automatic upgrades on.1 Dec 2026 - Tip
Unattended-Upgrade::Mail "[email protected]";unattended-upgrades can mail you only when something goes wrongHear about failed automatic updates without a daily message.1 Dec 2026 - Tip
ubuntu-bug openssh-serverubuntu-bug collects the details for an Ubuntu bug report for youGather versions and logs automatically when you report a problem.1 Dec 2026 - Tip
-o Dpkg::Options::="--force-confold" upgradeApt with force-confold keeps your edited config files in unattended upgradesStops apt from asking about changed config files during scripted upgrades.30 Nov 2026 - Tip
apt-cache search --names-only zstdapt-cache search -n finds a package by its name, without the noiseSearches package names only, so results don't drown in description matches.30 Nov 2026 - Tip
pro security-statuspro security-status shows which packages get Ubuntu security updates and which don'tCounts your installed packages by where their security updates come from.30 Nov 2026 - Tip
apt list '~o'apt list '~o' finds installed packages that no repository offers anymoreLists packages that no longer exist in any configured repository, so they get no updates.30 Nov 2026 - Tip
apt-config dump | lessapt-config dump shows the apt settings that are really in effectPrints the merged configuration from every file in apt.conf.d.30 Nov 2026 - Tip
Types: debApt .sources files are deb822 now, and Enabled: no switches one offShows the newer repository format and how to disable a source cleanly.30 Nov 2026 - Tip
less /var/log/apt/history.log/var/log/apt/history.log shows what apt installed and whenShows which packages apt installed, upgraded or removed, on which date and by which command.27 Nov 2026 - Tip
Pin: version 1.24.*Apt pinning in preferences.d locks a package to one version rangeTells apt which version of a package to prefer, and keeps it there.24 Nov 2026 - Tip
apt-cache rdepends --installed libssl3apt-cache rdepends shows what needs a package before apt removes itLists installed packages that depend on a given package.24 Nov 2026 - Tip
pro statuspro status shows what Ubuntu Pro covers on your machineLists which Ubuntu Pro security services are active on this machine and whether it is attached.24 Oct 2026 - Tip
ubuntu-drivers devicesubuntu-drivers devices tells you which graphics driver to installShows which driver Ubuntu recommends for your graphics card, ready to install with one command.8 Oct 2026 - Tip
do-release-upgrade -cdo-release-upgrade -c checks for a new Ubuntu release without starting oneChecks whether a newer Ubuntu release is available and reports it without starting an upgrade.2 Oct 2026 - Tip
Unattended-Upgrade::Automatic-Reboot "true";Let unattended-upgrades reboot at 04:00 instead of neverMakes automatic updates restart the machine at a fixed night time when a reboot is needed.24 Sep 2026 - Tip
apt changelog openssh-serverapt changelog shows why a package wants to updateShows the maintainers' notes for a package so you know what an update actually changes.4 Jul 2026 - Tip
apt list --upgradableapt list --upgradable shows what is waiting before you upgradeLists the packages that have a newer version available without installing anything.2 Jun 2026 - Tip
snap info lxdsnap info shows channels, tracking and the installed revisionShows which channels a snap offers and which one you follow.13 May 2026
Network9
- Tip
hidden: trueConnect to a hidden Wi-Fi network with hidden: true in netplanNetplan's hidden key changes how the SSID is scanned, so networks that do not broadcast their name can be joined.2 Dec 2026 - Tip
ls -l /etc/netplan/Chmod 600 on your netplan files keeps Wi-Fi passwords and keys privateStops other local users from reading secrets stored in your network config.1 Dec 2026 - Tip
optional: trueOptional: true in netplan stops boot from waiting for an unplugged portA network port that is often down no longer holds up the startup.1 Dec 2026 - Tip
apt show nginxapt show tells you what a package is before you install itPrints a package's description, size, dependencies and source repository.30 Nov 2026 - Tip
apt-cache madison nginxapt-cache madison lists every version a repository offersLists all available versions of a package and the repository for each.24 Nov 2026 - Tip
netplan statusnetplan status shows what the network actually looks like right nowPrints the live state of every network interface, with addresses, routes and DNS.19 Aug 2026 - Tip
apt policy nginxapt policy tells you which version you get and where it comes fromShows the installed version, the candidate version and which repository each comes from.17 Jun 2026 - Tip
network: {version: 2, ethernets: {enp3s0: {dhcp4: true, dhcp4-overrides: {use-dns: false}, nameservers: {addresses: [192.168.1.2]}}}}dhcp4-overrides lets netplan ignore the DNS servers a DHCP server sendsKeeps the DHCP address but replaces the DNS servers with your own.13 May 2026 - Tip
network: {version: 2, ethernets: {enp3s0: {addresses: [192.168.1.20/24], routes: [{to: default, via: 192.168.1.1}], nameservers: {addresses: [192.168.1.1]}}}}A static IP in netplan sets the default route under routes instead of gateway4Sets a fixed address and default route the current way in netplan.12 May 2026
Storage2
- Tip
mode: active-backupNetplan bonds with active-backup keep a server online when one cable failsCombine two ports so the second takes over when the first link drops.1 Dec 2026 - Tip
apt list '~c'apt purge '~c' removes the config leftovers of packages you already removedCleans out packages that are gone but still left their configuration behind.30 Nov 2026
Media2
- Tip
[Jellyfin]Write your own ufw application profile in /etc/ufw/applications.dDefines a named profile for your own service so rules refer to a name.30 Nov 2026 - Tip
sudo ufw allow 8096/tcp comment 'Jellyfin'Ufw allow with comment puts the reason for a rule next to itAdds a short note to a firewall rule so you remember why the port is open.27 Nov 2026
Docker1
Nothing matches.