Tuesday, October 16, 2012

Linux Package Management - RPM, DPKG


===============================================
dpkg
===============================================
Install Package ---->
-i(--install)
Remove Package---->
-r(--remove)remove totally exluding config file
-p(--purge)  remove totally including config file
Query Package ---->
-l(--list)      list all package
-L packageprint info about package(file location…)
-S fileSearch which package is the file belong to (such as rpm –qf)

===============================================
apt-get
===============================================
apt-get
-dOnly download the package file
-yforce to answer yes
install  packageinstall
remove packageremove
updatelist available package

===============================================
rpm
===============================================
rpm db location: /var/lib/rpm
rpm  --rebuilddb

---------------------------------------------------------------------------
Package Verify
---------------------------------------------------------------------------
-V  Package : Verify the changed file belonged to the package and list them.
-Va : List all the changed file belonged to all packages.
-Vp Package : List possibly changed file belonged to the package.
-Vf  file : Verify if the file is been changed.
-K Package : check the Package’s  MD5 checksum and pgp.
--checksigcheck Package’s MD5 checksum and pgp.
S file Size differs
M Mode differs (includes permissions and file type)
5 MD5 sum differs
D Device major/minor number mis-match
L readLink(2) path mis-match
U User ownership differs
G Group ownership differs
T mTime differs
import keys : rpm --import /usr/share/rhn/RPM-GPG-KEY
/usr/share/doc/rpm-4.4.2/RPM-GPG-KEY
/usr/share/doc/fedora-release-5/RPM-GPG-KEY
/etc/pki/rpm-gpg/RPM-GPG-KEY

---------------------------------------------------------------------------
rpm -ivh Package
---------------------------------------------------------------------------

-i install
-v show the process
-h show the process in percent.
--nodeps :
--nomd5 :
--noscripts :
--replacefiles :
--replacepkgs :
--force :
--test :
---------------------------------------------------------------------------
Upgrade and Update
---------------------------------------------------------------------------
-Uvh : Install and update.
-Fvh : Upgrade only if the older package is installed

---------------------------------------------------------------------------
Remove Package
---------------------------------------------------------------------------
rpm e Package
rpm e Package --allmaches : Remove all versions of the
package which match PACKAGE_NAME.
rpm e Package --nodeps : Don't check dependencies before
uninstalling the packages.

---------------------------------------------------------------------------
Query
---------------------------------------------------------------------------
rpm  -q  Package : check if the package exists.
rpm  -ql Package : List all the files belonged to the package.
rpm  -qi Package : Print info about the package.
rpm  -qf file : Search which package is the file belong to.
rpm  -qc Package : List the config file of the package.
rpm  -qd Package : List the document about the package location.
rpm  -qR Package : List the dependency of the package(prequesite).
rpm  -qa :List all the installed package.

No comments:

Post a Comment