Difference between revisions of "Package managers"

From OpenVZ Virtuozzo Containers Wiki
Jump to: navigation, search
(some more)
Line 40: Line 40:
 
! 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''</code>
|| <code>-???-</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>
 
|-
 
|-
 
! Upgrade a package from local ''package_file''
 
! Upgrade a package from local ''package_file''
 
|| <code>rpm -Uhv ''package_file*.rpm''</code>
 
|| <code>rpm -Uhv ''package_file*.rpm''</code>
|| <code>-???-</code>
+
|| <code>dpkg -i ''package_file*.deb'' <ref name="apt"/></code>
 
|| <code>-???-</code>
 
|| <code>-???-</code>
 
|-
 
|-
 
! Remove an installed ''package''
 
! Remove an installed ''package''
 
|| <code>rpm -e ''package''</code>
 
|| <code>rpm -e ''package''</code>
|| <code>-???-</code>
+
|| <code>dpkg -r ''package''</code>
 
|| <code>emerge --unmerge ''package''</code><br/>
 
|| <code>emerge --unmerge ''package''</code><br/>
 
<code>emerge --prune ''package''</code>
 
<code>emerge --prune ''package''</code>
 
|-|}
 
|-|}
 +
 +
<references/>

Revision as of 21:30, 13 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.

Feel free to add the missing pieces

  1. 1.0 1.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
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
Package installation/upgrade/removal
Install a package from local package_file rpm -ihv package_file*.rpm dpkg -i package_file*.deb [1] -???-
Upgrade a package from local package_file rpm -Uhv package_file*.rpm dpkg -i package_file*.deb [1] -???-
Remove an installed package rpm -e package dpkg -r package emerge --unmerge package

emerge --prune package