We are still actively working on the spam issue.

Difference between revisions of "Package manager"

From InstallGentoo Wiki
Jump to: navigation, search
(GNU/Linux)
(Finish converting to wikitable)
(20 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{Cleanup}}
+
''If you spot that the commands for the package manager of your favourite distribution are incorrect, feel free to add them or fix them in this page.''
  
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 to 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 [[yum]] (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 ==
+
{{note|All apt-get commands are interchangeable with apt. The two are technically separate packages, but apt is more feature-filled. It has progress-bars, for example}}
  
You run it like this:   
+
{| class="wikitable"
 +
! command !! description
 +
|-
 +
|apt-get install <package> || Installs a package
 +
|-
 +
|apt-get purge <package> || removes package (with data)
 +
|-
 +
| apt-get remove <package> || removes package
 +
|-
 +
|apt-get --purge autoremove || removes orphaned packages
 +
|-
 +
| apt-get update || updates package list
 +
|-
 +
| apt-get upgrade || upgrades packages
 +
|-
 +
| apt-get full-upgrade || Upgrades the entire system, and the distro
 +
|-
 +
|apt-get clean || cleans the package-cache
 +
|-
 +
|apt-cache search <query> || search the package-cache with a query
 +
|-
 +
|apt-get build-dep <package> || downloads dependencies for building a package per apt instructions
 +
|}
 +
=== dnf ===
  
To install: <code>sudo apt-get install <package></code>
+
See page: [[DNF]]
  
To update the package list: <code>sudo apt-get update</code>
+
=== 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.
  
To upgrade existing packages:  <code>sudo apt-get upgrade</code>
+
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".)
  
To remove a package: <code>sudo apt-get remove <package></code>
+
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 clean the apt-cache: <code>sudo apt-get clean</code>
+
{| class="wikitable"
 +
! command !! description
 +
|-
 +
| zypper in <package> || installs a package
 +
|-
 +
|zypper rm <package> || removes a package
 +
|-
 +
|zypper up || updates package-cache
 +
|-
 +
| zypper se <query> || searches package-cache
 +
|-
 +
| zypper ar <repo> || add a third-party repository to the package-cache
 +
|-
 +
| zypper rr <repo> || remove a third-party repository to the package-cache
 +
|}
  
To search for a package with <package> in its name or "Provides" list: <code>apt-cache search --names-only <package></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.
  
To search for a package with <query> in its description: <code>apt-cache search <query></code>
+
{| class="wikitable"
 +
! command !! description
 +
|-
 +
| emerge --sync || To update the ports tree
 +
|-
 +
| emerge --update --deep --with-bdeps=y --newuse @world || To upgrade installed packages
 +
|-
 +
| emerge --search <query> || To search for a package with a query
 +
|-
 +
| emerge <package> || To install (download and compile) a package
 +
|-
 +
| emerge --unmerge <package> || To remove a package
 +
|-
 +
| emerge --pretend <package> || To simulate the installation of a package
 +
|-
 +
| emerge --fetchonly <package> || To only download the source code of a package
 +
|-
 +
| emerge --vp <cariable> || To check USE flags for a package
 +
|}
  
To get build dependencies for <package>: <code>sudo apt-get build-dep <package></code>
 
  
To remove unneeded dependencies: <code>sudo apt-get autoremove</code>
+
=== slackpkg ===
  
== yum ==
+
<tt>slackpkg</tt> is Slackware's package manager.
  
is dead. Now Fedora uses DNF.
+
{| class="wikitable"
 +
! command !! description
 +
|-
 +
| slackpkg install <package> || To install a package
 +
|-
 +
| slackpkg remove <package> || To remove a package
 +
|-
 +
| slackpkg search <package> || To search for a package with a query
 +
|-
 +
| slackpkg upgrade-all || To upgrade all installed packages
 +
|-
 +
| slackpkg update || To update the package list
 +
|-
 +
| slackpkg info package || To get information on a package
 +
|}
  
== DNF ==
+
==== Unofficial packages ====
  
Install: <code>sudo dnf install <package></code>
+
The <tt>slackpkg</tt> repositories are limited to Slackware core packages.  Unofficial packages can be downloaded and added with
  
Reinstall packages: <code>sudo dnf reinstall <package</code>
+
<code>upgradepkg --install-new <local_package.tgz></code>
  
Update: <code>sudo dnf upgrade</code> (or just <code>sudo dnf update</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.
  
Update-to: <code>sudo dnf upgrade-to <version</code>
+
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:
 +
<code>upgradepkg --install-new /tmp/package.tgz</code>
  
Remove: <code>sudo dnf remove <package></code>
+
=== pacman ===
  
Check for package upgrades: <code>sudo dnf check-update</code>
+
See the [[Pacman|pacman]] page and also [[Yaourt|yaourt]] for the pacman wrapper.
  
Downgrade packages: <code>sudo dnf downgrade <package></code>
+
=== xbps ===
 +
{| class="wikitable"
 +
! command !! description
 +
|-
 +
| xbps-install -Su || To both update the package list and upgrade all installed packages
 +
|-
 +
| xbps-install -Su <package> || To both update the package list and install a package
 +
|-
 +
| xbps-remove -R <package> || To remove a package
 +
|}
  
Upgrade packages: <code>sudo dnf upgrade <package></code>
+
== *BSD ==
 
 
Cache clean: <code> sudo dnf clean</code>
 
 
 
Search: <code>sudo dnf search <package></code>
 
 
 
Remove unneeded dependencies: <code>sudo dnf autoremove</code>
 
 
 
== 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.
 
 
 
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
 
 
 
<code> zypper up </code>
 
updates
 
 
 
<code> zypper se <name of package> </code> searches
 
 
 
original forms can be used instead of short forms:
 
*se = search
 
*up = update
 
*in = install
 
*etc.
 
 
 
== portage ==
 
 
 
sync:
 
 
 
<code> emerge --sync </code>
 
 
 
search:
 
 
 
<code> emerge --search <variable> </code>
 
 
 
search description:
 
 
 
<code> emerge --searchdesc <variable> </code>
 
 
 
install:
 
 
 
<code> emerge <variable> </code>
 
 
 
uninstall:
 
 
 
<code> emerge --unmerge <variable> </code>
 
 
 
pretend install:
 
 
 
<code> emerge --pretend <variable> </code>
 
 
 
fetch source only:
 
 
 
<code> emerge --fetchonly <variable> </code>
 
 
 
check USE flags:
 
 
 
<code> emerge -vp <variable> </code>
 
 
 
full system update:
 
 
 
<code> emerge --update --deep --with-bdeps=y --newuse @world </code>
 
 
 
==slackpkg==
 
 
 
Slackpkg is Slackware's package manager.
 
 
 
Install a package
 
 
 
<code>slackpkg install PACKAGE</code>
 
 
 
Remove a package
 
 
 
<code>slackpkg remove PACKAGE</code>
 
 
 
Search for a package
 
 
 
<code>slackpkg search PACKAGE</code>
 
 
 
Upgrade a package
 
 
 
<code>slackpkg upgrade PACKAGE</code>
 
 
 
Update the repository listings
 
 
 
<code>slackpkg update</code>
 
 
 
Get information on a package
 
 
 
<code>slackpkg info PACKAGE</code>
 
 
 
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.
 
 
 
= *BSD =
 
 
 
There are two main ways to install software on *BSDs: through binaries (pkg) or compiled sources (ports)
 
 
 
== pkg ==
 
  
 
=== FreeBSD ===
 
=== FreeBSD ===
  
Speaks for itself (replace ''packagename'' with your actual package name obviously):
+
Speaks for itself:
 
 
<code>pkg install ''packagename''</code>
 
  
<code>pkg delete ''packagename''</code>
+
{| class="wikitable"
 
+
! command !! description
<code>pkg info ''packagename''</code>
+
|-
 
+
| pkg install <package> || To install a package
<code>pkg search ''packagename''</code>
+
|-
 
+
| pkg delete <package> || To remove a package
<code>pkg upgrade</code>
+
|-
 
+
| pkg info <package> ||  To show a description of the package
<code>pkg autoremove</code>
+
|-
 +
| pkg search <package> || To search for a package with a query
 +
|-
 +
| pkg upgrade || To upgrade all installed packages
 +
|-
 +
| pkg autoremove || To remove all orphaned packages
 +
|}
  
 
=== OpenBSD ===
 
=== OpenBSD ===
  
<code>pkg_add ''packagename''</code>
+
{| class="wikitable"
 
+
! command !! description
<code>pkg_delete ''packagename''</code>
+
|-
 
+
| pkg_add <package> || To install a package
<code>pkg_info ''packagename''</code>
+
|-
 
+
| pkg_delete <package> || To remove a package
<code>pkg_add -u ''packagename''</code> to upgrade ''packagename'' -- if you don't supply a ''packagename'' it will upgrade everything
+
|-
 
+
| pkg_info <package> || To show a description of a package
== 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:
 
 
 
<code>cd /usr/ports/net-im/qTox</code>
 
 
 
<code>make install clean</code>
 
  
= 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>
+
{| class="wikitable"
 
+
! command !! description
<code>brew uninstall ''formula''</code>
+
|-
 
+
| brew install <package> || To install a package
<code>brew tap ''repo''</code>
+
|-
 
+
| brew uninstall <package> || To remove a package
<code>brew update</code>
+
|-
 
+
| brew tap <repo> || To add a third-party repo
<code>brew upgrade</code>
+
|-
 
+
| brew update || Update package cache
<code>brew help</code>
+
|-
 +
| brew upgrade || upgrade the system
 +
|-
 +
| brew help || Give help information for using the Brew package manager
 +
|}
  
 +
[[Category:Package manager]]
 +
[[Category:Software]]
 +
[[Category:Terms]]
 
[[Category:GNU/Linux]]
 
[[Category:GNU/Linux]]
[[Category:Package manager]]
 

Revision as of 07:26, 8 May 2019

If you spot that the commands for the package manager of your favourite distribution are incorrect, feel free to add them or fix them in this page.

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.

Note: All apt-get commands are interchangeable with apt. The two are technically separate packages, but apt is more feature-filled. It has progress-bars, for example
command description
apt-get install <package> Installs a package
apt-get purge <package> removes package (with data)
apt-get remove <package> removes package
apt-get --purge autoremove removes orphaned packages
apt-get update updates package list
apt-get upgrade upgrades packages
apt-get full-upgrade Upgrades the entire system, and the distro
apt-get clean cleans the package-cache
apt-cache search <query> search the package-cache with a query
apt-get build-dep <package> downloads dependencies for building a package per apt instructions

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
command description
zypper in <package> installs a package
zypper rm <package> removes a package
zypper up updates package-cache
zypper se <query> searches package-cache
zypper ar <repo> add a third-party repository to the package-cache
zypper rr <repo> remove a third-party repository to the package-cache

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.

command description
emerge --sync To update the ports tree
emerge --update --deep --with-bdeps=y --newuse @world To upgrade installed packages
emerge --search <query> To search for a package with a query
emerge <package> To install (download and compile) a package
emerge --unmerge <package> To remove a package
emerge --pretend <package> To simulate the installation of a package
emerge --fetchonly <package> To only download the source code of a package
emerge --vp <cariable> To check USE flags for a package


slackpkg

slackpkg is Slackware's package manager.

command description
slackpkg install <package> To install a package
slackpkg remove <package> To remove a package
slackpkg search <package> To search for a package with a query
slackpkg upgrade-all To upgrade all installed packages
slackpkg update To update the package list
slackpkg info package To get information on a 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

command description
xbps-install -Su To both update the package list and upgrade all installed packages
xbps-install -Su <package> To both update the package list and install a package
xbps-remove -R <package> To remove a package

*BSD

FreeBSD

Speaks for itself:

command description
pkg install <package> To install a package
pkg delete <package> To remove a package
pkg info <package> To show a description of the package
pkg search <package> To search for a package with a query
pkg upgrade To upgrade all installed packages
pkg autoremove To remove all orphaned packages

OpenBSD

command description
pkg_add <package> To install a package
pkg_delete <package> To remove a package
pkg_info <package> To show a description of a 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

command description
brew install <package> To install a package
brew uninstall <package> To remove a package
brew tap <repo> To add a third-party repo
brew update Update package cache
brew upgrade upgrade the system
brew help Give help information for using the Brew package manager