| What is Package Management | |||||||||||||||||||||||||
|
Linux uses repositories centralized, secure and fast install a package install <package name>system downloads, installs, adds shortcut, and will keep the software updated What is a Package
a package is usually a collection of binaries (the program itself), configuration files, icons, and librariesa package is a compressed archive file containing all of these separate pieces, bundled together in a way that the system can understand a repository is a server which holds thousands of packages maintained by the creators of the specific distribution Ubuntu is configured to use official Ubuntu repositories Package Manager
the Package Manager is the tool which talks to the repositoryexample installation of Firefox
|
|||||||||||||||||||||||||
| Understanding Package Managers: APT, DNF, YUM, Pacman | |||||||||||||||||||||||||
|
the different families of Linux distributions have different package managers all do the same job but they speak different languages and use different file formats
|
|||||||||||||||||||||||||
| Debian/Ubuntu Package Management with APT | |||||||||||||||||||||||||
|
almost all package management commands require administrative privileges need to use sudo (SuperUser DO) Updating the Catalog (apt update)
must sync local package list with the servercommand sudo apt updatecomputer connects to repo and downloads the the latest list of package names Upgrading Software (apt upgrade)
upgrade software using command
sudo apt upgradeAPT looks at every installed program compares the existing version with the version in the new list if the repository has a newer version, the version is queued for installation Installing Software (apt install)
install joke program sl (Steam Locomotive)to install the app use the command sudo apt install sl Removing Software (apt remove)
to remove the sl app use the command
sudo apt remove slremoves program's binary files usually leaves config files settings are retained in case the app gets reinstalled The Nuclear Option (apt purge)
to remove both binary and cofig files use the command
sudo apt purge sl Cleaning Up (apt autoremove)
when an app is installed it may require multiple librariesif the app is removed, the libraries can remain to find and remove any packages that were installed as dependencies but are no longer needed by any program use the command sudo apt autoremove |
|||||||||||||||||||||||||
| Red Hat/Fedora Package Management with DNF | |||||||||||||||||||||||||
|
use DNF (Dandified YUM) instead of APT commands similar to APT Updating and Upgrading
combine updating the local list from repo and installs upgrades in one logical step by DNF
sudo dnf upgrade Installing
sudo dnf install firefox Removing
sudo dnf remove firefox Searching
sudo dnf search firefox Main Difference Between APT and DNF
the package formatcan't install a .rpm file on Ubuntu can't install a .deb file on Fedore can do with special tools |
|||||||||||||||||||||||||
| Searching for Packages and Understanding Dependencies | |||||||||||||||||||||||||
|
Searching with APT
looking to install pythontrue name of package is unknown apt search pythonwill return massive list of thousands of packages a better way to search is to use the apt cache command apt-cache search python | grep -i mathbest way to search is to use Google Ubuntu install pythonusually will return exact package name Viewing Dependencies
to find out what dependencies package requires
apt depends gimpdisplays a long list of dependencies a needs b, b needs c, c needs d .... package manager handles the complexity of installation of dependencies Broken Dependencies (Dependency Hell)
APT and DNF are very good at navigating the 'Dependency Maze'rarely get into a broken state if an install fails use the command sudo apt --fix-broken install |
|||||||||||||||||||||||||
| Managing Repositories and PPAs | |||||||||||||||||||||||||
|
official Ubuntu repositories contain roughly 60,000 packages a new version of software won't be added it to the official repository for six months prioritize stability over newness for the absolute latest version, need to add a PPA (Personal Package Archive) a PPA is a small, private repository hosted by a developer or a team by adding it to the system, you tell APT: "Trust this guy, and check his list for software too." Adding a PPA
Risks of PPAs
PPA files are not checked for security or stabilityonly add PPAs from the official developers of the software (e.g., the official Mozilla PPA, the official LibreOffice PPA) Removing a PPA
sudo add-apt-repository --remove ppa:<developer>/<package> |
|||||||||||||||||||||||||
| Installing Software from Source | |||||||||||||||||||||||||
|
sometimes need to download the raw source code and compiling it locally
The Workflow, Make, Install
The Downside of Source
APT doesn't know about package
|
|||||||||||||||||||||||||
| Keeping Your System Updated and Secure | |||||||||||||||||||||||||
|
most updates in Linux are security patches open source means vulnerabilities are quickly discovered Automatic Updates
Ubuntu typically enables Unattended Upgrades by defaultinstalls critical updates in the background Kernel Updates
occassionally an update will bring in a new Linux kernela file named /var/run/reboot-required means a kernel update was installed and a reboot is needed |
|||||||||||||||||||||||||
| Alternative Package Managers: Snap, Flatpak, AppImage | |||||||||||||||||||||||||
|
these are 'universal' package managers bundle all their dependencies inside the package
|
|||||||||||||||||||||||||
| Summary | |||||||||||||||||||||||||
covered
|