# Package mgmt systems
- automates dependency tracking process
- if dependencies aren't installed you'd have to track down and install the appropriate versions of those dependencies with rpm or dpkg
- ability to pull packages/dependencies from different repositories
# Package types: rpm & dpkg
- installing an rpm (redhat package mgr)) file using rpm tools without using YUM/DNF
- `sudo rpm -i file_name.rpm`
- `sudo rpm install -ivh file_name.rpm` shows verbose output and install progress
- `.rpmnew` file contains the new default configuration file and leaves your original configuration file untouched
- `.rpmsave` file is a copy of your original configuration file, which has been replaced by the new default file.
- installing a deb file without using APT
- `sudo dpkg -i file_name.deb`
# `apt`
- apt = advanced package tool for debian systems
- manages packages and associated dependencies
- `sudo apt update` refreshes available packages and versions
- BIG difference from YUM/DNF
- `sudo apt upgrade` upgrades all packages
- `sudo apt dist-upgrade` same as `sudo apt upgrade` but also removes obsolete packages
- greater possibility to break packages
- `sudo apt -f install` fixes broken packages
- `sudo apt install package_name` installs package
- `sudo apt info package_name` provides package info
- `sudo apt remove package_name` removes package
- `sudo apt update && sudo apt update` updates package list and upgrades installed packages
- `sudo apt autoremove` removes orphaned packages
- `sudo apt-cache search package_name` searches cache for a package`
# `yum` and `dnf`
- yum = yellowdog updater, modified for red hat systems
- dnf = dandified yum
- newer version of yum
- yum commands usually symbolically linked to dnf
- both use RPM packages underneath
- `sudo yum/dnf install package_name` installs package
- `sudo yum/dnf remove package_name` removes package
- `sudo yum/dnf update` updates package list and upgrades installed packages
- performs both update and upgrade in one go as opposed to apt
- `sudo yum upgrade` same as update but also removes update but also removes obsolete packages
- may break packages
- `sudo yum deplist service_name` shows dependencies for service
- `sudo dnf history` shows recent dnf actions by ID_number
- `sudo dnf history undo ID_number` to rollback a specified ID_number
# repository config files
- config files for apt repositories
- `/etc/apt.conf` references config files in `/etc/apt/apt.conf.d` that are individually loaded
- `/etc/apt/sources.list` defines where apt goes for package updates (standard apt repositories) ![[images/Pasted image 20250804192406.png]]
- `/etc/apt/sources.list.d` defines where specific packages go to fetch updates
- config files for yum/dnf repositories
- `/etc/yum.conf` symbolic link to `/etc/dnf/dnf.conf`
- `/etc/dnf/dnf.conf` is the config file for the dnf package mgr
# `pacman`
- arch linux package mgr
- `sudo pacman -S package_name` installs package
- `sudo pacman -R package_name` removes package
- `sudo pacman -Syu` updates package list and upgrades installed packages
- performs both update and upgrade in one go as opposed to apt
# `zypper`
- suse linux package mgr
- uses RPM packages underneath
- `sudo zypper search file_name` shows related packages for install
- `sudo zypper install file_name.rpm`
- `sudo zypper update` updates all packages
- `sudo zypper dist-upgrade` same as update but also removes obsolete packages
- `sudo zypper patch` installs only security updates to packages
# troubleshooting
- locked package mgr
- `sudo rm /var/lib/dpkg/lock-frontend` removes lock file for debian based systems
- check library cache
- `ldconfig -p` displays library cache
- broken dependencies
- `sudo apt --fix-broken install`
- `sudo apt-get check` to check for broken packages
- `sudo dnf check` and `sudo dnf distro-sync`
- `sudo rpm -aV` to check for broken packages
- repository issues
- debian
- `sudo apt update`
- edit `/etc/apt/sources.list`
- edit files in `/etc/apt/sources.list.d`
- red hat
- `sudo yum updateinfo` and `sudo dnf update`
- `sudo yum makecache` and `sudo dnf makecache`
- check `/etc/yum.repos.d`
- arch
- `sudo pacman -Sy`
# Sandboxed Apps
- `flatpak`
- installed system wide by default (as opposed to on a per user basis)
- manages dependencies within their own sandboxes similar to docker containers enables developers to provide a singular release instead of multiple for different distros/architectures
- first way: install flathub repo then install flatpak_app_name
- for red hat: `sudo dnf install flatpak` then `flatpak remote-add --if-not-exists flathub`
- `flatpak install flathub flatpak_app_name` will pull flatpak_app_name from repo
- `flatpak search app_name` to search across flathub repo
- second way: download app_name.flatpakref from [flathub.org](http://flathub.org), then `flatpak install ~/loc/app_name.flatpakref`
- run app with `flatpak run flatpak_app_name`
- `snap`
- used on Ubuntu; same idea as flatpak with sandboxed apps
- installed by default on Ubuntu
- while installed system wide, config files are stored locally on a per user basis
- `snap list` shows listing of system wide snaps
- `snap search app_name`
- `snap install app_name`
- `appimage`
- download app_name.appimage file, `chmod +x`, and run with `./app_name.appimage` to run the app
- able to prompt you to update versions
- doesn't require root privs
- literal all in one solution