Difference between revisions of "Package managers"

From OpenVZ Virtuozzo Containers Wiki
Jump to: navigation, search
(added yum localinstall, info about getting package dependencies)
Line 1: Line 1:
 
With OpenVZ, you can run many different Linux distributions on a single box. One particular thing in which distributions differ is package management. This article summarizes how to perform various common package management tasks on a different distributions.
 
With OpenVZ, you can run many different Linux distributions on a single box. One particular thing in which distributions differ is package management. This article summarizes how to perform various common package management tasks on a different distributions.
 
'''Feel free to add the missing pieces'''
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 36: Line 34:
 
|| <code>equery belongs ''file''</code>
 
|| <code>equery belongs ''file''</code>
 
|-
 
|-
| colspan="4" align="center" | '''Package installation/upgrade/removal'''
+
| colspan="4" align="center" | '''Local package installation/upgrade/removal'''
 
|-
 
|-
 
! Install a package from local ''package_file''
 
! Install a package from local ''package_file''
|| <code>rpm -ihv ''package_file*.rpm''</code>
+
|| <code>rpm -ihv ''package_file*.rpm''<br/>yum localinstall ''package_file*.rpm''<ref name="localinstall">In case there are unsatisfied dependencies for ''package_file'', yum will try to get and install it from known repositores.</ref></code>
 
|| <code>dpkg -i ''package_file*.deb'' <ref name="apt">Usually it is not necessary to download packages manually and install them. Use apt-cache search ''name'' to search for package in configured repositories and apt-get install ''package'' to install package and all it's dependencies</ref></code>
 
|| <code>dpkg -i ''package_file*.deb'' <ref name="apt">Usually it is not necessary to download packages manually and install them. Use apt-cache search ''name'' to search for package in configured repositories and apt-get install ''package'' to install package and all it's dependencies</ref></code>
 
|| <code>-???-</code>
 
|| <code>-???-</code>
Line 53: Line 51:
 
|| <code>emerge --unmerge ''package''</code><br/>
 
|| <code>emerge --unmerge ''package''</code><br/>
 
<code>emerge --prune ''package''</code>
 
<code>emerge --prune ''package''</code>
|-|}
+
|-
 +
| colspan="4" align="center" | '''Get information about package interdependencies'''
 +
|-
 +
! What a given ''package'' provides?
 +
|| <code>rpm -q --provides ''package''</code>
 +
|| <code>-???-</code>
 +
|| <code>-???-</code>
 +
|-
 +
! What a given ''package'' requires?
 +
|| <code>rpm -q --provides ''package''</code>
 +
|| <code>-???-</code>
 +
|| <code>-???-</code>
 +
|-
 +
! What package(s) provide a given ''dependency''<ref name="dep">In rpm world, a ''dependency'' can be a package name, a file, or a special atom like <code>perl(IO::Zlib)</code> for a perl module. In deb world, this can be either real or virtual package name.</ref>?
 +
|| <code>rpm -q --whatprovides ''dependency''</code>
 +
|| <code>-???-</code>
 +
|| <code>-???-</code>
 +
|-
 +
! What package(s) require a given ''dependency''<ref name="dep"/>?
 +
|| <code>rpm -q --whatrequires ''dependency''</code>
 +
|| <code>-???-</code>
 +
|| <code>-???-</code>
 +
|}
  
 
<references/>
 
<references/>

Revision as of 16:49, 14 November 2007

With OpenVZ, you can run many different Linux distributions on a single box. One particular thing in which distributions differ is package management. This article summarizes how to perform various common package management tasks on a different distributions.

Action RPM
RHEL, Fedora, CentOS, Mandrake, ...
DEB
Debian, Ubuntu
Ebuild
Gentoo, Sabayon
Basic queries
List of all installed packages rpm -qa dpkg -l equery list
List of installing packages matching substr rpm -qa \*substr\* dpkg -l \*substr\* equery list substr
Basic information about an installed package rpm -qi package dpkg -p package -???-
List of files in a given package rpm -ql package dpkg -L package equery files package
Which package a file belongs to? rpm -qf file dpkg -S file equery belongs file
Local package installation/upgrade/removal
Install a package from local package_file rpm -ihv package_file*.rpm
yum localinstall package_file*.rpm[1]
dpkg -i package_file*.deb [2] -???-
Upgrade a package from local package_file rpm -Uhv package_file*.rpm dpkg -i package_file*.deb [2] -???-
Remove an installed package rpm -e package dpkg -r package emerge --unmerge package

emerge --prune package

Get information about package interdependencies
What a given package provides? rpm -q --provides package -???- -???-
What a given package requires? rpm -q --provides package -???- -???-
What package(s) provide a given dependency[3]? rpm -q --whatprovides dependency -???- -???-
What package(s) require a given dependency[3]? rpm -q --whatrequires dependency -???- -???-
  1. In case there are unsatisfied dependencies for package_file, yum will try to get and install it from known repositores.
  2. 2.0 2.1 Usually it is not necessary to download packages manually and install them. Use apt-cache search name to search for package in configured repositories and apt-get install package to install package and all it's dependencies
  3. 3.0 3.1 In rpm world, a dependency can be a package name, a file, or a special atom like perl(IO::Zlib) for a perl module. In deb world, this can be either real or virtual package name.