Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Package manager
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Functions== [[File:Pms.svg|thumb|Illustration of a package manager being used to [[download]] new software. Manual actions can include accepting a license agreement or selecting some package-specific configuration options.]] A software package is an [[archive file]] containing a computer program as well as necessary metadata for its deployment. The computer program can be in [[source code]] that has to be compiled and built first.<ref>Ludovic Courtès, [https://arxiv.org/abs/1305.4584 Functional Package Management with Guix] {{Webarchive|url=https://web.archive.org/web/20200515101137/https://arxiv.org/abs/1305.4584 |date=15 May 2020 }}, June 2013, Madrid, European Lisp Symposium 2013</ref> Package metadata include package description, package version, and dependencies (other packages that need to be installed beforehand). Package managers are charged with the task of finding, installing, maintaining or uninstalling software packages upon the user's command. Typical functions of a package management system include: *Working with [[file archiver]]s to extract package archives *Ensuring the integrity and authenticity of the package by verifying their [[checksum]]s and [[digital certificate]]s, respectively *Looking up, downloading, installing, or updating existing software from a [[software repository]] or [[app store]] *Grouping packages by function to reduce user confusion *Managing dependencies to ensure a package is installed with all packages it requires, thus avoiding "[[dependency hell]]" ===Challenges with shared libraries=== Computer systems that rely on [[dynamic library]] linking, instead of [[static library]] linking, share executable libraries of machine instructions across packages and applications. In these systems, conflicting relationships between different packages requiring different versions of libraries results in a challenge colloquially known as "[[dependency hell]]". On [[Microsoft Windows]] systems, this is also called "[[DLL hell]]" when working with dynamically linked libraries.<ref name="sharedlibrary">{{cite book |first= Chris |last= Tucker |title= 29th International Conference on Software Engineering (ICSE'07) |chapter= OPIUM: Optimal Package Install/Uninstall Manager |publisher= UC San Diego |date= 2007-03-15 |page=1 |doi=10.1109/ICSE.2007.59 |isbn= 978-0-7695-2828-1 |s2cid= 1279451 |url= https://escholarship.org/uc/item/1k07h5vk |chapter-url= http://cseweb.ucsd.edu/~lerner/papers/opium.pdf |archive-url=https://web.archive.org/web/20110614051810/http://cseweb.ucsd.edu/~lerner/papers/opium.pdf |archive-date=2011-06-14 |url-status=live |access-date= 2011-09-14}}</ref> Modern package managers have mostly solved these problems, by allowing parallel installation of multiple versions of a library (e.g. [[OPENSTEP]]'s ''Framework'' system), a dependency of any kind (e.g. ''slots'' in Gentoo [[Portage (software)|Portage]]), and even of packages compiled with different compiler versions (e.g. dynamic libraries built by the [[Glasgow Haskell Compiler]], where a stable [[Application binary interface|ABI]] does not exist), in order to enable other packages to specify which version they were linked or even installed against. ===Front-ends for locally compiled packages=== [[System administrator]]s may install and maintain software using tools other than package management software. For example, a local administrator may [[download]] unpackaged source code, compile it, and install it. This may cause the state of the local system to fall out of [[synchronization (computer science)|synchronization]] with the state of the package manager's [[database]]. The local administrator will be required to take additional measures, such as manually managing some dependencies or integrating the changes into the package manager. There are tools available to ensure that locally compiled packages are integrated with the package management. For distributions based on .deb and [[RPM Package Manager|.rpm]] files as well as [[Slackware|Slackware Linux]], there is [[CheckInstall]], and for recipe-based systems such as [[Gentoo Linux]] and hybrid systems such as [[Arch Linux]], it is possible to write a recipe first, which then ensures that the package fits into the local package database.{{Citation needed|date=July 2007}} ===Maintenance of configuration=== Particularly troublesome with software [[upgrade]]s are upgrades of configuration files. Since package managers, at least on Unix systems, originated as extensions of [[file archiver|file archiving utilities]], they can usually only either overwrite or retain configuration files, rather than applying rules to them. There are exceptions to this that usually apply to kernel configuration (which, if broken, will render the computer unusable after a restart). Problems can be caused if the format of configuration files changes; for instance, if the old configuration file does not explicitly disable new options that should be disabled. Some package managers, such as [[Debian]]'s [[dpkg]], allow configuration during installation. In other situations, it is desirable to install packages with the default configuration and then overwrite this configuration, for instance, in [[Headless system|headless]] installations to a large number of computers. This kind of pre-configured installation is also supported by dpkg. ===Repositories=== To give users more control over the kinds of software that they are allowing to be installed on their system (and sometimes due to legal or convenience reasons on the distributors' side), software is often downloaded from a number of [[software repository|software repositories]].<ref>{{cite web |title=Linux repository classification schemes |date=13 January 2006 |url=http://braintickle.blogspot.com/2006/01/linux-repository-classification.html |publisher=braintickle.blogspot.com |access-date=2008-03-01 |archive-date=11 October 2007 |archive-url=https://web.archive.org/web/20071011053815/http://braintickle.blogspot.com/2006/01/linux-repository-classification.html |url-status=live }}</ref> ===Upgrade suppression=== When a user interacts with the package management software to bring about an upgrade, it is customary to present the user with the list of actions to be executed (usually the list of packages to be upgraded, and possibly giving the old and new version numbers), and allow the user to either accept the upgrade in bulk, or select individual packages for upgrades. Many package managers can be configured to never upgrade certain packages, or to upgrade them only when critical vulnerabilities or instabilities are found in the previous version, as defined by the packager of the software. This process is sometimes called ''version pinning''. For instance: *[[Yellowdog Updater, Modified|yum]] supports this with the syntax ''exclude=openoffice*''<ref>{{cite web |title=CentOS yum pinning rpms|url=http://lists.centos.org/pipermail/centos/2005-May/046320.html|publisher=centos.org|access-date=2008-03-01 |url-status=unfit |archive-url= https://web.archive.org/web/20071102203232/http://lists.centos.org/pipermail/centos/2005-May/046320.html |archive-date= 2007-11-02}}</ref> *[[Pacman (package manager)|pacman]] with ''IgnorePkg= openoffice''<ref name=pacman/> (to suppress upgrading openoffice in both cases) *[[dpkg]] and [[dselect]] support this partially through the ''hold'' flag in package selections *[[Advanced Packaging Tool|APT]] extends the ''hold'' flag through the complex "pinning" mechanism<ref>{{cite web|title=How to keep specific versions of packages installed (complex)|url=https://www.debian.org/doc/manuals/apt-howto/ch-apt-get.en.html#s-pin|publisher=debian.org|access-date=2008-03-01|archive-date=14 November 2019|archive-url=https://web.archive.org/web/20191114111450/https://www.debian.org/doc/manuals/apt-howto/ch-apt-get.en.html#s-pin|url-status=dead}}</ref> (Users can also blacklist a package<ref>{{cite web|title=Apt pinning to blacklist a package|url=http://linux.derkeiler.com/Mailing-Lists/Debian/2009-07/msg00476.html|access-date=2010-08-19|archive-url=https://web.archive.org/web/20110722062625/http://linux.derkeiler.com/Mailing-Lists/Debian/2009-07/msg00476.html|archive-date=22 July 2011|url-status=dead}}</ref>) *[[Aptitude (program)|aptitude]] has "hold" and "forbid" flags *[[Portage (software)|portage]] supports this through the package.mask configuration file <!--(DotPet from .PET packages in [[Puppy Linux]], but is efficient in console and lightweight ?? --> ===Cascading package removal=== Some of the more advanced package management features offer "cascading package removal",<ref name=pacman>{{cite web|title=pacman(8) Manual Page|url=https://www.archlinux.org/pacman/pacman.8.html|website=archlinux.org|access-date=2008-03-01|archive-date=31 August 2019|archive-url=https://web.archive.org/web/20190831034550/https://www.archlinux.org/pacman/pacman.8.html|url-status=live}}</ref> in which all packages that depend on the target package and all packages that only the target package depends on, are also removed. ===Comparison of commands=== Although the commands are specific for every particular package manager, they are to a large extent translatable, as most package managers offer similar functions. <div style="width: 100%; overflow: auto;"> {| class="wikitable plainrowheaders" style="font-size:75%" |+ style="caption-side: bottom; text-align:left;" | {{code|lang=sh|${PKG} }} or {{code|lang=dosbatch|%PKG% }} is the package name. ! Action ! [[Homebrew (package manager)|Homebrew]] ! [[APT (Debian)|apt]] ! [[pacman (Arch Linux)|pacman]] ! [[DNF (software)|dnf]] ([[YUM (software)|yum]]) ! [[portage (software)|portage]]||[[zypper]]<ref>{{cite web|url=https://en.opensuse.org/SDB:Zypper_manual_%28plain%29|title=documentation/sles11|website=en.opensuse.org|access-date=16 August 2017|archive-date=1 December 2022|archive-url=https://web.archive.org/web/20221201032709/https://en.opensuse.org/SDB:Zypper_manual_(plain)|url-status=live}}</ref> ! [[Nix package manager|Nix]] ![[XBPS|xbps]]<ref>{{Cite web |title=XBPS Package Manager - Void Linux Handbook |url=https://docs.voidlinux.org/xbps/index.html |access-date=2022-12-19 |website=docs.voidlinux.org |archive-date=23 January 2023 |archive-url=https://web.archive.org/web/20230123092810/https://docs.voidlinux.org/xbps/index.html |url-status=live }}</ref> ! [[Clear Linux OS|swupd]]<ref>{{cite web|url=https://github.com/clearlinux/swupd-client/blob/master/docs/swupd.1.rst|title=swupd-client/swupd.1.rst at master · clearlinux/swupd-client · GitHub|website=github.com|language=en|access-date=2022-06-22|archive-date=7 December 2022|archive-url=https://web.archive.org/web/20221207105625/https://github.com/clearlinux/swupd-client/blob/master/docs/swupd.1.rst|url-status=live}}</ref> ! [[Windows Package Manager|WinGet]] |- ! scope=row | Install package | {{code|lang=sh|style=white-space:nowrap;|brew install ${PKG} }} | {{code|lang=sh|style=white-space:nowrap;|apt install ${PKG} }} | {{code|lang=sh|style=white-space:nowrap;|pacman -S ${PKG} }} | {{code|lang=sh|style=white-space:nowrap;|dnf install ${PKG} }} | {{code|lang=sh|style=white-space:nowrap;|emerge ${PKG} }} | {{code|lang=sh|style=white-space:nowrap;|zypper in ${PKG} }} | {{code|lang=sh|style=white-space:nowrap;|nix-env -i ${PKG} }} |{{code|lang=sh|style=white-space:nowrap;|xbps-install ${PKG<nowiki>}</nowiki>}} | {{code|lang=sh|style=white-space:nowrap;|swupd bundle-add ${PKG} }} | {{code|lang=dosbatch|style=white-space:nowrap;|winget install %PKG% }} |- ! scope=row | Remove package | {{code|lang=sh|brew uninstall ${PKG} }} | {{code|lang=sh|style=white-space:nowrap;|apt remove ${PKG} }} | {{code|lang=sh|style=white-space:nowrap;|pacman -R ${PKG} }} | {{code|lang=sh|style=white-space:nowrap;|dnf remove --nodeps ${PKG} }} | {{code|lang=sh|style=white-space:nowrap;|emerge -C ${PKG} }} or <br />{{code|lang=sh|style=white-space:nowrap;|emerge --unmerge ${PKG} }} | {{code|lang=sh|style=white-space:nowrap;|zypper rm -RU ${PKG} }} | {{code|lang=sh|style=white-space:nowrap;|nix-env -e ${PKG} }} |{{code|lang=sh|style=white-space:nowrap;|xbps-remove ${PKG<nowiki>}</nowiki>}} | {{code|lang=sh|style=white-space:nowrap;|swupd bundle-remove ${PKG} }} | {{code|lang=dosbatch|style=white-space:nowrap;|winget uninstall %PKG% }} |- ! scope="row" | Update all | {{code|lang=sh|style=white-space:nowrap;|brew upgrade}} | {{code|lang=sh|style=white-space:nowrap;|apt upgrade}} | {{code|lang=sh|style=white-space:nowrap;|pacman -Syu}} | {{code|lang=sh|style=white-space:nowrap;|dnf update}} | {{code|lang=sh|style=white-space:nowrap;|emerge -u -D --with-bdeps{{#tag:nowiki|=}}y @world}} | {{code|lang=sh|style=white-space:nowrap;|zypper up}} | {{code|lang=sh|style=white-space:nowrap;|nix-env -u && nix-collect-garbage}} |{{code|lang=sh|style=white-space:nowrap;|xbps-install -Su}} | {{code|lang=sh|style=white-space:nowrap;|swupd update}} | {{code|lang=dosbatch|style=white-space:nowrap;|winget upgrade --all}} |- ! scope="row" | Update software database | {{code|lang=sh|style=white-space:nowrap;|brew update}} | {{code|lang=sh|style=white-space:nowrap;|apt update}} | {{code|lang=sh|style=white-space:nowrap;|pacman -Sy}} | {{code|lang=sh|style=white-space:nowrap;|dnf check-update}} | {{code|lang=sh|style=white-space:nowrap;|emerge --sync}} | {{code|lang=sh|style=white-space:nowrap;|zypper ref}} | {{code|lang=sh|style=white-space:nowrap;|nix-channel --upgrade}} |{{code|lang=sh|style=white-space:nowrap;|xbps-install -S}} | {{code|lang=sh|style=white-space:nowrap;|swupd update --download}} or <br />{{code|lang=sh|style=white-space:nowrap;|swupd update --update-search-file-index}} | {{code|lang=dosbatch|style=white-space:nowrap;|winget list > NUL }} |- ! scope="row" | Show updatable packages | {{code|lang=sh|style=white-space:nowrap;|brew outdated}} | {{code|lang=sh|style=white-space:nowrap;|apt list --upgradable}} | {{code|lang=sh|style=white-space:nowrap;|pacman -Qu}} | {{code|lang=sh|style=white-space:nowrap;|dnf check-update}} | {{code|lang=sh|style=white-space:nowrap;|emerge -avtuDN --with-bdeps{{#tag:nowiki|=}}y @world}} or <br />{{code|lang=sh|style=white-space:nowrap;|emerge -u --pretend @world}}<br />({{code|-D}} is shorthand for {{code|--deep}} and<br />{{code|-u}} is shorthand for {{code|--update}}.) | {{code|lang=sh|style=white-space:nowrap;|zypper lu}} | {{sxhl|lang=sh|nix-channel --upgrade && \ nix-env -u && \ nix-collect-garbage}} |{{code|lang=sh|style=white-space:nowrap;|./xbps-src update-check ${PKG<nowiki>}</nowiki>}}(requires void-packages repository) | {{code|lang=sh|style=white-space:nowrap;|swupd update -s}} or <br />{{code|lang=sh|style=white-space:nowrap;|swupd check-update}} | {{code|lang=dosbatch|style=white-space:nowrap;|winget upgrade}} |- ! scope="row" | Delete orphans and config | {{code|lang=sh|style=white-space:nowrap;|brew autoremove && brew cleanup}} | {{code|lang=sh|style=white-space:nowrap;|apt autoremove}} | {{code|lang=sh|style=white-space:nowrap;|pacman -Rsn $(pacman -Qdtq)}} | {{code|lang=sh|style=white-space:nowrap;|dnf erase ${PKG} }} | {{code|lang=sh|style=white-space:nowrap;|emerge --depclean}} | {{code|lang=sh|style=white-space:nowrap;|zypper rm -u}} | {{code|lang=sh|style=white-space:nowrap;|nix-collect-garbage -d}} |{{code|lang=sh|style=white-space:nowrap;|xbps-remove -of}} | style="white-space:nowrap;" | {{sxhl|lang=sh|swupd bundle-remove --orphans && \ swupd clean --all}} | {{N/A}} |- ! scope="row" | Show orphans | {{code|lang=sh|style=white-space:nowrap;|brew autoremove --dry-run}} | {{N/A}} | {{code|lang=sh|style=white-space:nowrap;|pacman -Qdt}} | {{code|lang=sh|style=white-space:nowrap;|package-cleanup -q --leaves --exclude-bin}}<br />({{code|-q}} is shorthand for {{code|--quiet}}.) | {{code|lang=sh|style=white-space:nowrap;|emerge -caD}} or <br />{{code|lang=sh|style=white-space:nowrap;|emerge --depclean --pretend}} | {{code|lang=sh|style=white-space:nowrap;|zypper pa --orphaned --unneeded}} | {{N/A}} |{{code|lang=sh|style=white-space:nowrap;|xbps-remove -o}} | {{code|lang=sh|style=white-space:nowrap;|swupd bundle-list --orphans}} | {{N/A}} |- ! scope=row | Remove package (and orphans) | style="white-space:nowrap;" | {{sxhl|lang=sh|brew uninstall ${PKG} && brew autoremove}} | {{code|lang=sh|style=white-space:nowrap;|apt autoremove ${PKG} }} | {{code|lang=sh|style=white-space:nowrap;|pacman -Rs ${PKG} }} | {{code|lang=sh|style=white-space:nowrap;|dnf remove ${PKG} }} | {{code|lang=sh|style=white-space:nowrap;|emerge -c ${PKG} }} or <br />{{code|lang=sh|style=white-space:nowrap;|emerge --depclean ${PKG} }} | {{code|lang=sh|style=white-space:nowrap;|zypper rm -u --force-resolution ${PKG} }} | {{code|lang=sh|style=white-space:nowrap;|nix-env -e ${PKG} && nix-env -u}} |{{code|lang=sh|style=white-space:nowrap;|xbps-remove -R ${PKG<nowiki>}</nowiki>}} | style="white-space:nowrap;" | {{sxhl|lang=sh|swupd bundle-remove ${PKG} && \ swupd bundle-remove --orphans}} | {{code|lang=dosbatch|style=white-space:nowrap;|winget uninstall %PKG% }} |} </div> The [[Arch Linux]] Pacman/Rosetta wiki offers an extensive overview.<ref>{{cite web|url=https://wiki.archlinux.org/index.php/Pacman/Rosetta|title=Pacman/Rosetta – ArchWiki|website=wiki.archlinux.org|language=en|access-date=2017-09-17|archive-date=20 November 2016|archive-url=https://web.archive.org/web/20161120213631/https://wiki.archlinux.org/index.php/Pacman/Rosetta|url-status=live}}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)