Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Local package installation in Linux refers to manually installing software packages that are downloaded as standalone files, rather than from a distribution’s package repository. This is useful when a package is not available in the default repositories, requires a specific version, or is distributed as a standalone file by the developer (or you just want to use a custom version compiled by a third party with functionalities that differ from the mainstream compilation in the repositories).
Local package installation is useful when a package is unavailable in repositories or requires manual installation. Each Linux distribution has its own package management system for handling .deb
, .rpm
, and other package formats. Learning these commands ensures smooth installation, removal, and maintenance of software on your system.
Debian-based distributions, such as Ubuntu, Debian, and Linux Mint, use dpkg and APT for package management.
.deb
Package
sudo dpkg -i package-name.deb # Installs a .deb package
If the installation fails due to missing dependencies, run:
sudo apt --fix-broken install # Resolves missing dependencies
Alternatively, you can install .deb
packages using APT:
sudo apt install ./package-name.deb # Installs and resolves dependencies
Red Hat-based distributions, such as Fedora, CentOS, and RHEL, use RPM and DNF for package management.
.rpm
Package
sudo rpm -ivh package-name.rpm # Installs a .rpm package
To install .rpm
packages while handling dependencies automatically, use:
sudo dnf install package-name.rpm # Installs an .rpm package and resolves dependencies
For older systems using YUM:
sudo yum localinstall package-name.rpm
Arch Linux and its derivatives (such as Manjaro) use Pacman for package management. Local packages are installed using pacman -U
.
sudo pacman -U package-name.pkg.tar.zst # Installs a local Arch package
For packages from the AUR (Arch User Repository), use an AUR helper like yay
:
yay -U package-name.pkg.tar.zst
openSUSE uses Zypper for package management.
.rpm
Package
sudo zypper install package-name.rpm # Installs an .rpm package
sudo dpkg -r package-name # Removes a package but keeps configuration files
sudo dpkg --purge package-name # Removes the package and its configuration files
To remove dependencies that are no longer needed:
sudo apt autoremove
sudo rpm -e package-name # Removes an installed RPM package
For DNF-based systems:
sudo dnf remove package-name
sudo pacman -R package-name # Removes a package
sudo pacman -Rns package-name # Removes package and unused dependencies
sudo zypper remove package-name # Removes a package
To check if a package is installed:
Debian-based:
dpkg -l | grep package-name
Red Hat-based:
rpm -q package-name
Arch-based:
pacman -Q package-name
openSUSE:
zypper se --installed-only package-name