Repositories
Sometimes the software you need isn't in the default repositories, or you need a newer version. That's when you add third-party repos.
Understanding Sources
Your package sources are defined in:
Additional sources go in /etc/apt/sources.list.d/:
Adding a PPA (Personal Package Archive)
PPAs are Ubuntu's way to distribute third-party software:
PPAs Are Not Officially Supported
PPAs are maintained by individuals, not Ubuntu. They could:
- Stop being updated
- Contain buggy software
- Conflict with system packages
Only add PPAs from sources you trust.
Adding Official Third-Party Repos
Major software (Docker, Node.js, VS Code) provides official repos. The process:
- Add GPG key (for verification)
- Add repository
- Update and install
Example: Docker
Why GPG Keys?
GPG keys verify that packages actually come from the publisher. Without them, someone could intercept your connection and serve malicious packages.
View Added Repositories
Remove a Repository
Remove a PPA
Remove Custom Repository
Pin Package Versions
Want to prevent a package from updating? Pin it:
Why do third-party repositories require GPG keys?
Quick Reference
| Command | Purpose |
|---|---|
add-apt-repository ppa:name | Add PPA |
add-apt-repository --remove | Remove PPA |
apt-mark hold pkg | Prevent updates |
apt-mark unhold pkg | Allow updates |
/etc/apt/sources.list.d/ | Custom repo location |
Key Takeaways
- Default repos are in
/etc/apt/sources.list - Custom repos go in
/etc/apt/sources.list.d/ - PPAs are convenient but unofficial
- Official third-party repos need GPG keys
- Always
apt updateafter adding repos - Use
apt-mark holdto pin versions
Next: universal package formats - Snap and Flatpak.