pkg_mgm

Upload: dragan-popovic

Post on 07-Apr-2018

226 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/3/2019 pkg_mgm

    1/5

    Type Distribution Name Go elect Distribution Go

    Home Page DW Weekly, Comments Package Management Packages

    Search Major Distributions Submit Distribution Upcoming Releases

    About DistroWat FAQ Advertise Related Links

    Advertisement Get the brand-new release of Mandriva Linux 2011 on live DVD ($5.95) or live USB drive (from $14.95)

    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 offersome 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), thesetypes 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 nodenying 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 managementcommands each time they switch from one distribution group to another. Additionally, the package management tools tend to evolve, with new features andeven new commands added to every new version. This is why we created this package management cheatsheet - an easy reference card covering mostfrequently used package management tasks in Linux distributions and FreeBSD. As always, we welcome corrections, updates and suggestions - if you spoany 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 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 (includingUbuntu, Linux Mint, KNOPPIX, aptosid and other Debian derivatives), openSUSE, Fedora (including Red HatEnterprise Linux, CentOS, Scientific Linux and other Fedora-based distributions), and Mandriva Linux and Mageia.

    Taskapt (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 pkgyum localinstall

    pkgurpmi pkg

    Update existing software apt-get install pkgzypper 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 update

    aptitude updatezypper refresh yum check-update urpmi.update -a

    Update systemapt-get upgrade

    aptitude safe-upgrade

    zypper update yum update urpmi --auto-select

    Searching for packages

    Search by package nameapt-cache search

    pkgzypper search pkg yum list pkg urpmq pkg

    Search

    Search

    Advertisement

  • 8/3/2019 pkg_mgm

    2/5

    Search by patt ern apt -c ac he s earc hpattern

    zypper search -tpattern pattern

    yum s earch pattern urpmq --fuzzy pkg

    Search by fi le name apt-fi le 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

    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-baseddistributions. As stated by Patrick Volkerding on several occasions, Slackware is unlikely to ever have anyadvanced (i.e. dependency-resolving) package management tool, so all installation, upgrade and removal taskscontinue to be performed with pkgtools , 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 theunsupported "extra" repository, was finally made part of Slackware Linux 12.2. It's worth noting that some popularSlackware derivatives, such as VectorLinux, have standardised on slapt-get, another third-party utility imitating thebehaviour of Debian's APT, while Zenwalk Linux has introduced its own package management tool called netpkg.

    Taskpkgtools

    Slackwareslackpkg

    Slackwareslapt-get

    Vectornetpkg

    Zenwalk

    Managing software

    Install new software frompackage repository

    -- slackpkg install pkgslapt-get --install

    pkgnetpkg pkg

    Install new software frompackage file

    installpkg pkg slackpkg install pkgslapt-get --install

    pkgnetpkg pkg

    Update existing software upgradepkg pkgslackpkg upgrade

    pkgslapt-get --install

    pkgnetpkg pkg

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

    pkgnetpkg remove pkg

    Updating the system

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

    Update system -- s lac kpk g upgrade-all slapt-get --upgrade netpkg upgrade

    Searching for packages

    Search by package name -- slackpkg search pkg slapt-get --searchpkg netpkg pkg repo

    Search by pattern --slackpkg s earch

    patternslapt-get --search

    patternnetpkg list | grep

    pattern

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

    List installed packagesls

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

    Configuring access tosoftware 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 utilitycalled equo. Arch Linux's Pacman has been around for a long time and it's often considered one of the fastestpackage management utilities around. Conary, developed by rPath and popularised by Foresight Linux, is acompletely new approach to package management, created by well-known ex-Red Hat engineers with many yearsof package management experience. In contrast, PiSi by Pardus Linux is a relatively new utility, but the distributionitself has been growing fast in the last couple of years.

    equo pacman conary pisi

    Latest Books

    Guide to Operating Systems

    Free Linux Guides

    Linux LPIC 101 Free 15-MinuteGuide

    Helios DownloadsFASTFree optimized mirrorsfor maximum downloadspeed - Helios &pluginswww.poweredbypulse.com

    BrainstormingSoftwareGet a free 30-day Trial

    of MM2012 the leadingBrainstorming Tool!www.Mindjet.com

    LinuxLIVE forLinux PCsSuspend-Resume,Sharing, Mobility andRe-Connect to RemoteX Sessionswww.starnet.com

    Free Trial - BulkEmailEmail marketing to fityour needs. Start aFree 30-Day Trial

    Today.www.iContact.com

    Mail ForwardingServiceGet your Mail andPackages anywherewith your own USAstreet address!www.USA2me.com

  • 8/3/2019 pkg_mgm

    3/5

  • 8/3/2019 pkg_mgm

    4/5

    Source Based Distributions

    Next, a table for source-based distributions. Gentoo's Portage is well-documented and widely used, but otherdistributions that are designed to be built from scratch don't often feature in the Linux media, so their packagemanagement systems are not particularly well-known. Sorcerer, which existed even before Gentoo Linux wasconceived, uses Bash scripts to "cast spells" or download, install and compile packages. Sorcerer was later forkedinto 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 online documentation so it has been omitted for now.

    TaskportageGentoo

    lunarLunar

    sorcerySource Mage

    Managing software

    Install new software from

    package repository emerge pkg lin pkg cast pk g

    Install new software frompackage file

    Update exist ing s oft ware 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 update

    Update 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 patt ern emerge --s earc h pattern lvu search pattern gaze search pattern

    Search by file name equery belongs pkg gaze from file

    List installed packages qlist -I lvu installed gaze installedConfiguring 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.

    TaskpackagesFreeBSD

    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

    Rem ove unwant ed s oft ware pk g_delet e 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_supfileportsnap update

    Update systemportupgrade -aportmanager -u

    portmaster -a

    Searching for packagesSearch 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 -- --

    Add repository -- --

    Remove repository -- --

    Free Linux Guides

    Ruby on Rails 3 Essential Tra inin

    Create full-featured, object-oriented web applications with

    Ruby on Rails

    Free video training tutorials

    Latest Books

  • 8/3/2019 pkg_mgm

    5/5

    Copyright 2011 DistroWatch.com.

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

    The Official Ubuntu Book (6thEdition)

    Copyright (C) 2001 - 2011 DistroWatch.com. All rights reserved. All trademarks are the property of their respective owners. Privacy policy. DistroWatch.comis hosted at Green Bay and mirrored at Karlsruhe 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

    excellent support, we highly recommend NetSonic.net.