APT Package Repository Management Guide

APT Package Repository Management Guide Introduction Understanding where your installed packages come from is crucial for system maintenance, security auditing, and troubleshooting. This guide shows how to identify package sources, manage repositories, list packages by origin, and audit your APT installation on Debian/Ubuntu systems. What are Package Repositories? Package repositories are servers that host software packages for installation via APT (Advanced Package Tool). Understanding repository sources helps you: Security: Identify packages from untrusted sources Maintenance: Track PPA dependencies Troubleshooting: Find conflicting package sources System Cleanup: Remove unused repositories Documentation: Maintain installation records Repository Types Type Description Example Official Ubuntu/Debian main repositories archive.ubuntu.com PPA Personal Package Archives (Ubuntu) ppa.launchpad.net/user/repo Third-party External repositories download.docker.com Local Locally installed packages /var/lib/dpkg/status Prerequisites Debian or Ubuntu-based system Basic terminal knowledge apt, dpkg, and perl installed (usually pre-installed) 馃殌 Quick Commands List All Packages with Repositories dpkg --get-selections | awk '!/deinstall$/ {print $1}' | \ xargs -I{} sh -c 'echo "=== $1 ===" && apt-cache policy "$1" | grep -E "^\s+\*\*\*" | head -1' -- {} | \ paste - - | sed 's/=== \([^ ]*\) ===/\1:/' | \ perl -pe 's/:\s+\*\*\*[^5]*500\s+/: /' | \ sed 's/\s\[.*\]$//' List Only PPA Packages dpkg --get-selections | awk '!/deinstall$/ {print $1}' | \ xargs -I{} apt-cache policy {} | \ perl -0777 -ne 'while(/^(\S+?):\n.*?\n\s+\*\*\*.*?500 http:\/\/ppa\.launchpad\.net\/([^\s\/]+)/gms) {print "$1: $2\n"}' Count Packages per Repository dpkg --get-selections | awk '!/deinstall$/ {print $1}' | \ xargs -I{} apt-cache policy {} 2>/dev/null | \ perl -0777 -ne 'while(/^(\S+?):\n.*?\n\s+\*\*\*.*?500\s+(http:\/\/[^\s]+)/gms) { $repo = $2; $repo =~ s/\s.*//; $repos{$repo}++ } END { for $r (sort keys %repos) { print "$r: $repos{$r} packages\n" } }' 馃摝 Complete Package Audit Script Full-featured bash script with multiple options Save as package-audit.sh: ...

October 5, 2025 路 12 min 路 2355 words 路 Manzolo

ZSH Installation and Configuration Guide (Debian/Ubuntu)

ZSH Installation and Configuration Guide (Debian/Ubuntu) Introduction ZSH (Z Shell) is a powerful, customizable shell designed for interactive use and scripting, offering enhanced features over Bash, such as advanced autocompletion, themes, and plugins. This guide explains how to install ZSH, set up Oh My Zsh (a popular framework for managing ZSH configurations), and configure the Powerlevel10k theme with plugins like syntax highlighting and autosuggestions on Debian/Ubuntu systems. It provides a streamlined setup for a modern, user-friendly shell experience. ...

October 4, 2025 路 4 min 路 839 words 路 Manzolo

Mail Server Installation and Configuration Guide (Debian/Ubuntu)

Mail Server Installation and Configuration Guide (Debian/Ubuntu) Introduction Setting up a complete mail server allows you to send and receive emails using your own domain with full control over your data. This guide explains how to install and configure a production-ready mail server on Debian/Ubuntu with Postfix (SMTP), Dovecot (POP3/IMAP), user management, quota support, and security features including TLS/SSL encryption. It鈥檚 ideal for small businesses, organizations, or anyone wanting independent email hosting. ...

October 4, 2025 路 11 min 路 2178 words 路 Manzolo