Table of Contents
What you will read?
If you run a command and get “command not found” or hit a dependency error, a missing package is likely the cause.
Step 1: Update your package manager
Before installing anything, refresh the package index so the system can find the latest versions.
Ubuntu/Debian:
sudo apt update
Fedora/RHEL:
sudo dnf check-update
This step helps prevent errors when installing packages.
Step 2: Install the missing package directly
If you know the package name, install it with your distro’s default package manager.
Debian/Ubuntu example:
sudo apt install curl
Fedora example:
sudo dnf install curl
Replace curl with the actual command or library you’re missing.
Step 3: Find which package provides a missing command
If you’re unsure which package includes the missing command or file, use a search tool.
Debian/Ubuntu:
sudo apt install apt-file
sudo apt-file update
apt-file search <command-name>
Fedora/RHEL:
dnf provides */<command-name>
These tools tell you the exact package you need to install.
Step 4: Fix broken or incomplete installs
If your system complains about broken dependencies or unfinished installs, use:
sudo apt --fix-broken install
This automatically pulls in the required missing packages.
Step 5: Install all required dependencies
If you downloaded a .deb or .rpm manually, use the system to fetch its missing dependencies.
Ubuntu/Debian:
sudo apt install -f
Fedora/RHEL:
sudo dnf install ./your-package.rpm
This will automatically download and install any missing dependencies along with your .rpm file. Make sure you’re in the same directory as the package or provide the full path.
This finalizes any half-installed packages and installs what’s missing.
