Package linux

De Xavi
Dreceres ràpides: navegació, cerca

http://distrowatch.com/weekly.php?issue=20080922#feature

Linux package management cheatsheet

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. Some distributions, as demonstrated recently by openSUSE and its brand new ZYpp tool, go as far as developing a completely new package management utility. Others, like Debian, now discourage the use of some established utilities (apt-get) in favour of better alternatives (aptitude) for system upgrades. All these changes make it hard to keep up with different distributions and their package management tools.

So as a feature article of this week's DistroWatch Weekly, we decided to do something different: create a package management cheatsheet that would list popular package management commands in Linux distributions. The first version of this is available in the tabular format below, but we suspect that this won't be the final one. As we receive feedback and suggestions to add tasks and corrections to possible errors, we will expand the table, then convert it into one or two printable formats (e.g. OASIS OpenDocument spreadsheet and PDF), so that everybody can download it, print it out, and keep it handy for that next big distro switch.

So without further ado, here is the initial table listing a few popular package management tasks in Debian and Debian-based distributions (Ubuntu, Linux Mint, etc), openSUSE, Fedora and Fedora-based distributions (CentOS, Red Hat, etc), Mandriva, Slackware (using slackpkg, which is not part of a standard Slackware installation, but is available in the /extra repository), Arch Linux, rPath Linux and its derivatives, and Pardus Linux.

Task apt
Debian, Ubuntu
zypp
openSUSE
yum
Fedora, CentOS
urpmi
Mandriva
Install package apt-get install <pkg> zypper install <pkg> yum install <pkg> urpmi <pkg>
Remove package apt-get remove <pkg> zypper remove <pkg> yum erase <pkg> urpme <pkg>
Update package list apt-get update zypper refresh yum check-update urpmi.update -a
Update system apt-get upgrade zypper update yum update urpmi --auto-select
List repositories cat /etc/apt/sources.list zypper 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.removemedia <media>
Search package apt-cache search <pkg> zypper search <pkg> yum search <pkg> urpmf <pkg>
List installed packages dpkg -l rpm -qa rpm -qa rpm -qa
Task slackpkg
Slackware
pacman
Arch
conary
rPath, Foresight
pisi
Pardus
Install package slackpkg install <pkg> pacman -S <pkg> conary update <pkg> pisi install <pkg>
Remove package slackpkg remove <pkg> pacman -R <pkg> conary erase <pkg> pisi remove <pkg>
Update package list slackpkg update pacman -Sy   pisi update-repo
Update system slackpkg upgrade-all pacman -Su conary updateall pisi upgrade
List repositories cat /etc/slackpkg/mirrors cat /etc/pacman.conf   pisi list-repo
Add repository (edit /etc/slackpkg/mirrors) (edit /etc/pacman.conf)   pisi add-repo <name> <path>
Remove repository (edit /etc/slackpkg/mirrors) (edit /etc/pacman.conf)   pisi remove-repo <name>
Search package -- pacman -Qs <pkg> conary query <pkg> pisi search <pkg>
List installed packages ls /var/log/packages/ pacman -Qii conary query pisi list-installed


Eines de l'usuari
Espais de noms
Variants
Accions
Navegació
Eines