Lesson 13 of 29 ↓
- 1.Rhel 9 Administration Guide
- 2.Ubuntu Boot Process Guide
- 3.Linux Basic Commands Guide
- 4.Comprehensive Unix Shells Guide
- 5.Mastering Vim Deep & Practical Guide
- 6.Magic Numbers in Linux Deep Systems Guide
- 7.Wildcards & Globbing in Linux Deep Cli Guide
- 8.Linux Users & Groups Deep Administration Guide
- 9.Journaling in Linux Filesystems Deep Systems Guide
- 10.Getopt & Getoptlong Deep System-level Option Parsing Guide
- 11.Su Command in Linux Complete Guide with Environment Variables
- 12.Linux File Permissions and Ownership Complete Practical Guide
- 13.Ubuntu Package Management Apt Complete Guide
- 14.Bash Scripting Basics
- 15.Linux File System Essentials
- 16.Process and Thread Management
- 17.Session 10 : Introduction to Networking & the Application Layer
- 18.Linux Networking Cli & Introduction to Yocto for Machine Routing
- 19.Comprehensive Guide to Ssh (secure Shell)
- 20.Logical Volume Management (lvm) Guide
- 21.C Build Process & Libraries Guide
- 22.Archiving and Compression in Linux
- 23.Linux Package Managers: a Detailed Guide
- 24.Misra-c Guidelines Detailed Cheat Sheet
- 25.Mqtt Server Setup (pc as Server)
- 26.Detailed Explanation of Tty and Pts in Linux
- 27.Vim Cheat Sheet
- 28.Difference Between apt and apt-get
- 29.Difference Between apt Upgrade and apt Full-upgrade
1 min read
Ubuntu Package Management Apt Complete Guide
linux
Introduction
Package management is the heart of Linux system maintenance. Ubuntu uses APT (Advanced Package Tool) to install, upgrade, remove, and manage software.
This guide explains APT from user commands to underlying mechanisms.
Package Types
| Type | Description |
|---|---|
.deb |
Debian package |
| Meta | Depends on others |
| Virtual | Provided by other packages |
Repository Structure
Sources stored in:
/etc/apt/sources.list
/etc/apt/sources.list.d/Repository components:
-
main
-
restricted
-
universe
-
multiverse
Updating Package Index
sudo apt updateDoes NOT install anything.
Upgrading Packages
sudo apt upgrade
sudo apt full-upgrade| Command | Behavior |
|---|---|
| upgrade | Safe upgrades |
| full-upgrade | May remove packages |
Installing Packages
sudo apt install nginx
sudo apt install ./file.debRemoving Packages
sudo apt remove nginx
sudo apt purge nginxCleaning System
sudo apt autoremove
sudo apt autoclean
sudo apt cleanSearching Packages
apt search nginx
apt show nginxDpkg vs Apt
| Tool | Scope |
|---|---|
| dpkg | Local package |
| apt | Dependency resolver |
Holding Packages
sudo apt-mark hold linux-imageFixing Errors
sudo apt --fix-broken install
sudo dpkg --configure -aSecurity Updates
sudo unattended-upgradesEnterprise Best Practices
-
Use LTS releases
-
Enable security repo
-
Avoid third-party PPAs
Summary
-
APT resolves dependencies
-
dpkg installs locally
-
Repositories define trust
-
Clean regularly
Comments
Loading the discussion…