|
YUM notes |
| YUM Notes This list details some of the more common yum commands you will most likely require to maintain your system. |
| Some YUM Commands |
Explanations |
| [base]#
yum list |
List all available packages |
| [base]#
yum list http* |
List all packages starting with "http" |
| [base]# yum check-update | Check for available updates |
| [base]# yum update | Update all available packages |
| [base]#
yum update samba* |
Update only the samba packages |
| [base]# yum install httpd | Install the httpd package |
| [base]# yum install xmms wine | Install both the xmms and wine packages |
| [base]# yum -y install httpd | Install package (answering yes to all questions) |
| [base]# yum provides httpd.conf | List package name that provides the "httpd.conf" file |
| [base]# yum clean all | Removes cached packages and RPM headers from system |
| [base]# yum remove http* | Uninstalls all packages starting with "http" |
| [base]#
/etc/init.d/yum start |
Start the nightly updating service |
| [base]#
chkconfig yum on |
Enabling yum service on runlevels |
|
How do I only list or install only security updates under RHEL 5.x or CentOS Linux server? How do I find out security updates descriptions such as CVE, bugs, issued date and type for each patch? You can easily find out security patches related information using yum-security plugin. This plugin adds the options --security, --cve, --bz and --advisory flags to yum and the list-security and info-security commands. The options make it possible to limit list/upgrade of packages to specific security relevant ones. The commands give you the security information. Install Plugin# yum install yum-security How Do I Display Available Security Updates?# yum list-securitySample Outputs: Loaded plugins: rhnplugin, security RHSA-2009:1148-1 security httpd-2.2.3-22.el5_3.2.x86_64 RHSA-2009:1148-1 security httpd-devel-2.2.3-22.el5_3.2.i386 RHSA-2009:1148-1 security httpd-manual-2.2.3-22.el5_3.2.x86_64 RHSA-2009:1148-1 security mod_ssl-1:2.2.3-22.el5_3.2.x86_64 list-security done To list all updates that are security relevant, and get a reutrn code on whether there are security updates use: # yum --security check-updateTo get a list of all BZs that are fixed for packages you have installed use: # yum list-security bugzillasTo get the information on advisory RHSA-2009:1148-1 use: # yum info-security RHSA-2009:1148-1Sample Outputs: Loaded plugins: rhnplugin, security
===============================================================================
RHSA-2009:1148
===============================================================================
Update ID : RHSA-2009:1148-1
Release :
Type : security
Status : final
Issued : 2009-07-08 23:00:00
Bugs : 509125 - None
: 509375 - None
CVEs : CVE-2009-1890
: CVE-2009-1891
Description : Important: httpd security update \The Apache HTTP Server is a
: popular Web server. A denial of service flaw was
: found in the Apache mod_proxy module when it was
: used as a reverse proxy. A remote attacker could
: use this flaw to force a proxy process to consume
: large amounts of CPU time. (CVE-2009-1890) A
: denial of service flaw was found in the Apache
: mod_deflate module. This module continued to
: compress large files until compression was
: complete, even if the network connection that
: requested the content was closed before
: compression completed. This would cause
: mod_deflate to consume large amounts of CPU if
: mod_deflate was enabled for a large file.
: (CVE-2009-1891) All httpd users should upgrade to
: these updated packages, which contain backported
: patches to correct these issues. After installing
: the updated packages, the httpd daemon must be
: restarted for the update to take effect.
Files : mod_ssl-2.2.3-22.el5_3.2.x86_64.rpm
: httpd-devel-2.2.3-22.el5_3.2.i386.rpm
: httpd-2.2.3-22.el5_3.2.x86_64.rpm
: httpd-devel-2.2.3-22.el5_3.2.x86_64.rpm
: httpd-manual-2.2.3-22.el5_3.2.x86_64.rpm
: mod_ssl-2.2.3-22.el5_3.2.i386.rpm
: httpd-2.2.3-22.el5_3.2.i386.rpm
: httpd-manual-2.2.3-22.el5_3.2.i386.rpm
info-security done
To get an info list of the latest packages which contain fixes for Bugzilla 3595; CVE # CVE-2009-1890 and advisories RHSA-2009:1148-1, use: How Do I Install All The Security Updates Only?
|
Type the following command at shell prompt:
# yum list updates
To download and install all updates type the following command:
# yum update
List all installed packages, enter:
# rpm -qa
# yum list installed
Find out if httpd package installed or not, enter:
# rpm -qa | grep httpd*
# yum list installed httpd
# yum update {package-name-1}
To check for and update httpd package, enter:
# yum update httpd
Search httpd and all matching perl packages, enter:
# yum list {package-name}
# yum list {regex}
# yum list httpd
# yum list perl*
Sample output:
Loading "installonlyn" plugin Loading "security" plugin Setting up repositories Reading repository metadata in from local files Installed Packages perl.i386 4:5.8.8-10.el5_0.2 installed perl-Archive-Tar.noarch 1.30-1.fc6 installed perl-BSD-Resource.i386 1.28-1.fc6.1 installed perl-Compress-Zlib.i386 1.42-1.fc6 installed perl-DBD-MySQL.i386 3.0007-1.fc6 installed perl-DBI.i386 1.52-1.fc6 installed perl-Digest-HMAC.noarch 1.01-15 installed perl-Digest-SHA1.i386 2.11-1.2.1 installed perl-HTML-Parser.i386 3.55-1.fc6 installed ..... ....... .. perl-libxml-perl.noarch 0.08-1.2.1 base perl-suidperl.i386 4:5.8.8-10.el5_0.2 updates
Install package called httpd:
# yum install {package-name-1} {package-name-2}
# yum install httpd
Remove package called httpd, enter:
# yum remove {package-name-1} {package-name-2}
# yum remove httpd
# yum list all
Type the following command:
# yum grouplist
Output:
Installed Groups: Engineering and Scientific MySQL Database Editors System Tools Text-based Internet Legacy Network Server DNS Name Server Dialup Networking Support FTP Server Network Servers Legacy Software Development Legacy Software Support Development Libraries Graphics Web Server Ruby Printing Support Mail Server Server Configuration Tools PostgreSQL Database Available Groups: Office/Productivity Administration Tools Beagle Development Tools GNOME Software Development X Software Development Virtualization GNOME Desktop Environment Authoring and Publishing Mono Games and Entertainment XFCE-4.4 Tomboy Java Java Development Emacs X Window System Windows File Server KDE Software Development KDE (K Desktop Environment) Horde Sound and Video FreeNX and NX News Server Yum Utilities Graphical Internet Done
Install all 'Development Tools' group packages, enter:
# yum groupinstall "Development Tools"
Update all 'Development Tools' group packages, enter:
# yum groupupdate "Development Tools"
Remove all 'Development Tools' group packages, enter:
# yum groupremove "Development Tools"
If you are using 64 bit RHEL version it is possible to install 32 packages:
# yum install {package-name}.{architecture}
# yum install mysql.i386
Show all packages not available via subscribed channels or repositories i.e show packages installed via other repos:
# yum list extras
Sample output:
Loading "installonlyn" plugin Loading "security" plugin Setting up repositories Reading repository metadata in from local files Extra Packages DenyHosts.noarch 2.6-python2.4 installed VMwareTools.i386 6532-44356 installed john.i386 1.7.0.2-3.el5.rf installed kernel.i686 2.6.18-8.1.15.el5 installed kernel-devel.i686 2.6.18-8.1.15.el5 installed lighttpd.i386 1.4.18-1.el5.rf installed lighttpd-fastcgi.i386 1.4.18-1.el5.rf installed psad.i386 2.1-1 installed rssh.i386 2.3.2-1.2.el5.rf installed
You can easily find out what RPM package provides the file. For example find out what provides the /etc/passwd file:
# yum whatprovides /etc/passwd
Sample output:
Loading "installonlyn" plugin Loading "security" plugin Setting up repositories Reading repository metadata in from local files setup.noarch 2.5.58-1.el5 base Matched from: /etc/passwd setup.noarch 2.5.58-1.el5 installed Matched from: /etc/passwd
You can use same command to list packages that satisfy dependencies:
# yum whatprovides {dependency-1} {dependency-2}
Refer yum command man page for more information:
# man yum
| webmaster@phas.ubc.ca | [Dept. Home Page] | last updated: 07/12/03 |