Difference between revisions of "Rpm"

From Notes_Wiki
m
m
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
<yambe:breadcrumb>Package_management_tools|Package management tools</yambe:breadcrumb>
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[System administration tools]] > [[Package management tools]] > [[Rpm|rpm]]
=rpm=


==Finding which package installed given file==
*[[Creating rpm packages]]
*[[Miscellaneous rpm issues]]


Many times we require to know the name of the page which installed a given file.  In such cases one can use:
'''Consider looking at related articles at:'''
<pre>
* [[yum]]
rpm -qf &lt;full-path-of-file&gt;
* [[CentOS 7.x yum]]
</pre>
* [[Advantages of using package managers]]
to list the name of the rpm package.




==Advantages of using package manager==
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[System administration tools]] > [[Package management tools]] > [[Rpm|rpm]]
 
Few advantages of use of package manager over installation using sources are:
*You can find out which files are associated with a given package.
*:<pre>
*::rpm -ql <package name>
*:</pre>
*For a given file, you can find out which package it's associated with.
*:<pre>
*::rpm -qf <file-path>
*:</pre>
*You can remove all files associated with a given package, even if they're spread out over multiple directories.
*:<pre>
*::rpm -e <package-name>
*:</pre>
*You can know which packages are dependent on a given package
*:<pre>
*::      rpm -qR <package-name>  #OR
*::      yum deplist <package-name>
*:</pre>
*You can know which packages a given package depends on
*:<pre>
*::      yum remove <package-name> (Can cancel with N)
*:</pre>
*Cryptographic security ensuring package is untampered
*:Handled by yum automatically.  Keys are installed in /etc/pki/rpm-gpg folder.  Installation works only if package is properly signed
*Upgrading of packages does not overwrites modified configuration files
*:Results into .rpmnew or .rpmsave files
*Packages installed by package managers can be updated using package managers easily
*:<pre>
*::yum -y update
*:</pre>  
*Package managers ensure that one package does not overwrites file created by another package
*:Results into conflicts
 
 
==References==
References for understanding and learning rpm and yum properly:
*Information on restoring original files if package was installed via RPM is at https://www.g-loaded.eu/2012/03/26/restore-original-configuration-files-from-rpm-packages/
*Detailed information on RPM and yum is available at https://www.ibm.com/developerworks/linux/library/l-lpic1-v3-102-5/?ca=drs- 
*RPM uses a fairly complex logic while upgrading a package to decide fate of configuration files.  The logic is described in detail at http://www.rpm.org/max-rpm/ch-rpm-upgrade.html

Latest revision as of 12:20, 28 July 2022