apt
Overview
The apt
(Advanced Package Tool) command manages packages in Debian-based systems. It provides a high-level interface for package management.
Syntax
apt [options] command [package...]
Common Commands
Command | Description |
---|---|
update |
Update package list |
upgrade |
Upgrade packages |
full-upgrade |
Upgrade with removal |
install |
Install packages |
remove |
Remove packages |
purge |
Remove with config |
autoremove |
Remove unused |
search |
Search packages |
show |
Show package details |
list |
List packages |
clean |
Clean cache |
autoclean |
Clean old cache |
Common Options
Option | Description |
---|---|
-y |
Automatic yes |
-q |
Quiet output |
-V |
Show version numbers |
-s |
Simulate |
-d |
Download only |
--no-install-recommends |
Skip recommended |
--reinstall |
Force reinstall |
--fix-broken |
Fix broken deps |
Key Use Cases
- Package installation
- System updates
- Package removal
- Dependency management
- System maintenance
Examples with Explanations
Example 1: Update System
apt update && apt upgrade
Update package list and upgrade
Example 2: Install Package
apt install package_name
Install specific package
Example 3: Remove Package
apt remove package_name
Remove package
Common Usage Patterns
System update:
apt update && apt full-upgrade
Package search:
apt search keyword
Clean system:
apt autoremove && apt clean
Security Considerations
- Package sources
- Signature verification
- Root privileges
- Network security
- Version control
Additional Resources
Best Practices
- Regular updates
- Clean cache
- Verify sources
- Backup configuration
- Test upgrades
Package Management
- Installation
- Removal
- Upgrades
- Dependencies
- Configuration
Troubleshooting
- Broken packages
- Dependencies
- Repository issues
- Network problems
- Space constraints