5
Type Distribution Name Go Select Distribution Go Home Page DW Weekly, Comments Package Management Packages Search Major Distributions Submit Distribution Upcoming Releases  About DistroWatch FAQ  Advertise Related Links  Advertisement Get the brand-new release of PCLinuxOS 2011.6 KDE edition on a live CD ($2.35) Package Ma nagement Cheatsheet  A package management refer ence car d for Lin ux di str ibu tions and FreeBSD Introduction Package management is probably the most distinctive feature of any Linux distribution. While the current trend among most of the major projects is to offer some sort of a clickable interface where users can select a package and install it with a mouse click (e.g. Debian's Synaptic or Mandriva's Drakrpm), these types of programs are generally just graphical front-ends to the low-level utilities that manage the tasks associated with installing packages on a Linux system. And even though many desktop Linux users feel much more comfortable installing packages through these intuitive graphical tools, there is no denying that command-line package management offers two excellent features not available in any graphical package management utility: power and speed. One problem that many distro-hoppers and operating system enthusiasts encounter is having to master (or relearn) a set of package management commands each time they switch from one distribution group to another. Additionally, the package management tools tend to evolve, with new features and even new commands added to every new version. This is why we created this package management cheatsheet - an easy reference card covering most frequently used package management tasks in Linux distributions and FreeBSD. As always, we welcome corrections, updates and suggestions - if you spot any error or wish to have another package management utility added to this page, feel free to contact us (email address at the bottom of this page). Package Managem ent Cheatsheet  A d v e r t i s e m e n t Mai n distributi ons The first table lists package management tasks in the four most popular distribution groups - Debian (including Ubuntu, Linux Mint, KNOPPIX, aptosid and other Debian derivatives), openSUSE, Fedora (including Red Hat Enterprise Linux, CentOS, Scientific Linux and other Fedora-based distributions), and Mandriva Linux and Mageia. Task apt (deb) Debian, Ubuntu zypp (rpm) openSUSE  yum (rpm) Fedora, CentOS urpmi (rpm) Mandriva, Mageia Managi ng soft ware  Install new software from package repository apt-get install pkg zypper install pkg yum install pkg urpmi pkg Install new software from package file dpkg -i pkg zypper install pkg yum localinstall pkg urpmi pkg Update existing soft ware apt-get install pkg zypper update -t package pkg yum update pkg urpmi pkg Re mo ve unwant ed so ft ware ap t-g et remo ve pkg zypper remove pkg yum erase pkg urpme pkg Updating the system  Update package list apt-get update aptitude update zypper refresh yum check-update urpmi.update -a Update system apt-get upgrade aptitude safe- upgrade zypper updat e yum update urpmi --aut o-select Searching for packages  Search by package name apt-c ache search pkg zypp er search pkg yum list pkg urpmq pkg Search by pattern apt-cache search pattern zypper search -t pattern pattern yum search pattern urpmq --fuzzy pkg Search by file name apt-file search path zypper wp file yum provides file urpmf file List installed packages dpkg -l zypper search -is rpm -qa rpm -qa Confi guring access t o software repositories  List repositories cat  /etc/apt/sources.list zypper repos yum repolist urpmq --list-media  Search  Search  Advertisement Linux Cloud Server Get Reliable Cloud Servers For Only $9.96/m onth. Free Setup. Compare! www.hostway.com/cloud-h… Server Backup & DR Full Server Image Backups Backups Stored Locally & Off- Site www.xxpert.com Certification Programs Browse Our Catalog of Certification Programs to Find One Near You. ww w.Certif icates.DegreeLe… $99 Amish Acres Package All-inclusive 2 day/1 night Nappanee, Indiana www.amishacres.com Top10 eComme rce Solutions 2011 Top eCommerce Solution Ranking Get Vendor Research by Top Analyst Business-Software.com/e… converted by Web2PDFC onvert.com

Package Mngmt

Embed Size (px)

Citation preview

8/4/2019 Package Mngmt

http://slidepdf.com/reader/full/package-mngmt 1/4

Type Distribution Name Go Select Distribution Go

• • • • • •

• Home Page• DW Weekly, Comments• Package Management• Packages

• Search• Major Distributions• Submit Distribution• Upcoming Releases

• About DistroWatch• FAQ• Advertise• Related Links

 Advertisement Get the brand-new release of PCLinuxOS 2011.6 KDE edition on a live CD ($2.35)

Package Management Cheatsheet

 A package management reference card for Linux distributions and FreeBSD

Introduction

Package management is probably the most distinctive feature of any Linux distribution. While the current trend among most of the major projects is to offer some sortof a clickable interface where users can select a package and install it with a mouse click (e.g. Debian's Synaptic or Mandriva's Drakrpm), these types of programs aregenerally just graphical front-ends to the low-level utilities that manage the tasks associated with installing packages on a Linux system. And even though many desktopLinux users feel much more comfortable installing packages through these intuitive graphical tools, there is no denying that command-line package management offerstwo excellent features not available in any graphical package management utility: power and speed.

One problem that many distro-hoppers and operating system enthusiasts encounter is having to master (or relearn) a set of package management commands eachtime they switch from one distribution group to another. Additionally, the package management tools tend to evolve, with new features and even new commands addedto every new version. This is why we created this package management cheatsheet - an easy reference card covering most frequently used package managementtasks in Linux distributions and FreeBSD. As always, we welcome corrections, updates and suggestions - if you spot any error or wish to have another packagemanagement utility added to this page, feel free to contact us (email address at the bottom of this page).

Package Management Cheatsheet

 A d v e r t i s e m e n t

Main distributions

The first table lists package management tasks in the four most popular distribution groups - Debian (including Ubuntu,Linux Mint, KNOPPIX, aptosid and other Debian derivatives), openSUSE, Fedora (including Red Hat Enterprise Linux,CentOS, Scientific Linux and other Fedora-based distributions), and Mandriva Linux and Mageia.

Task apt (deb)

Debian, Ubuntuzypp (rpm)openSUSE

 yum (rpm)Fedora, CentOS

urpmi (rpm)Mandriva, Mageia

Managing software  

Install new software frompackage repository

apt-get install pkg  zypper install pkg  yum install pkg  urpmi pkg 

Install new software frompackage file

dpkg -i pkg  zypper install pkg  yum localinstall pkg  urpmi pkg 

Update existing software apt-get install pkg zypper update -t

package pkg yum update pkg  urpmi pkg 

Remove unwanted software apt-get remove pkg  zypper remove pkg  yum erase pkg  urpme pkg 

Updating the system  

Update package listapt-get updateaptitude update

zypper refresh yum check-update urpmi.update -a

Update systemapt-get upgradeaptitude safe-

upgradezypper update yum update urpmi --auto-select

Searching for packages  

Search by package name apt-cache search pkg  zypper search pkg  yum list pkg  urpmq pkg 

Search by patternapt-cache search

pattern zypper search -tpattern pattern 

yum search pattern  urpmq --fuzzy pkg 

Search by file name apt-file search path  zypper wp file  yum provides file  urpmf file 

List installed packages dpkg -l zypper search -is rpm -qa rpm -qa

Configuring access tosoftware repositories

 

List repositoriescat

 /etc/apt/sources.listzypper repos yum repolist urpmq --list-media

 

Search

  Search

 Advertisement

Linux Cloud ServerGet Reliable CloudServers For Only$9.96/month. FreeSetup. Compare!www.hostway.com/cloud-h…

Server Backup & DR Full Server ImageBackups BackupsStored Locally & Off-

Sitewww.xxpert.com

CertificationProgramsBrowse Our Catalog of Certification Programsto Find One Near You.www.Certif icates.Deg reeLe…

$99 Amish AcresPackageAll-inclusive 2 day/1night Nappanee,Indianawww.amishacres.com

Top10 eCommerceSolutions2011 Top eCommerceSolution Ranking GetVendor Research byTop AnalystBusiness-Software.com/e…

converted by Web2PDFC onvert.com

8/4/2019 Package Mngmt

http://slidepdf.com/reader/full/package-mngmt 2/4

 Add repository(edit

 /etc/apt/sources.list)zypper addrepo path 

name (add repo to

 /etc/yum.repos.d/)urpmi.addmedia

name  path 

Remove repository(edit

 /etc/apt/sources.list)zypper removerepo

name (remove repo from /etc/yum.repos.d/)

urpmi.removemediamedia 

Slackware and Slackware Based Distributions

The table below lists package management utilities found in Slackware Linux and other Slackware-based distributions. Asstated by Patrick Volkerding on several occasions, Slackware is unlikely to ever have any advanced (i.e. dependency-resolving) package management tool, so all installation, upgrade and removal tasks continue to be performed withpkgtools , a set of very simple scripts that haven't changed much in years. Nevertheless, slackpkg , an advanced package

management tool which for years had been relegated to the unsupported "extra" repository, was finally made part of Slackware Linux 12.2. It's worth noting that some popular Slackware derivatives, such as  VectorLinux, have standardised onslapt-get , another third-party utility imitating the behaviour of Debian's APT, while Zenwalk Linux has introduced its ownpackage management tool called netpkg.

Task pkgtools

Slackwareslackpkg

Slackwareslapt-get Vector

netpkgZenwalk 

Managing software  

Install new software frompackage repository

-- slackpkg install pkg slapt-get --install

pkg netpkg pkg 

Install new software frompackage file

installpkg pkg  slackpkg install pkg slapt-get --install

pkg netpkg pkg 

Update existing software upgradepkg pkg  slackpkg upgrade pkg slapt-get --install

pkg netpkg pkg 

Remove unwanted software removepkg pkg  slackpkg remove pkg  slapt-get --removepkg 

netpkg remove pkg 

Updating the system  

Update package list -- slackpkg update slapt-get --update (automatic)

Update system -- slackpkg upgrade-all slapt-get --upgrade netpkg upgrade

Searching for packages  

Search by package name -- slackpkg search pkg slapt-get --search

pkg netpkg pkg  repo 

Search by pattern --slackpkg search

pattern slapt-get --search

pattern netpkg list | grep

pattern 

Search by file name -- -- -- netpkg file  repo 

List installed packages ls /var/log/packages/ ls /var/log/packages/ slapt-get -- instal led netpk list I

Configuring access to

software repositories  

List repositories --cat

 /etc/slackpkg/mirrorscat /etc/slapt-get/slapt-getrc

netpkg mirror

 Add repository --(edit

 /etc/slackpkg/mirrors)(edit /etc/slapt-get/slapt-getrc)

(edit /etc/netpkg.conf)

Remove repository --(edit

 /etc/slackpkg/mirrors)(edit /etc/slapt-get/slapt-getrc)

(edit /etc/netpkg.conf)

Independent Linux Distributions

In the next group we have a few (mostly) independent distributions that have been gaining popularity in recent years.Sabayon Linux, although derived from Gentoo, has introduced its own command-line package management utility calledequo . Arch Linux's Pacman has been around for a long time and it's often considered one of the fastest packagemanagement utilities around. Conary , developed by rPath and popularised by Foresight Linux, is a completely new approachto package management, created by well-known ex-Red Hat engineers with many years of package managementexperience. In contrast, PiSi by Pardus Linux is a relatively new utility, but the distribution itself has been growing fast in thelast couple of years.

Task equo

Sabayonpacman Arch

conaryrPath, Foresight

pisiPardus

Managing software  

Install new software frompackage repository

equo install pkg  pacman -S pkg  conary update pkg  pisi install pkg 

Install new software frompackage file

equo install pkg  pacman -U pkg  conary update pkg  pisi install pkg 

Update existing software equo install pkg  pacman -S pkg  conary update pkg  pisi install pkg 

Remove unwanted software equo remove pkg  pacman -R pkg  conary erase pkg  pisi remove pkg 

Updating the system  Update package list equo update pacman -Sy pisi update-repo

Update system equo world pacman -Su conary updateall pisi upgrade

Searching for packages  

Search by package name equo match pkg  pacman -Ss pkg  conary query pkg  pisi search pkg 

Search by pattern equo search pattern  pacman -Ss pattern  conary query pkg  pisi search pkg 

Latest Books

Linux Interview Questions You'llMost Likely Be Asked

Linux Guides/Whitepapers

NEW! 50 Uses For Live CDs

NEW! This FREE 31-page manuallists things you can accomplish

with a live CD, from data recoveryto virus removal to trying out cool

operating systems.

Linux Media

4000+ versions Linux & BSD

Ubuntu 11.04 $1.75

Kubuntu 11.04 $1.75

Linux Mint 11 DVD $4.95

Fedora 15 DVD $4.95Debian 6.0.1a DVD set $31.95

openSUSE 11.4 DVD $4.95

Mageia 1 DVD $1.75

USB Flash Drives

Ubuntu 11.04 4GB $21.95

Linux Mint 11 4GB $21.95

Easy Peasy 1.6 4GB $21.95

Free worldwide shipping on DVDorders

10% discount for returningcustomers

Click here to visit LinuxCD.org now

Linux Media

converted by Web2PDFC onvert.com

8/4/2019 Package Mngmt

http://slidepdf.com/reader/full/package-mngmt 3/4

Search by file name equo belongs file  pacman -Qo file conary query --path

path pisi search-file path 

List installed packages equo list pacman -Q conary query pisi list-installed

Configuring access tosoftware repositories

 

List repositories equo repoinfo cat /etc/pacman.conf pisi list-repo

 Add repository(edit

 /etc/pacman.conf) 

pisi add-repo name path 

Remove repository(edit

 /etc/pacman.conf) 

pisi remove-reponame 

Distribution Agnostic Package Management

Besides standard package management utilities that most distributions use as part of their systems, there are also somedistro-agnostic ones that have been deployed with various levels of success in certain distributions. Smart , originallydeveloped by Conectiva, hasn't been in the news lately, but some users seem to prefer it over Mandriva's urpmi oropenSUSE's zypper (it also supports Debian and Slackware-based systems). More recently it is Fedora's PackageKit thathas been gaining momentum as a way to manage packages across distributions and architectures. Now included in manyother distributions, PackageKit's pkgcon command-line utility is effectively a unified front-end to the native packagemanagement tools of Fedora, Ubuntu, openSUSE, Mandriva and other distributions.

Task smart

Mandriva, openSUSEpkgcon

Fedora, Ubuntu, openSUSE, Mandriva

Managing software  

Install new software frompackage repository smart install pkg  pkcon install pkg 

Install new software frompackage file

smart install pkg  pkcon install-file pkg 

Update existing software smart install pkg  pkcon update pkg 

Remove unwanted software smart remove pkg  pkcon remove pkg 

Updating the system  

Update package list smart update pkcon refresh

Update system smart upgrade pkcon upgrade

Searching for packages  

Search by package name smart search pkg  pkcon search name pkg 

Search by pattern smart search pattern  pkcon search details pattern 

Search by file name smart query file  pkcon what-provides file 

List installed packages smart query --installed --

Configuring access tosoftware repositories

 

List repositories smart channel --show pkcon repo-list

 Add repository smart channel --add name  path   

Remove repository smart channel --remove name   

Source Based Distributions

Next, a table for source-based distributions. Gentoo's Portage is well-documented and widely used, but other distributionsthat are designed to be built from scratch don't often feature in the Linux media, so their package management systemsare not particularly well-known. Sorcerer, which existed even before Gentoo Linux was conceived, uses Bash scripts to"cast spells" or download, install and compile packages. Sorcerer was later forked into Lunar Linux and Source Mage

GNU/Linux, both of which are included in the table below. Unfortunately, Sorcerer doesn't offer much in terms of onlinedocumentation so it has been omitted for now.

Task portageGentoo

lunarLunar

sorcerySource Mage

Managing software  

Install new software frompackage repository

emerge pkg  lin pkg  cast pkg 

Install new software frompackage file

 

Update existing software emerge pkg  lin pkg  cast pkg 

Remove unwanted software emerge -aC pkg  lrm pkg  dispel pkg 

Updating the system  

Update package list emerge --sync lin moonbase scribe updateUpdate system emerge -NuDa world lunar update sorcery upgrade

Searching for packages  

Search by package name emerge --search pkg  lvu search pkg  gaze search -name pkg 

Search by pattern emerge --search pattern  lvu search pattern  gaze search pattern 

Search by file name equery belongs pkg  gaze from file 

Ubuntu 11.04 $2.35

Linux Mint 11 $2.35

Fedora 15 $5.95

Debian 6.0.2.1 $26.95

openSUSE 11.4 $2.35

Sabayon 6 $5.95

PCLinuxOS 2011.6 $2.35

USB Flash Drives

Ubuntu 11.04 4GB $15.95

Linux Mint 11 4GB $15.95

Fedora 15 4GB $15.95

Free Shipping on orders over $20Professional Quality

Click here to visit OSDisc.com now

Linux Identity

Fedora 15 Magazine ($14.99)Fedora stands out from the pack 

due to its polished interface,excellent community support,

cutting-edge software andconstant updates.

 Advertisement

converted by Web2PDFC onvert.com

8/4/2019 Package Mngmt

http://slidepdf.com/reader/full/package-mngmt 4/4

List installed packages qlist -I lvu installed gaze installed

Configuring access tosoftware repositories

 

List repositories layman -L -- scribe index

 Add repository layman -a repo  -- scribe add repo 

Remove repository layman -d repo  -- scribe remove repo 

FreeBSD

Finally, a table for FreeBSD, a popular operating system offering both binary and source package management.

Task packagesFreeBSD

portsFreeBSD

Managing software  

Install new software frompackage repository

pkg_add -r package  cd port_dir && make && make install

Install new software frompackage file

pkg_add path_to_package  --

Update existing software pkg_add path_to_package  portupgrade -R pkg 

Remove unwanted software pkg_delete pkg  pkg_delete pkg 

Updating the system freebsd-update fetch install portsnap fecth install

Update package listcsup -L 2 -h cvsup.FreeBSD.org

path_to_supfile 

portsnap update

Update systemportupgrade -aportmanager -uportmaster -a

Searching for packages  

Search by package name cd /usr/ports && make search pkg 

Search by pattern cd /usr/ports && make search pattern 

Search by file name

List installed packages pkg_info pkg_info

Configuring access tosoftware repositories

 

List repositories -- --

 dd repository -- --

Remove repository -- --

Copyright © 2011 DistroWatch.com .

Verbatim copying and distribution of this entire article is permitted in any medium, provided this copyright notice is preserved.

Linux Guides/Whitepapers

NEW! 50 Uses For Live CDs

NEW! This FREE 31-page manuallists things you can accomplish

with a live CD, from data recoveryto virus removal to trying out cool

operating systems.

Latest Books

Linux Bible 2011 Edition: Boot up toUbuntu, Fedora, KNOPPIX, Debian,

openSUSE, and 13 OtherDistributions

Copyright (C) 2001 - 2011 DistroWatch.com. All rights reserved. All trademarks are the property of their respective owners. Privacy policy. DistroWatch.com is hosted atGreen Bay and mirrored at Dallas and Wien.

Contact, corrections and suggestions: Ladislav Bodnar --

DistroWatch.com is hosted by NetSonic.net (since November 2004). If you need a reliable Debian/Fedora/FreeBSD/Red Hat web hosting solution with excellentsupport, we highly recommend NetSonic.net.

converted by Web2PDFC onvert.com