{"id":1471,"date":"2012-09-20T07:31:38","date_gmt":"2012-09-19T23:31:38","guid":{"rendered":"http:\/\/rmohan.com\/?p=1471"},"modified":"2012-09-20T07:36:55","modified_gmt":"2012-09-19T23:36:55","slug":"yum-command","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=1471","title":{"rendered":"yum command"},"content":{"rendered":"<h2>Task: Display list of updated software (security fix)<\/h2>\n<p>Type the following command at shell prompt:<br \/> <code># yum list updates<\/code><\/p>\n<h2>Task: Patch up system by applying all updates<\/h2>\n<p>To download and install all updates type the following command:<br \/> <code># yum update <\/code><\/p>\n<h2>Task: List all installed packages<\/h2>\n<p>List all installed packages, enter:<br \/> <code># rpm -qa<br \/> # yum list installed <\/code><br \/> Find out if httpd package installed or not, enter:<br \/> <code># rpm -qa | grep httpd*<br \/> # yum list installed httpd<\/code><\/p>\n<h2>Task: Check for and update specified packages<\/h2>\n<p><code># yum update {package-name-1}<\/code><br \/> To check for and update httpd package, enter:<br \/> <code># yum update httpd<\/code><\/p>\n<h2>Task: Search for packages by name<\/h2>\n<p>Search httpd and all matching perl packages, enter:<br \/> <code># yum list {package-name}<br \/> # yum list {regex}<br \/> # yum list httpd<br \/> # yum list perl*<\/code><br \/> Sample output:<\/p>\n<pre>Loading \"installonlyn\" plugin\r\nLoading \"security\" plugin\r\nSetting up repositories\r\nReading repository metadata in from local files\r\nInstalled Packages\r\nperl.i386                                4:5.8.8-10.el5_0.2     installed\r\nperl-Archive-Tar.noarch                  1.30-1.fc6             installed\r\nperl-BSD-Resource.i386                   1.28-1.fc6.1           installed\r\nperl-Compress-Zlib.i386                  1.42-1.fc6             installed\r\nperl-DBD-MySQL.i386                      3.0007-1.fc6           installed\r\nperl-DBI.i386                            1.52-1.fc6             installed\r\nperl-Digest-HMAC.noarch                  1.01-15                installed\r\nperl-Digest-SHA1.i386                    2.11-1.2.1             installed\r\nperl-HTML-Parser.i386                    3.55-1.fc6             installed\r\n.....\r\n.......\r\n..\r\nperl-libxml-perl.noarch                  0.08-1.2.1             base\r\nperl-suidperl.i386                       4:5.8.8-10.el5_0.2     updates <\/pre>\n<h2>Task: Install the specified packages [ RPM(s) ]<\/h2>\n<p>Install package called httpd:<br \/> <code># yum install {package-name-1} {package-name-2}<br \/> # yum install httpd<\/code><\/p>\n<h2>Task: Remove \/ Uninstall the specified packages [ RPM(s) ]<\/h2>\n<p>Remove package called httpd, enter:<br \/> <code># yum remove {package-name-1} {package-name-2}<br \/> # yum remove httpd<\/code><\/p>\n<h2>Task: Display the list of available packages<\/h2>\n<p><code># yum list all<\/code><\/p>\n<h2>Task: Display list of group software<\/h2>\n<p>Type the following command:<br \/> <code># yum grouplist<\/code><br \/> Output:<\/p>\n<pre>Installed Groups:\r\n   Engineering and Scientific\r\n   MySQL Database\r\n   Editors\r\n   System Tools\r\n   Text-based Internet\r\n   Legacy Network Server\r\n   DNS Name Server\r\n   Dialup Networking Support\r\n   FTP Server\r\n   Network Servers\r\n   Legacy Software Development\r\n   Legacy Software Support\r\n   Development Libraries\r\n   Graphics\r\n   Web Server\r\n   Ruby\r\n   Printing Support\r\n   Mail Server\r\n   Server Configuration Tools\r\n   PostgreSQL Database\r\nAvailable Groups:\r\n   Office\/Productivity\r\n   Administration Tools\r\n   Beagle\r\n   Development Tools\r\n   GNOME Software Development\r\n   X Software Development\r\n   Virtualization\r\n   GNOME Desktop Environment\r\n   Authoring and Publishing\r\n   Mono\r\n   Games and Entertainment\r\n   XFCE-4.4\r\n   Tomboy\r\n   Java\r\n   Java Development\r\n   Emacs\r\n   X Window System\r\n   Windows File Server\r\n   KDE Software Development\r\n   KDE (K Desktop Environment)\r\n   Horde\r\n   Sound and Video\r\n   FreeNX and NX\r\n   News Server\r\n   Yum Utilities\r\n   Graphical Internet\r\nDone\r\n<\/pre>\n<h2>Task: Install all the default packages by group<\/h2>\n<p>Install all &#8216;Development Tools&#8217; group packages, enter:<br \/> <code># yum groupinstall \"Development Tools\"<\/code><\/p>\n<h2>Task: Update all the default packages by group<\/h2>\n<p>Update all &#8216;Development Tools&#8217; group packages, enter:<br \/> <code># yum groupupdate \"Development Tools\"<\/code><\/p>\n<h2>Task: Remove all packages in a group<\/h2>\n<p>Remove all &#8216;Development Tools&#8217; group packages, enter:<br \/> <code># yum groupremove \"Development Tools\"<\/code><\/p>\n<h2>Task: Install particular architecture package<\/h2>\n<p>If you are using 64 bit RHEL version it is possible to install 32 packages:<br \/> <code># yum install {package-name}.{architecture}<br \/> # yum install mysql.i386<\/code><\/p>\n<h2>Task: Display packages not installed via official RHN subscribed repos<\/h2>\n<p>Show all packages not available via subscribed channels or repositories i.e show packages installed via other repos:<br \/> <code># yum list extras<\/code><br \/> Sample output:<\/p>\n<pre>Loading \"installonlyn\" plugin\r\nLoading \"security\" plugin\r\nSetting up repositories\r\nReading repository metadata in from local files\r\nExtra Packages\r\nDenyHosts.noarch                         2.6-python2.4          installed\r\nVMwareTools.i386                         6532-44356             installed\r\njohn.i386                                1.7.0.2-3.el5.rf       installed\r\nkernel.i686                              2.6.18-8.1.15.el5      installed\r\nkernel-devel.i686                        2.6.18-8.1.15.el5      installed\r\nlighttpd.i386                            1.4.18-1.el5.rf        installed\r\nlighttpd-fastcgi.i386                    1.4.18-1.el5.rf        installed\r\npsad.i386                                2.1-1                  installed\r\nrssh.i386                                2.3.2-1.2.el5.rf       installed\r\n<\/pre>\n<h2>Task: Display what package provides the file<\/h2>\n<p>You can easily find out what RPM package provides the file. For example find out what provides the \/etc\/passwd file:<br \/> <code># yum whatprovides \/etc\/passwd<\/code><br \/> Sample output:<\/p>\n<pre>Loading \"installonlyn\" plugin\r\nLoading \"security\" plugin\r\nSetting up repositories\r\nReading repository metadata in from local files\r\nsetup.noarch                             2.5.58-1.el5           base\r\nMatched from:\r\n\/etc\/passwd\r\nsetup.noarch                             2.5.58-1.el5           installed\r\nMatched from:\r\n\/etc\/passwd\r\n<\/pre>\n<p>You can use same command to list packages that satisfy dependencies:<br \/> <code># yum whatprovides {dependency-1} {dependency-2}<\/code><br \/> Refer yum command man page for more information:<br \/> <code># man yum<\/code><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Task: Display list of updated software (security fix) <\/p>\n<p>Type the following command at shell prompt: # yum list updates<\/p>\n<p> Task: Patch up system by applying all updates <\/p>\n<p>To download and install all updates type the following command: # yum update <\/p>\n<p> Task: List all installed packages <\/p>\n<p>List all installed packages, enter: # rpm -qa # [&#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\/1471"}],"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=1471"}],"version-history":[{"count":5,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/1471\/revisions"}],"predecessor-version":[{"id":1474,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/1471\/revisions\/1474"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1471"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1471"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1471"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}