{"id":654,"date":"2012-07-10T16:55:26","date_gmt":"2012-07-10T08:55:26","guid":{"rendered":"http:\/\/rmohan.com\/?p=654"},"modified":"2012-07-10T16:55:26","modified_gmt":"2012-07-10T08:55:26","slug":"rpm-packages-installation-and-usage","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=654","title":{"rendered":"RPM Packages installation and usage"},"content":{"rendered":"<h3>RPM Packages installation and usage<\/h3>\n<h3>RPM Packages installation and usage<\/h3>\n<div><\/div>\n<p>Note:<\/p>\n<ul>\n<li>Normal querying doesnot require a root loogin but for installation and uninstalling a package you need to be logged in as root.<\/li>\n<li>We can also use regular expressions or wiild-characters with the rpm command.<\/li>\n<\/ul>\n<p>RPM PACKAGE INSTALLATION\/ UNINSTALLATION:<\/p>\n<p># installing a rpm package with hash printing and in verbose mode<\/p>\n<p>rpm -ivh foobar-1.0-i386.rpm<\/p>\n<p># to install a package ignoring any dependencies<\/p>\n<p>rpm -ivh &#8211;nodeps<\/p>\n<p># upgrading a package with hash printing and in verbose mode<\/p>\n<p>rpm -Uvh foobar-1.1-i386.rpm<\/p>\n<p># Upgrade only those which are already installed from an RPM repository<\/p>\n<p>rpm -Fvh *.rpm<\/p>\n<p># uninstall a package<\/p>\n<p>rpm -e foobar<\/p>\n<p># uninstall ignoring the dependencies<\/p>\n<p>rpm -e &#8211;nodeps foobar<\/p>\n<p># to force install \/uninstall<\/p>\n<p>rpm -ivh &#8211;force foobar-1.0-i386.rpm<\/p>\n<p>RPM PACKAGE QUERY<\/p>\n<p># find all those packages which are installed on your system<\/p>\n<p>rpm -qa | sort | less<\/p>\n<p>rpm -qa | sort &gt; rpmlist<\/p>\n<p># findout all the files which are installed by a rpm package<\/p>\n<p>rpm -ql foobar<\/p>\n<p>rpm -qpl foobar-1.0-i386.rpm<\/p>\n<p># search for an installed package<\/p>\n<p>rpm -qa | grep foobar<\/p>\n<p># search for a specific file in a rpm repository<\/p>\n<p>for i in *.rpm ; do rpm -qpl $i | grep filename &amp;&amp; echo $i ; done<\/p>\n<p># findout to what package does the a directory\/file (say) \/etc\/skel belong to<\/p>\n<p>rpm -qf \/etc\/skel<\/p>\n<p>rpm -q &#8211;whatprovides<\/p>\n<p># to see what config files are installed by a package<\/p>\n<p>rpm -qc foobar<\/p>\n<p>MISC<\/p>\n<p># To test walk-through a installtion of a package use<\/p>\n<p>rpm -ivh &#8211;test foobar-1.1-i386.rpm<\/p>\n<p>10. Similarly uninstalling a package without considering dependencies, use<\/p>\n<p># rpm -e &#8211;nodeps<\/p>\n<p>11. To force install a package ( same as using &#8220;&#8211;replacefiles&#8221; and &#8220;&#8211;replacepkgs&#8221; together.<\/p>\n<p>It like installing a package with no questions asked \ud83d\ude42 use it with caution, this option can make some of your existing software unusable or unstable<\/p>\n<p># rpm -i &#8211;force<\/p>\n<p>12. To exclude the documentation for a package while installing, useful incase of minimal stripped-down installation<\/p>\n<p># rpm -i &#8211;excludedocs<\/p>\n<p>13. To include documentation while installing (by default this option is enabled), this option is useful only one has set to exclude documentation in &#8220;\/etc\/rpmrc&#8221; or in &#8220;~\/.rpmrc&#8221; or in \/usr\/lib\/rpm\/rpmrc&#8221;<\/p>\n<p># rpm -ivh &#8211;includedocs<\/p>\n<p>14. To display the debug info while installing, use<\/p>\n<p>When using this option it not neccessary to specify the &#8220;-v&#8221; verbose option as the debug information provided by the rpm command is verbose by default.<\/p>\n<p># rpm -ih &#8211;test -vv<\/p>\n<p>As already discussed &#8220;-ih&#8221; combined option tell rpm to do installation with hash printing, and using the &#8220;&#8211;test&#8221; tells the rpm command to only do walkthrough of installation and not to do the actual installation, &#8220;-vv&#8221; option asks the rpm package to also print the debug information.<\/p>\n<p>15. To upgrade a package (i.e uninstall the previous version and install a newer version), use<\/p>\n<p># rpm -U -v -h<\/p>\n<p>16. To permit upgrade to an old package version (i.e downgrade), use<\/p>\n<p># rpm -U -v -h &#8211;oldpackage<\/p>\n<p>17. To list all the rpm(s) installed on your system, use<\/p>\n<p>$ rpm -qa<\/p>\n<p>One can pipe the output of the above command to another shell command, e.g.<\/p>\n<p>$ rpm -qa | less<\/p>\n<p>$ rpm -qa | grep &#8220;foobar&#8221;<\/p>\n<p>$ rpm -qa &gt; installed_rpm.lst<\/p>\n<ul>\n<li>Use you imagination for more combinations, you may even use wild characters.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>RPM Packages installation and usage RPM Packages installation and usage <\/p>\n<p>Note:<\/p>\n<p> Normal querying doesnot require a root loogin but for installation and uninstalling a package you need to be logged in as root. We can also use regular expressions or wiild-characters with the rpm command. <\/p>\n<p>RPM PACKAGE INSTALLATION\/ UNINSTALLATION:<\/p>\n<p># installing a rpm package with [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/654"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=654"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/654\/revisions"}],"predecessor-version":[{"id":655,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/654\/revisions\/655"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=654"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=654"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=654"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}