We are still actively working on the spam issue.

Difference between revisions of "Package manager"

From InstallGentoo Wiki
Jump to: navigation, search
m (Chocolate Chip moved page Package manager on wheels to Package manager over redirect)
Line 1: Line 1:
 
{{Cleanup}}
 
{{Cleanup}}
  
This is the software repositories that you will meet with some *nix os. They are used to download your software in opposition to compiling them from source. In other words they automatate every thing for the dumb shit you are and allow you to install, update and remove the application you need cause youre too retarded to write them by yourself with a magnifying glass and the sun directly on your hard drive.
+
Package managers are used by some operating systems, namely the [[BSD|BSDs]] and also [[GNU/Linux]] to rationalise installation of programs in the operating system, automating installation, removal and in most cases acquiring and searching for packages from a remote repository. There are many package management systems in use by many different families of Linux distributions and operating systems.
The most common package managers are <del>[[yum]]</del> (now DNF) (RHEL - rpm) and [[apt]] ([[Debian]] - deb).
 
  
= GNU/Linux =
+
== GNU/Linux ==
 +
=== apt and dpkg ===
 +
The combination of <tt>dpkg</tt> and the Advanced Packaging Tool is used in Debian and most distributions that have spun off from Debian, namely Ubuntu.
  
== apt ==
+
To install a package:
 +
# apt-get install package
  
You run it like this:  
+
To remove a package:
 +
# apt-get purge package
  
To install: <code>sudo apt-get install <package></code>
+
To remove orphaned packages:
 +
# apt-get --purge autoremove
  
To update the package list: <code>sudo apt-get update</code>
+
To update the package list:
 +
# apt-get update
  
To upgrade existing packages:  <code>sudo apt-get upgrade</code>
+
To upgrade existing packages:  
 +
  # apt-get upgrade
  
To remove a package: <code>sudo apt-get remove <package></code>
+
To clean the package cache:
 +
# apt-get clean
  
To clean the apt-cache: <code>sudo apt-get clean</code>
+
To search for a package with a query:
 +
$ apt-cache search query
  
To search for a package with <package> in its name or "Provides" list: <code>apt-cache search --names-only <package></code>
+
To get build dependencies:
 +
# apt-get build-dep package
  
To search for a package with <query> in its description: <code>apt-cache search <query></code>
+
=== dnf ===
 
 
To get build dependencies for <package>: <code>sudo apt-get build-dep <package></code>
 
 
 
To remove unneeded dependencies: <code>sudo apt-get autoremove</code>
 
 
 
== dnf ==
 
  
 
See page: [[DNF]]
 
See page: [[DNF]]
  
== Zypper ==
+
=== Zypper ===
Zypper is a cli frontend for openSUSEs package manager, libzypp. The .rpm package format is used, but the package manager itself is independent from RHEL.
+
Zypper is a CLI front end for openSUSE's package manager, libzypp. The RPM package format is used, but the package manager itself is independent from Fedora and Red Hat.
 
 
In contrast to most other package managers, zypper does not require the user to update the repository listings manually. the 'update' funcion actually updates the system ( in other words, it does what other package managers refer to as 'upgrading')
 
 
 
usage:
 
 
 
<code> zypper in <name of package> </code>
 
 
 
<code> zypper rm <name of package> </code>
 
 
 
installs or removes a package
 
 
 
<code> zypper ar <repo> </code>
 
 
 
<code> zypper rr <repo> </code>
 
  
adds or removes a repository
+
In contrast to many other package managers, zypper does not require the user to update the repository listings manually. The 'update' function actually updates the system (in other words, it does what other package managers refer to as "upgrading".)
  
<code> zypper up </code>
+
Commands may be given in short form as shown below, which can be expanded to their full English form, for example:
updates
+
* in - install
 +
* rm - remove
 +
* up - update
 +
* se - search
  
<code> zypper se <name of package> </code> searches
+
To install a package:
 +
# zypper in package
  
original forms can be used instead of short forms:
+
To remove a package:
*se = search
+
# zypper rm package
*up = update
 
*in = install
 
*etc.
 
  
== portage ==
+
To update the package list and upgrade existing packages:
 +
# zypper up
  
sync:
+
To search for a package with a query:
 +
$ zypper se query
  
<code> emerge --sync </code>
+
To add a repository to the repository list:
 +
# zypper ar repo
  
search:
+
To remove a repository:
 +
# zypper rr repo
  
<code> emerge --search <variable> </code>
+
=== portage ===
 +
Portage is primarily used in the source-based Gentoo and Funtoo distributions, which means that Portage manipulates a ports tree and automates compilation of packages.
  
search description:
+
To update the ports tree:
 +
# emerge --sync
  
<code> emerge --searchdesc <variable> </code>
+
To upgrade installed packages:
 +
# emerge --update --deep --with-bdeps=y --newuse @world
  
install:
+
To search for a package with a query:
 +
# emerge --search query
  
<code> emerge <variable> </code>
+
To install (download and compile) a package:
 +
# emerge package
  
uninstall:
+
To remove a package:
 +
# emerge --unmerge package
  
<code> emerge --unmerge <variable> </code>
+
To simulate the installation of a package:
 +
# emerge --pretend package
  
pretend install:
+
To only download the source code of a package:
 +
# emerge --fetchonly package
  
<code> emerge --pretend <variable> </code>
+
To check USE flags for a package:
 +
# emerge -vp <variable> </code>
  
fetch source only:
+
=== slackpkg ===
  
<code> emerge --fetchonly <variable> </code>
+
<tt>slackpkg</tt> is Slackware's package manager.
  
check USE flags:
+
To install a package:
 +
# slackpkg install package
  
<code> emerge -vp <variable> </code>
+
To remove a package:
 +
# slackpkg remove package
  
full system update:
+
To search for a package with a query:
 +
# slackpkg search package
  
<code> emerge --update --deep --with-bdeps=y --newuse @world </code>
+
To upgrade all installed packages:
 +
# slackpkg upgrade-all
  
==slackpkg==
+
To update the package list:
 +
# slackpkg update
  
Slackpkg is Slackware's package manager.
+
To get information on a package:
 +
# slackpkg info package
  
Install a package
+
==== Unofficial packages ====
  
<code>slackpkg install PACKAGE</code>
+
The <tt>slackpkg</tt> repositories are limited to Slackware core packages.  Unofficial packages can be downloaded and added with
  
Remove a package
+
<code>upgradepkg --install-new local_package.tgz</code>
  
<code>slackpkg remove PACKAGE</code>
+
Slackware also supports building packages from source code or from RPM packages with Slackbuild scripts.  This gives the security and flexibility of building from source with the ease of package-based management.
  
Search for a package
+
To build a Slackbuild, download and extract the Slackbuild tarball, download the source tarball or <tt>.rpm<tt> file and place it in the Slackbuild directory, cd into the Slackbuild directory, optionally edit the configuration file if one exists, run the PROGRAM_NAME.Slackbuild script like so:
 +
# bash ./package.Slackbuild
 +
After the script finishes, the last line should read "Package /tmp/PACKAGE_NAME.tgz successfuly created" if the compilation succeeded.
 +
Install the package like so:
 +
# upgradepkg --install-new /tmp/package.tgz
  
<code>slackpkg search PACKAGE</code>
+
=== pacman ===
  
Upgrade a package
+
See the [[Pacman|pacman]] page and also [[Yaourt|yaourt]] for the pacman wrapper.
  
<code>slackpkg upgrade PACKAGE</code>
+
=== xbps ===
  
Update the repository listings
+
To both update the package list and upgrade all installed packages:
 +
# xbps-install -Su
  
<code>slackpkg update</code>
+
To both update the package list and install a package:
 +
# xbps-install -Su package
  
Get information on a package
+
To remove a package:
 +
# xbps-remove -R package
  
<code>slackpkg info PACKAGE</code>
+
== *BSD ==
 
 
Update all packages
 
 
 
<code>slackpkg upgrade-all</code>
 
 
 
 
 
===Unofficial packages===
 
 
 
The slackpkg repositories are limited to Slackware core packages.  Unofficial packages can be downloaded and added with
 
 
 
<code>upgradepkg --install-new FILENAME</code>
 
 
 
Slackware also supports building packages from source code or .rpm files with Slackbuild scripts.  This gives the security and flexibility of building from source with the ease of package-based management.
 
 
 
Download and extract the Slackbuild tarball
 
 
 
Download the source tarball/.rpm file and place it in the Slackbuild directory
 
 
 
cd into the slackbuild directory
 
 
 
OPTIONAL: Edit the configuration file if one exists and you so desire
 
 
 
Run the PROGRAM_NAME.Slackbuild script
 
 
 
<code>sudo bash PROGRAM_NAME.Slackbuild</code>
 
 
 
After the script finishes, the last line should read "Package /tmp/PACKAGE_NAME.tgz successfuly created"  (Or lots of errors, especially if you forgot the sudo)
 
 
 
Install the package
 
 
 
<code>sudo upgradepkg --install-new /tmp/PACKAGE_NAME.tgz</code>
 
 
 
 
 
Enjoy your overflowing abundance of [[freedom]] and simplicity
 
 
 
 
 
== pacman ==
 
 
 
See the [[Pacman|pacman]] page, or you can see [[Yaourt|yaourt]] page for the pacman wrapper.
 
 
 
== xbps ==
 
 
 
To sync repos
 
 
 
<code>xbps-install -S</code>
 
 
 
To install packages
 
 
 
<code>xbps-install <name of package></code>
 
 
 
You can also sync and install at the same time.
 
 
 
<code>xbps-install -S <name of package></code>
 
 
 
To upgrade packages
 
 
 
<code>xbps-install -u <name of package OPTIONAL></code>
 
 
 
It is optional because you can upgrade all your packages inside your system, or if you want you can upgrade just one single package.
 
 
 
To remove a package
 
 
 
<code>xbps-remove <name of package></code>
 
 
 
To recursively remove unneeded dependencies that were installed by the target package
 
 
 
<code>xbps-remove -R <name of package></code>
 
 
 
= *BSD =
 
 
 
There are two main ways to install software on *BSDs: through binaries (pkg) or compiled sources (ports)
 
 
 
== pkg ==
 
  
 
=== FreeBSD ===
 
=== FreeBSD ===
Line 205: Line 148:
 
Speaks for itself (replace ''packagename'' with your actual package name obviously):
 
Speaks for itself (replace ''packagename'' with your actual package name obviously):
  
 +
To install a package:
 
<code>pkg install ''packagename''</code>
 
<code>pkg install ''packagename''</code>
  
 +
To remove a package:
 
<code>pkg delete ''packagename''</code>
 
<code>pkg delete ''packagename''</code>
  
 +
To show a description of the package:
 
<code>pkg info ''packagename''</code>
 
<code>pkg info ''packagename''</code>
  
 +
To search for a package with a query:
 
<code>pkg search ''packagename''</code>
 
<code>pkg search ''packagename''</code>
  
 +
To upgrade all installed packages:
 
<code>pkg upgrade</code>
 
<code>pkg upgrade</code>
  
 +
To remove all orphaned packages:
 
<code>pkg autoremove</code>
 
<code>pkg autoremove</code>
  
=== OpenBSD ===
+
==== OpenBSD ====
 
 
<code>pkg_add ''packagename''</code>
 
 
 
<code>pkg_delete ''packagename''</code>
 
 
 
<code>pkg_info ''packagename''</code>
 
 
 
<code>pkg_add -u ''packagename''</code> to upgrade ''packagename'' -- if you don't supply a ''packagename'' it will upgrade everything
 
 
 
== ports ==
 
  
To use the ports system, simply go to your desired port' directory (usually found in /usr/ports/) and compile it. For instance, if you want to install qTox:
+
To install a package:
 +
# pkg_add package
  
<code>cd /usr/ports/net-im/qTox</code>
+
To remove a package:
 +
# pkg_delete package
  
<code>make install clean</code>
+
To show a description of a package:
 +
$ pkg_info package
  
= OS X =
+
== OS X ==
  
On top of the App Store and the [http://www.hack-store.com/ Hack Store], OS X comes with third-party package managers.
+
On top of the App Store and the [http://www.hack-store.com/ Hack Store], third-party package managers resembling those used by GNU/Linux are available.
  
== fink ==
+
=== fink ===
 
See the [https://www.finkproject.org/ main page.]
 
See the [https://www.finkproject.org/ main page.]
  
== macports ==
+
=== macports ===
  
 
See the [https://www.macports.org/ main page.]
 
See the [https://www.macports.org/ main page.]
  
== brew ==
+
=== brew ===
<code>brew install ''formula''</code>
+
To install a package:
 +
# brew install package
  
<code>brew uninstall ''formula''</code>
+
To remove a package:
 +
# brew uninstall package
  
<code>brew tap ''repo''</code>
+
# brew tap repo
  
<code>brew update</code>
+
# brew update
  
<code>brew upgrade</code>
+
# brew upgrade
  
<code>brew help</code>
+
# brew help
  
[[Category:GNU/Linux]]
 
 
[[Category:Package manager]]
 
[[Category:Package manager]]

Revision as of 19:34, 19 December 2015

Cleanup.png
Cleanup.png
CLEANUP CANDIDATE
Relevant discussion may be found on the talk page. Reason: No reason specified.


Package managers are used by some operating systems, namely the BSDs and also GNU/Linux to rationalise installation of programs in the operating system, automating installation, removal and in most cases acquiring and searching for packages from a remote repository. There are many package management systems in use by many different families of Linux distributions and operating systems.

GNU/Linux

apt and dpkg

The combination of dpkg and the Advanced Packaging Tool is used in Debian and most distributions that have spun off from Debian, namely Ubuntu.

To install a package:

# apt-get install package

To remove a package:

# apt-get purge package

To remove orphaned packages:

# apt-get --purge autoremove

To update the package list:

# apt-get update

To upgrade existing packages:

# apt-get upgrade

To clean the package cache:

# apt-get clean

To search for a package with a query:

$ apt-cache search query

To get build dependencies:

# apt-get build-dep package

dnf

See page: DNF

Zypper

Zypper is a CLI front end for openSUSE's package manager, libzypp. The RPM package format is used, but the package manager itself is independent from Fedora and Red Hat.

In contrast to many other package managers, zypper does not require the user to update the repository listings manually. The 'update' function actually updates the system (in other words, it does what other package managers refer to as "upgrading".)

Commands may be given in short form as shown below, which can be expanded to their full English form, for example:

  • in - install
  • rm - remove
  • up - update
  • se - search

To install a package:

# zypper in package

To remove a package:

# zypper rm package

To update the package list and upgrade existing packages:

# zypper up

To search for a package with a query:

$ zypper se query

To add a repository to the repository list:

# zypper ar repo

To remove a repository:

# zypper rr repo

portage

Portage is primarily used in the source-based Gentoo and Funtoo distributions, which means that Portage manipulates a ports tree and automates compilation of packages.

To update the ports tree:

# emerge --sync

To upgrade installed packages:

# emerge --update --deep --with-bdeps=y --newuse @world

To search for a package with a query:

# emerge --search query

To install (download and compile) a package:

# emerge package

To remove a package:

# emerge --unmerge package

To simulate the installation of a package:

# emerge --pretend package

To only download the source code of a package:

# emerge --fetchonly package

To check USE flags for a package:

# emerge -vp <variable> 

slackpkg

slackpkg is Slackware's package manager.

To install a package:

# slackpkg install package

To remove a package:

# slackpkg remove package

To search for a package with a query:

# slackpkg search package

To upgrade all installed packages:

# slackpkg upgrade-all

To update the package list:

# slackpkg update

To get information on a package:

# slackpkg info package

Unofficial packages

The slackpkg repositories are limited to Slackware core packages. Unofficial packages can be downloaded and added with

upgradepkg --install-new local_package.tgz

Slackware also supports building packages from source code or from RPM packages with Slackbuild scripts. This gives the security and flexibility of building from source with the ease of package-based management.

To build a Slackbuild, download and extract the Slackbuild tarball, download the source tarball or .rpm file and place it in the Slackbuild directory, cd into the Slackbuild directory, optionally edit the configuration file if one exists, run the PROGRAM_NAME.Slackbuild script like so:

# bash ./package.Slackbuild

After the script finishes, the last line should read "Package /tmp/PACKAGE_NAME.tgz successfuly created" if the compilation succeeded. Install the package like so:

# upgradepkg --install-new /tmp/package.tgz

pacman

See the pacman page and also yaourt for the pacman wrapper.

xbps

To both update the package list and upgrade all installed packages:

# xbps-install -Su

To both update the package list and install a package:

# xbps-install -Su package

To remove a package:

# xbps-remove -R package

*BSD

FreeBSD

Speaks for itself (replace packagename with your actual package name obviously):

To install a package: pkg install packagename

To remove a package: pkg delete packagename

To show a description of the package: pkg info packagename

To search for a package with a query: pkg search packagename

To upgrade all installed packages: pkg upgrade

To remove all orphaned packages: pkg autoremove

OpenBSD

To install a package:

# pkg_add package

To remove a package:

# pkg_delete package

To show a description of a package:

$ pkg_info package

OS X

On top of the App Store and the Hack Store, third-party package managers resembling those used by GNU/Linux are available.

fink

See the main page.

macports

See the main page.

brew

To install a package:

# brew install package

To remove a package:

# brew uninstall package
# brew tap repo
# brew update
# brew upgrade
# brew help