- What is package management?
- A running program is more than just an executable file. It may be
several executables, and any number of configuration and support
files. This collection is called a package.
- An installed OS is a huge collection of packages.
- When not installed, package contents are stored in package files.
They contain collections of files, something like like ZIPs.
- Packages depend on each other. For instance, the network manager
package cannot operate unless a DHCP client is installed.
- A package manager
- Installs and removes packages.
- Determines what additional packages are needed to install a new
one.
- Determines when its safe to remove a package, since remaining ones
might depend on it.
- Package managers are usually collections of programs.
- Generally, operate on two levels
- Low-level: Deals only with the local file system, including
package files.
- Debian: dpkg
- Red Hat: rpm
- High-level: Deals with repositories, which are collections of
packages files available to install, online or on a disk.
- Debian: apt-get, aptitude
- Red Hat: yum
- Linux distributions use various package management systems; there
are several. Two most widely-used seem to be Debian and Red Hat based.
- Debian.
- Originated with the Debian distribution.
- Used by Debian, Ubuntu, Mint.
- Package files use .deb extension.
- Red Hat.
- Originated with Red Hat, a commercial company.
- Used by Fedora, CentOS, RHEL, openSUSE.
- Package files use .rpm extension. RPM =
Red-Hat Package Manager.
- Things to do.
- Search the repository
- Debian: apt-cache search search_string
- Red Hat: yum search search_string
- Install from a repository.
- Debian: apt-get install package_name
- Red Hat: yum install package_name
- Install a package file.
- Debian: dpkg --install package_file
- Red Hat: rpm -i package_file
yum localinstall package_file
- Remove a package.
- Debian: apt-get remove package_name
- Red Hat: yum erase package_name
- Update the system from the repository.
- Debian: apt-get upgrade
- Red Hat: yum update
- Upgrade a package from a file.
- Debian: dpkg --install package_file
- Red Hat: rpm -U package_file
- List all packages.
- Debian: dpkg --list
- Red Hat: rpm -qa
- Check if a package is installed.
- Debian: dpkg --status package_name
- Red Hat: rpm -q package_name
- Display information about a package.
- Debian: apt-cache show package_name
- Red Hat: yum info package_name
- Find which package an installed file belongs to.
- Debian: dpkg --search file_name
- Red Hat: rpm -qf file_name