Linux package management

Administrative Tasks

In Red Hat Enterprise Linux and Fedora by default, each administrative user needs to know the root password, in addition to their own password.

In Ubuntu, each user only has one password. Users in the admin group can run command line and graphical applications with elevated privileges. Graphical admin tools prompt for this password when run, and command line tools can be run with root-privileges using sudo.

Package Management

Ubuntu has more packages available than Fedora, so you'll have a better chance of finding what you want in the repositories. As with Fedora, graphical applications will put a link into the Applications menu.

Graphical Tools

The Synaptic package Manager is an excellent tool for finding, fetching and installing packages. Press System -> Administration -> Synaptic Package Manager to start Synaptic.

Command Line Tools

Ubuntu uses apt-get instead of yum , up2date and so on to find, download, and install packages and their dependencies.

Note that, unlike yum, apt-get is only for packages available in repositories - it cannot handle packages you have already downloaded. The dpkg command is used instead.

Table of Equivalent Commands

Below is a table of equivalent commands for package management on both Ubuntu/Debian and Red Hat/Fedora systems.

TaskRed Hat/FedoraUbuntu
Adding, Removing and Upgrading Packages
Refresh list of available packagesYum refreshes each time it's usedapt-get update
Install a package from a repositoryyum install package_nameapt-get install package_name
Install a package fileyum install package.rpm
rpm -i package.rpm
dpkg --install package.deb
Remove a packagerpm -e package_nameapt-get remove package_name
Check for package upgradesyum check-updateapt-get -s upgrade
apt-get -s dist-upgrade
Upgrade packagesyum update
rpm -Uvh [args]
apt-get dist-upgrade
Upgrade the entire systemyum upgradeapt-get dist-upgrade
Package Information
Get information about an available packageyum search package_nameapt-cache search package_name
Show available packagesyum list availableapt-cache dumpavail
List all installed packagesyum list installed
rpm -qa
dpkg --list
Get information about a packageyum info package_nameapt-cache show package_name
Get information about an installed packagerpm -qi package_namedpkg --status package_name
List files in an installed packagerpm -ql package_namedpkg --listfiles package_name
List documentation files in an installed packagerpm -qd package_name-
List configuration files in an installed packagerpm -qc package_name-
Show the packages a given package depends onrpm -qR package_nameapt-cache depends
Show other packages that depend on a given package (reverse dependency)rpm -q -whatrequires [args]apt-cache rdepends
Package File Information
Get information about a package filerpm -qpi package.rpmdpkg --info package.deb
List files in a package filerpm -qpl package.rpmdpkg --contents package.deb
List documentation files in a package filerpm -qpd package.rpm-
List configuration files in a package filerpm -qpc package.rpm-
Extract files in a packagerpm2cpio package.rpmcpio -vid
Find package that installed a filerpm -qf filenamedpkg --search filename
Find package that provides a particular fileyum provides filenameapt-file search filename
Misc. Packaging System Tools
Show stats about the package cache-apt-cache stats
Verify all installed packagesrpm -Vadebsums
Remove packages from the local cache directoryyum clean packagesapt-get clean
Remove only obsolete packages from the local cache directory-apt-get autoclean
Remove header files from the local cache directory (forcing a new download of same on next use)yum clean headersapt-file purge
General Packaging System Information
Package file extension*.rpm*.deb
Repository location configuration/etc/yum.conf/etc/apt/sources.list

Some of the information in this table was derived (with permission) from APT and RPM Packager Lookup Tables.

More technical information about Debian-style packaging can be found in Basics of the Debian package management systemand the Debian New Maintainers' Guide.

Services

Services on Ubuntu are managed in a broadly similar way to those on Red Hat.

Graphical Tools

Services can be configured by clicking System -> Administration -> Services. A tool called Boot-Up Manager is also available.

Command Line Tools

Below is a table of example commands for managing services. The apache / httpd service is used as an example.

TaskRed Hat / FedoraUbuntuUbuntu (with sysv-rc-conf or sysvconfig)
Starting/stopping services immediatelyservice httpd startinvoke-rc.d apache startservice apache start
Enabling a service at bootchkconfig httpd onupdate-rc.d apache defaultssysv-rc-conf apache on
Disabling a service at bootchkconfig httpd offupdate-rc.d apache purgesysv-rc-conf apache off

Note: Whereas Red Hat and Fedora servers boot into runlevel 3 by default, Ubuntu servers default to runlevel 2.

Note: The service and invoke-rc.d commands call init scripts to do the actual work. You can also start and stop services by doing e.g. /etc/init.d/apache start on Ubuntu, or /etc/init.d/httpd start on Red Hat/Fedora.

Network

Graphical Tools

Fedora/RHEL have system-config-network, ubuntu pre 10.04 had gnome-nettool to edit static ip address, since 10.04 nm-connection-editor is the best choice. For Ubuntu 10.04 Studio there is only manual editing of files since NetworkMontor is not included

Command Line Tools