Editing Package managers
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.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
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. | ||
− | |||
{| class="wikitable" | {| class="wikitable" | ||
! align="center" | Action | ! align="center" | Action | ||
− | ! RPM<br/><small>RHEL, Fedora, CentOS, | + | ! RPM<br/><small>RHEL, Fedora, CentOS, Mandrake, SUSE, ...</small> |
− | ! DEB<br/><small>Debian | + | ! DEB<br/><small>Debian, Ubuntu</small> |
− | ! Ebuild<br/><small>Gentoo | + | ! Ebuild<br/><small>Gentoo, Sabayon</small> |
− | |||
|- | |- | ||
− | + | | colspan="4" align="center" | '''Basic queries''' | |
|- | |- | ||
! List of all installed packages | ! List of all installed packages | ||
|| <code>rpm -qa</code> | || <code>rpm -qa</code> | ||
|| <code>dpkg -l</code> | || <code>dpkg -l</code> | ||
− | || <code>equery list | + | || <code>equery list</code> |
− | |||
|- | |- | ||
− | ! List of | + | ! List of installing packages matching ''substr'' |
|| <code>rpm -qa ''\*substr\*''</code> | || <code>rpm -qa ''\*substr\*''</code> | ||
|| <code>dpkg -l ''\*substr\*''</code> | || <code>dpkg -l ''\*substr\*''</code> | ||
|| <code>equery list ''substr''</code> | || <code>equery list ''substr''</code> | ||
− | |||
|- | |- | ||
! Basic information about an installed ''package'' | ! Basic information about an installed ''package'' | ||
|| <code>rpm -qi ''package''</code> | || <code>rpm -qi ''package''</code> | ||
− | || <code>dpkg - | + | || <code>dpkg -p ''package''</code> |
− | || <code> | + | || <code>-???-</code> |
− | |||
|- | |- | ||
! List of files in a given ''package'' | ! List of files in a given ''package'' | ||
Line 33: | Line 28: | ||
|| <code>dpkg -L ''package''</code> | || <code>dpkg -L ''package''</code> | ||
|| <code>equery files ''package''</code> | || <code>equery files ''package''</code> | ||
− | |||
|- | |- | ||
− | + | | colspan="4" align="center" | '''Advanced queries''' | |
|- | |- | ||
! Which package a ''file'' belongs to? | ! Which package a ''file'' belongs to? | ||
Line 41: | Line 35: | ||
|| <code>dpkg -S ''file''</code> | || <code>dpkg -S ''file''</code> | ||
|| <code>equery belongs ''file''</code> | || <code>equery belongs ''file''</code> | ||
− | |||
|- | |- | ||
! Check the hash (i.e. MD5 etc.) sums of an installed package | ! Check the hash (i.e. MD5 etc.) sums of an installed package | ||
Line 47: | Line 40: | ||
|| <code>debsums -ca ''package''</code> | || <code>debsums -ca ''package''</code> | ||
|| <code>equery check ''package''</code> | || <code>equery check ''package''</code> | ||
− | |||
|- | |- | ||
! Show pre/post install/uninstall scripts from a ''package'' | ! Show pre/post install/uninstall scripts from a ''package'' | ||
|| <code>rpm -q --scripts ''package''</code> | || <code>rpm -q --scripts ''package''</code> | ||
|| <code>less /var/lib/dpkg/info/''package''.{pre,post,config}*</code> | || <code>less /var/lib/dpkg/info/''package''.{pre,post,config}*</code> | ||
− | || <code> | + | || <code>-???-</code> |
− | |||
|- | |- | ||
! Show change log for a ''package'' | ! Show change log for a ''package'' | ||
|| <code>rpm -q --changelog ''package''</code> | || <code>rpm -q --changelog ''package''</code> | ||
− | || <code> | + | || <code>-???-</code> |
− | || <code> | + | || <code>-???-</code> |
− | |||
|- | |- | ||
− | + | | 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''<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>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 | + | || <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> |
− | |||
|- | |- | ||
! 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>dpkg -i ''package_file*.deb'' <ref name="apt"/></code> | || <code>dpkg -i ''package_file*.deb'' <ref name="apt"/></code> | ||
− | || <code> | + | || <code>-???-</code> |
− | |||
− | |||
|- | |- | ||
! Remove an installed ''package'' | ! Remove an installed ''package'' | ||
− | || <code>rpm -e ''package'' | + | || <code>rpm -e ''package''</code> |
− | |||
|| <code>dpkg -r ''package''</code><br/> | || <code>dpkg -r ''package''</code><br/> | ||
<code>dpkg -P ''package''</code> | <code>dpkg -P ''package''</code> | ||
|| <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" | '''Package installation from repositories''' | |
|- | |- | ||
! Install a ''package'' | ! Install a ''package'' | ||
|| <code>yum install ''package''</code><br/> | || <code>yum install ''package''</code><br/> | ||
<code>urpmi ''package''</code> | <code>urpmi ''package''</code> | ||
− | || <code> | + | || <code>apt-get install ''package''</code><br/> |
− | <code> | + | <code>aptitude install ''package''</code> |
|| <code>emerge -av ''package''</code> | || <code>emerge -av ''package''</code> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
! Only download a ''package'' from repository, do not install | ! Only download a ''package'' from repository, do not install | ||
− | || | + | || <code>-???-</code> |
− | || <code>apt-get install --download-only --reinstall ''package''</code><ref name="dpkgdir">Package will reside in /var/cache/apt/archives.</ref | + | || <code>apt-get install --download-only --reinstall ''package''</code><ref name="dpkgdir">Package will reside in /var/cache/apt/archives.</ref> |
|| <code>emerge -avf ''package''</code><ref name="distfiles">Package sources will reside in /usr/portage/distfiles.</ref> | || <code>emerge -avf ''package''</code><ref name="distfiles">Package sources will reside in /usr/portage/distfiles.</ref> | ||
− | |||
|- | |- | ||
− | + | | colspan="4" align="center" | '''Get information about package interdependencies''' | |
|- | |- | ||
! What a given ''package'' provides? | ! What a given ''package'' provides? | ||
|| <code>rpm -q --provides ''package''</code> | || <code>rpm -q --provides ''package''</code> | ||
|| <code>dpkg-query -W -f='${Provides}\n' ''package''</code> | || <code>dpkg-query -W -f='${Provides}\n' ''package''</code> | ||
− | || <code> | + | || <code>-???-</code> |
− | |||
|- | |- | ||
! What a given ''package'' requires? | ! What a given ''package'' requires? | ||
|| <code>rpm -q --requires ''package''</code> | || <code>rpm -q --requires ''package''</code> | ||
|| <code>dpkg-query -W -f='${Depends}\n' ''package''</code> | || <code>dpkg-query -W -f='${Depends}\n' ''package''</code> | ||
− | || <code> | + | || <code>-???-</code> |
− | |||
|- | |- | ||
! Which installed 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>? | ! Which installed 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>rpm -q --whatprovides ''dependency''</code> | ||
− | || <code> | + | || <code>-???-</code> |
− | || <code> | + | || <code>-???-</code> |
− | |||
|- | |- | ||
! Which installed package(s) require a given ''dependency''<ref name="dep"/>? | ! Which installed package(s) require a given ''dependency''<ref name="dep"/>? | ||
|| <code>rpm -q --whatrequires ''dependency''</code> | || <code>rpm -q --whatrequires ''dependency''</code> | ||
− | || <code> | + | || <code>-???-</code> |
− | + | || <code>-???-</code> | |
− | || <code> | ||
− | |||
|- | |- | ||
− | + | | colspan="4" align="center" | '''Working with package files''' | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | | | ||
− | |||
|- | |- | ||
! Unpack a package ''file'' to local directory | ! Unpack a package ''file'' to local directory | ||
|| <code>rpm2cpio ''file.rpm'' | cpio -id</code> | || <code>rpm2cpio ''file.rpm'' | cpio -id</code> | ||
− | || <code>dpkg -x | + | || <code>dpkg -x ''file.deb'' .</code> |
|| N/A | || N/A | ||
− | |||
|- | |- | ||
! Check package file integrity (checksums, signatures...) | ! Check package file integrity (checksums, signatures...) | ||
− | || <code>rpm -K ''file.rpm | + | || <code>rpm -K ''file.rpm''</code> |
− | + | || -???- | |
− | || | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|| N/A | || N/A | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|} | |} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Notes== | == Notes== | ||
<references/> | <references/> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
[[Category: HOWTO]] | [[Category: HOWTO]] | ||
− | [[Category: Templates | + | [[Category: Templates] |
[[Category: Debian]] | [[Category: Debian]] | ||
[[Category: Ubuntu]] | [[Category: Ubuntu]] | ||
[[Category: Gentoo]] | [[Category: Gentoo]] |