Anda di halaman 1dari 66

Oracle Linux 6 Boot Camp

Oracle Linux 6 Lab Exercise

Safe Harbor Statement


The following is intended to outline our general product direction. It is intended for
information purposes only, and may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality, and should not be relied
upon in making purchasing decisions.
The development, release, and timing of any features or functionality described for
Oracles products remains at the sole discretion of Oracle.

Oracle Training Materials Usage Agreement


Use of this Site (Site) or Materials constitutes agreement with the following terms
and conditions:
1. Oracle Corporation (Oracle) is pleased to allow its business partner (Partner)
to download and copy the information, documents, and the online training courses
(collectively, Materials") found on this Site. The use of the Materials is restricted to
the non-commercial, internal training of the Partners employees only. The
Materials may not be used for training, promotion, or sales to customers or other
partners or third parties.
2. All the Materials are trademarks of Oracle and are proprietary information of
Oracle. Partner or other third party at no time has any right to resell, redistribute or
create derivative works from the Materials.
3. Oracle disclaims any warranties or representations as to the accuracy or
completeness of any Materials. Materials are provided "as is" without warranty of
any kind, either express or implied, including without limitation warranties of
merchantability, fitness for a particular purpose, and non-infringement.
4. Under no circumstances shall Oracle or the Oracle Authorized Delivery Partner be
liable for any loss, damage, liability or expense incurred or suffered which is claimed
to have resulted from use of this Site of Materials. As a condition of use of the
Materials, Partner agrees to indemnify Oracle from and against any and all actions,
claims, losses, damages, liabilities and expenses (including reasonable attorneys'
fees) arising out of Partners use of the Materials.
5. Reference materials including but not limited to those identified in the Boot Camp
manifest cannot be redistributed in any format without Oracle written consent.

OL 6 Package Management - Lab 3

Oracle Linux Package Management


V1.0 January 2013

1 Introduction
Oracle Linux software, updates, patches and applications are usually organized in
the form of RPM packages that contain all the relevant parts of an application (e.g.
binaries, configuration files, libraries). In this module, participants will learn how to
install and manage packages on Oracle Linux 6.
With a few basic exercises we will introduce the learner to some ways to perform
Linux package management in Oracle Linux 6. We will also cover Ksplice Zero
Downtime Patching technology which is a unique feature of Oracle Linux operating
system. Upon completion of this lab participants will have learned how to install,
update, and remove Linux packages using different utilities and methods.

2 Overview
In this lab well be practicing Oracle Linux 6 Package Management tasks. We will
install, remove and update RPM packages using both the RPM and YUM utilities. We
will install the Oracle RDBMS Server 11gR2 Pre-install RPM package and explain the
purpose of this package. Well briefly review setting up a local yum repository.
Finally, we will also discuss Ksplice patching and how it can help improve uptime
and increase security of your Oracle Linux 6 systems.
Some of the topics and concepts well review are listed below.

Install Packages using Oracle Linux ISO image as a local repository


Using the RPM utility
Using the YUM command
Install the Oracle RDBMS Server 11gR2 Pre-install RPM package
Set up a local YUM repository no lab
Ksplice Zero Downtime Patching optional lab

This practice can be accomplished with a single VirtualBox Oracle Linux 6.3
instance. You must have finished the Installation lab and already have an instance
of Oracle Linux 6.3 running in your VirtualBox environment.

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 2 of 66

OL 6 Package Management - Lab 3


3 Pre-requisites
This lab requires the use of the following elements:

A current 64 bit laptop with at least 2GB RAM and 20GB free disk space
Operating system: A 64-bit version of Microsoft Windows, Mac OS X, Linux
or Solaris. Alternatively, a 32-bit host OS installed on a 64-bit CPU with VTx/AMD-V enabled in the BIOS.
Oracle VirtualBox Software 4.2.10 or later (with Extension Pack installed)
Oracle Linux 6.3 instance running inside VirtualBox:
o VM Image Provided by instructor or downloaded on your own
o Installed in Lab 1 of Oracle Linux 6 Boot camp

The following assumptions have been made regarding the environment where this
lab is being performed:
1. Network connectivity to the Internet is available
2. Your Oracle Linux 6.3 VirtualBox instance has been installed and youve
assigned a normal user/password and a root user password.
a. The recommended user name is student1
b. The recommended password is oracle
c. The recommended root password is oracle

4 VirtualBox lab setup


If you already have an instance of Oracle Linux 6.3 installed in VirtualBox or have
already imported the Oracle Linux 6.3 image, you can skip this section and proceed
to the Labs in Section 5. If you need to import the Oracle Linux 6.3 appliance (image
in ova file provided for this training) then complete the steps in this section before
you start with the Labs.
1 - In the VirtualBox
main window choose
File > Import
Appliance

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 3 of 66

OL 6 Package Management - Lab 3


2 - From the Appliance
Import Wizard click the
Open appliance..
button and navigate to
the
Oracle_Linux_6_Bootca
mp.ova file which is the
pre-built Oracle Linux
6.3 VM image you
downloaded or obtained
from the instructor

3 - Navigate to the folder


where you downloaded
or copied the Oracle
Linux 6.3 Prebuilt image
and click Open. The file
is named
Oracle_Linux_6_Bootca
mp.ova.

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 4 of 66

OL 6 Package Management - Lab 3


4 - Choose Next on the
Appliance to import
screen

5 - Confirm the default


settings and choose
Import to begin
importing the virtual
image. If you see a
License Agreement
window, read and accept
the license.

6 - The progress bar will


show the import
progress. Usually looks
slow in the beginning
but this shouldnt take
more than a few
minutes.

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 5 of 66

OL 6 Package Management - Lab 3


7 - Your new image has
been imported and is
ready for use. Select the
Oracle Linux 6
Bootcamp image.

8 - After your image has


finished importing select
it in the VB application
and choose Settings
and review settings.

Once you have reviewed


the settings, you can
select the image and
click the Start button to
boot Oracle Linux 6.
After booting, login as
root user and activate
your network
connection to start using
the image.
The following video demonstrates how to import an appliance:
Importing Oracle Linux VM Appliance Video

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 6 of 66

OL 6 Package Management - Lab 3


5 Lab Exercises
5.1 Install packages using Oracle Linux ISO image as a local repository
In this lab, we will use the Oracle Linux 6.3 ISO image file (V33411-01.iso) that was
downloaded from the Oracle Software Delivery Cloud. We will mount this ISO image
file on our Oracle Linux 6.3 instance running inside VirtualBox application. Once the
ISO image file or the DVD media has been mounted, we will configure it as a local
yum repository and then install some RPM packages from this local repository.
Installing from ISO image or DVD comes in handy when you do not have an internet
connection to access the Oracle Public Yum Server.
Login as root user to your Oracle Linux 6.3 instance running inside VirtualBox
application to perform this lab. It is assumed that you already have downloaded the
Oracle Linux 6.3 ISO image file (V33411-01.iso) file on your local disk drive or it is
accessible from your laptop.
Choose the Devices CD/DVD Devices Choose a virtual CD/DVD
disk file option from the VirtualBox VM Machine menu options. See screenshot
below.

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 7 of 66

OL 6 Package Management - Lab 3


Choose the Oracle Linux 6.3 ISO image file (V33411-01.iso) from your hard drive as
shown below.

You should now see the Oracle Linux 6.3 ISO image file get mounted on your
desktop. Double click the mounted DVD image to open the file manager and view the
contents of the DVD image.

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 8 of 66

OL 6 Package Management - Lab 3

The DVD ISO image file was mounted on /media and the mount name includes
spaces in the directory name. Using a directory with spaces in the name may be a bit
tricky and hence we will unmount this DVD image and mount it on a new mount
point with a new name that does not include spaces in the directory name.
To unmount the DVD image, right click the DVD media icon on your desktop, and
select the Unmount option as shown in the screenshot below. This will keep the DVD
media inserted the virtual drive and will allow us to mount it to a new directory
mount point.

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 9 of 66

OL 6 Package Management - Lab 3

Once the DVD media has been unmounted, we will create a new directory name
without any spaces in the name of the directory and then mount the DVD ISO image
file to that new directory.
Create a new directory called /OL6DVD on your Oracle Linux 6.3 system. Next, use
the mount command as shown below to mount the DVD device to this new directory
called /OL6DVD.
[root@examplehost /]# mkdir /OL6DVD
[root@examplehost /]# mount /dev/sr0 /OL6DVD
mount: block device /dev/sr0 is write-protected, mounting
read-only
[root@examplehost /]#

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 10 of 66

OL 6 Package Management - Lab 3

You can run the mount command to verify that the Oracle Linux DVD ISO image file
has indeed been mounted on the /OL6DVD mount point.
[root@examplehost /]# mount
/dev/mapper/vg_examplehost-lv_root on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs
(rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sda1 on /boot type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
gvfs-fuse-daemon on /root/.gvfs type fuse.gvfs-fuse-daemon
(rw,nosuid,nodev)
/dev/sr0 on /OL6DVD type iso9660 (ro)
[root@examplehost /]#

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 11 of 66

OL 6 Package Management - Lab 3

Change directory and review the contents of the mounted DVD ISO image file as
shown below.
[root@examplehost /]# cd /OL6DVD/
[root@examplehost OL6DVD]# ls
EFI
Packages
ResilientStorage
EULA
README-en
eula.en_US
README-en.html
KEY-oracle
eula.py
RELEASE-NOTES-en
ScalableFileSystem
GPL
RELEASE-NOTES-en.html
HighAvailability RELEASE-NOTES-x86_64-en
images
RELEASE-NOTES-x86_64-en.html
isolinux
RELEASE-NOTES-x86-en
LoadBalancer
RELEASE-NOTES-x86-en.html
media.repo
repodata
[root@examplehost OL6DVD]#

RPM-GPG-KEY
RPM-GPG-

Server
supportinfo
TRANS.TBL
UEK2

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 12 of 66

OL 6 Package Management - Lab 3

We will now configure this mounted DVD image file as a local package repository
that can be used by yum command to install packages. As mentioned earlier, this
learning exercise can be performed to install packages in situations where you do
not have internet access and cannot use the Oracle Public Yum Server.
Use a text editor of your preference to create a configuration file
/etc/yum.repos.d/local.repo as shown below.
[root@examplehost ~]# vi /etc/yum.repos.d/local.repo
[root@examplehost ~]#
[root@examplehost ~]# cat /etc/yum.repos.d/local.repo
[local]
name=OL6u3 DVD Repository
baseurl=file:///OL6DVD
[root@examplehost ~]#

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 13 of 66

OL 6 Package Management - Lab 3

Once you have created the local repository file (/etc/yum.repos.d/local.repo) as


shown above, you are now ready to use this repository to install packages using the
yum command and this local repository.
Note: You may have to import the Public keys from the Oracle Linux 6 DVD before
you can install packages using the DVD based local yum repository. To import the
public keys, you can run the following RPM commands.

Next, verify using the yum repolist command and confirm that you can see a
repository with the name local in the list. If you see the local repository in the
output that means the DVD based repository is now available as repository.
[root@examplehost ~]# yum repolist
Loaded plugins: refresh-packagekit, security
repo id
repo name
status
local
OL6u3 DVD Repository
3,563
ol6_UEK_latest
Latest Unbreakable Enterprise Kernel for
Oracle Linux 6Server (x86_64)
120
ol6_latest
Oracle Linux 6Server Latest (x86_64)
18,409
repolist: 22,092
[root@examplehost ~]#

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 14 of 66

OL 6 Package Management - Lab 3

We will install a package from this local yum repository now to verify that is
working correctly.
For this exercise, we will install the lsscsi rpm package. Before we install this
package, verify two things:
1. Make sure lsscsi rpm is not pre-installed using rpm q lsscsi command
2. Make sure you disable all the enabled channels in the
/etc/yum.repos.d/public-yum-ol6.repo file
3. List repositories using yum repolist to make sure only the local repository is
available
[root@examplehost ~]#rpm q lsscsi
package lsscsi is not installed
Edit and disable all channels by setting enabled=0 for all channels:
[root@examplehost ~]# cd /etc/yum.repos.d/
[root@examplehost ~]# vi public-yum-ol6.repo
Verify that only repository available is the local repository using the yum repolist
command:
[root@examplehost ~]#yum repolist

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 15 of 66

OL 6 Package Management - Lab 3

We will now install the lsscsi rpm from the local repository using the yum
command to verify that it is working correctly. Run the commands shown below:
[root@examplehost yum.repos.d]# yum install lsscsi

Click y to proceed with installation of lsscsi rpm package. Note the Repository
name is listed as local in the above screenshot and this confirms that we are using
the local repository (DVD image) to install this package.

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 16 of 66

OL 6 Package Management - Lab 3

Once the lsscsi package has been installed, you may run the yum info command to
find more information about this package as shown below.
[root@examplehost yum.repos.d]# yum info lsscsi

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 17 of 66

OL 6 Package Management - Lab 3


This concludes this lab. We have now learned how to mount the DVD image file and
then use that mounted image as a local repository for yum command. We also
verified by installing a package from this local repository.
Note: After completing the above exercise, it is recommended to re-enable the
channels in the /etc/yum.repos.d/public-yum-ol6.repo file that you had earlier
disabled.

5.2 Using the RPM Utility


The RPM Package Manager can be used for Package Management tasks on Oracle
Linux 6.3. The rpm command can be used to build, install, query, verify, update and
erase/remove packages. In this lab exercise, we will use some of the common
command line options of rpm command. Some of these command line options and
their purpose is listed in the table below. Refer to man pages of rpm command for
complete details and more information.
RPM Command Line Option

Purpose

rpm -i

Install package

rpm -U

Upgrade package

rpm -e

Erase/remove package

rpm -F

Freshen package(similar to upgrade)

rpm -q

Query option

rpm -V

Verify option

The Oracle Linux 6.3 instance should be up and running and you should be logged in
as the Oracle Linux user with a terminal window opened to enter the following
commands. Your host and the VirtualBox guest system must be able to connect to
the Internet in order to download additional software packages.
We will start this lab by reading the man page of rpm command. Run the man rpm
command on your Oracle Linux 6.3 system and go through the common options and
their purpose.
[root@examplehost ~]# man rpm

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 18 of 66

OL 6 Package Management - Lab 3

Query (-q) Option Examples:


To query for all the RPM packages, installed on your Oracle Linux 6.3 system, run
the rpm commands with the query option as shown below:
[root@examplehost /]# rpm -qa
im-chooser-1.3.1-3.el6.x86_64
perl-parent-0.221-127.el6.x86_64
lklug-fonts-0.6-4.20090803cvs.el6.noarch
newt-python-0.52.11-3.el6.x86_64
filesystem-2.4.30-3.el6.x86_64
pm-utils-1.2.5-9.el6.x86_64
perl-libxml-perl-0.08-10.el6.noarch
kurdit-unikurd-web-fonts-20020502-6.el6.noarch
libuser-python-0.56.13-5.el6.x86_64
....
....
[root@examplehost /]# rpm -qa | more

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 19 of 66

OL 6 Package Management - Lab 3

To query for all packages with the string ssh in the package name, run the following
rpm command:
[root@examplehost /]# rpm -qa | grep ssh
openssh-server-5.3p1-81.el6_3.x86_64
libssh2-1.2.2-11.el6_3.x86_64
openssh-clients-5.3p1-81.el6_3.x86_64
openssh-5.3p1-81.el6_3.x86_64
openssh-askpass-5.3p1-81.el6_3.x86_64
[root@examplehost /]#

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 20 of 66

OL 6 Package Management - Lab 3

To query for an individual package, you can run the rpm command as follows:
[root@examplehost /]# rpm -q openssh-server
openssh-server-5.3p1-81.el6_3.x86_64
[root@examplehost /]#
To check if package foo is installed on your Oracle Linux 6.3 system:
[root@examplehost /]# rpm -q foo
package foo is not installed
[root@examplehost /]#

In addition to the name and version, there is other information available, e.g. the
build and installation date, license, size as well as a short summary and longer
description of the package content. In the example below, we use the i query option
to list the details of tcsh rpm package.

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 21 of 66

OL 6 Package Management - Lab 3


[root@examplehost /]# rpm -qi tcsh

Note: Observe in the above output that the qi option also shows you the Install
Date of a package.
If you want to find out which RPM a file on your Oracle Linux 6.3 system belongs to
you can run the following rpm query command. In the example below we find a file
/etc/motd on our Oracle Linux 6.3 system and want to find out which package
installed this file on the system.
[root@examplehost /]# ls -l /etc/motd
-rw-r--r--. 1 root root 0 Jan 12 2010 /etc/motd
[root@examplehost /]#
[root@examplehost /]# rpm -qf /etc/motd
setup-2.8.14-16.el6.noarch
[root@examplehost /]#

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 22 of 66

OL 6 Package Management - Lab 3

Another cool query option that can be used to find out the list of all files that are
part of a particular package is the ql option. In the example below, we list all files
in the openssh-server package.

[root@examplehost /]# rpm -ql openssh-server


/etc/pam.d/ssh-keycat
/etc/pam.d/sshd
/etc/rc.d/init.d/sshd
/etc/ssh/sshd_config
/etc/sysconfig/sshd
/usr/libexec/openssh/sftp-server
/usr/libexec/openssh/ssh-keycat
/usr/sbin/.sshd.hmac
/usr/sbin/sshd
/usr/share/doc/openssh-server-5.3p1
/usr/share/doc/openssh-server-5.3p1/HOWTO.ssh-keycat
/usr/share/man/man5/moduli.5.gz
/usr/share/man/man5/sshd_config.5.gz
/usr/share/man/man8/sftp-server.8.gz
/usr/share/man/man8/sshd.8.gz
/var/empty/sshd
[root@examplehost /]#

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 23 of 66

OL 6 Package Management - Lab 3

The -d query option displays documentation files only in a particular package. In the
example below, the output shows all the documentation and man pages associated
with the openssh-server package.
[root@examplehost /]# rpm -qd openssh-server
/usr/share/doc/openssh-server-5.3p1/HOWTO.ssh-keycat
/usr/share/man/man5/moduli.5.gz
/usr/share/man/man5/sshd_config.5.gz
/usr/share/man/man8/sftp-server.8.gz
/usr/share/man/man8/sshd.8.gz
[root@examplehost /]#

To list all the configuration files associated with a package, you can use the c query
option of the rpm command as shown below.

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 24 of 66

OL 6 Package Management - Lab 3


[root@examplehost /]# rpm -qc openssh-server
/etc/pam.d/ssh-keycat
/etc/pam.d/sshd
/etc/ssh/sshd_config
/etc/sysconfig/sshd
[root@examplehost /]#

There is one more useful option that can be used with the rpm query commands. It
is the --changelog option. The --changelog option displays change information for a
package. In the example below, we look at changes that happened in different
versions of the httpd package.
[root@examplehost /]# rpm -q httpd --changelog

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 25 of 66

OL 6 Package Management - Lab 3


Other Options of rpm command:
To install a package, you can use the i option of the rpm command. In the example
below, we install the zsh rpm package from the Oracle Linux 6.3 ISO image that was
mounted on /OL6DVD mount point in an earlier lab. The rpm command takes the
file name of the rpm package; hence you need to either cd to the containing
directory, or provide a full path to the file. This is in contrast to yum command,
which uses the repository metaphor and config files in /etc/yum.repos.d to figure
out how to load packages.
[root@examplehost /]# cd /OL6DVD/Packages/
[root@examplehost Packages]# pwd
/OL6DVD/Packages
[root@examplehost Packages]# rpm -q zsh
package zsh is not installed
[root@examplehost Packages]#
[root@examplehost Packages]# ls zsh*rpm
zsh-4.3.10-5.el6.x86_64.rpm
[root@examplehost Packages]#
[root@examplehost Packages]# rpm -i zsh-4.3.105.el6.x86_64.rpm
[root@examplehost Packages]#
[root@examplehost Packages]# rpm -q zsh
zsh-4.3.10-5.el6.x86_64
[root@examplehost Packages]#

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 26 of 66

OL 6 Package Management - Lab 3


You can also use the ihv option to get more verbose output. In the example below,
we install the ftp package from the Oracle Linux 6 DVD using the ihv option.
[root@examplehost Packages]# rpm -q ftp
package ftp is not installed
[root@examplehost Packages]# pwd
/OL6DVD/Packages
[root@examplehost Packages]# ls ftp*
ftp-0.17-51.1.el6.x86_64.rpm
[root@examplehost Packages]# rpm -ihv ftp-0.1751.1.el6.x86_64.rpm
Preparing...
########################################### [100%]
1:ftp
########################################### [100%]
[root@examplehost Packages]#
[root@examplehost Packages]# rpm -q ftp
ftp-0.17-51.1.el6.x86_64
[root@examplehost Packages]#

In the above examples, we installed RPM packages that were locally available on the
system. Using the rpm command, you can also install packages using other
protocols like http. In the example, below we will install the ftp RPM package from
the Oracle Public Yum Server. You will need internet connectivity for this exercise.

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 27 of 66

OL 6 Package Management - Lab 3


[root@examplehost /]# rpm -ihv http://publicyum.oracle.com/repo/OracleLinux/OL6/3/base/x86_64/getPackag
e/ftp-0.17-51.1.el6.x86_64.rpm
Retrieving http://publicyum.oracle.com/repo/OracleLinux/OL6/3/base/x86_64/getPackag
e/ftp-0.17-51.1.el6.x86_64.rpm
Preparing...
########################################### [100%]
1:ftp
########################################### [100%]
[root@examplehost /]#
[root@examplehost /]# rpm -q ftp
ftp-0.17-51.1.el6.x86_64
[root@examplehost /]#

To update a package, you can use the u option of the rpm command as shown in
the example below. This option works only if an update for a package is available. If
no updates are available, it will not do anything (as in example below).
[root@examplehost /]# rpm -Uhv http://publicyum.oracle.com/repo/OracleLinux/OL6/3/base/x86_64/getPackag
e/ftp-0.17-51.1.el6.x86_64.rpm
Retrieving http://publicyum.oracle.com/repo/OracleLinux/OL6/3/base/x86_64/getPackag
e/ftp-0.17-51.1.el6.x86_64.rpm
Preparing...
########################################### [100%]
package ftp-0.17-51.1.el6.x86_64 is already installed
[root@examplehost /]#

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 28 of 66

OL 6 Package Management - Lab 3

Similarly, the f option is to freshen a package installed on your system. This will
also work only if there is a newer version of a package available than what is
installed on your system.

[root@examplehost /]# rpm -Fhv http://publicyum.oracle.com/repo/OracleLinux/OL6/3/base/x86_64/getPackag


e/ftp-0.17-51.1.el6.x86_64.rpm
Retrieving http://publicyum.oracle.com/repo/OracleLinux/OL6/3/base/x86_64/getPackag
e/ftp-0.17-51.1.el6.x86_64.rpm
[root@examplehost /]# rpm -q ftp
ftp-0.17-51.1.el6.x86_64
[root@examplehost /]#

To erase/remove a package from your system, you can run the rpm command with
the e option. In the example below, we remove the ftp package.
[root@examplehost Packages]# rpm -e ftp
[root@examplehost Packages]#
[root@examplehost Packages]# rpm -q ftp
package ftp is not installed
[root@examplehost Packages]#

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 29 of 66

OL 6 Package Management - Lab 3

The V option of rpm command is the verify option and can be used to verify the
integrity of a file or package installed on your system using checksum for
verification. If this command shows no output and exits it means that none of the
files have been modified in any way since the last time the RPM database was
updated. In the example below, we verify the integrity of openssh-server package
using V option and also the integrity of /etc/pam.d/sshd file on the system using
the Vf option.
[root@examplehost
[root@examplehost
[root@examplehost
[root@examplehost

/]# rpm -V openssh-server


/]#
/]# rpm -Vf /etc/pam.d/sshd
/]#

If you would like to explore the remaining options of rpm command, go through the
man pages and try them out on your system. This concludes the lab on rpm
command.

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 30 of 66

OL 6 Package Management - Lab 3


5.3 Using the YUM command
YUM or Yellowdog Updater, Modified is an open-source command-line packagemanagement utility for RPM-compatible Linux operating systems and has been
released under the GNU General Public License. YUM is an interactive rpm based
package manager that can also do dependency analysis for package management
tasks. This means that yum can automatically resolve package dependencies and
determine which packages need to be installed to perform a successful package
installation. Yum also supports the concept of package groups, in which a list of
related packages can be assembled into a group and installed by using the group
name instead of the individual package names for installation.
In this lab, we will use the common yum command line options to do various
package management tasks. This lab requires internet connectivity for your Oracle
Linux 6.3 instance as we will connect to the Oracle Public Yum Server to install
packages.
Some of these command line options and their purpose are listed in the table below.
Refer to man pages of yum command for complete details and more information.

YUM Command Line Option

Purpose

repolist

Produces a list of configured repositories

list

List information about packages

install

Install package

update

Update package

info

Description and summary information

Remove or erase

Remove package

Provides or whatprovides

Which package provides

clean

Clean yum cache directory

As we did in the earlier lab, we will start this lab by reading the man page of yum
command. Run the man yum command on your Oracle Linux 6.3 system and go
through the common options and their purpose.
[root@examplehost ~]# man yum

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 31 of 66

OL 6 Package Management - Lab 3

Look at the YUM repository configuration files in the /etc/yum.respos.d directory.


On your Oracle Linux 6.3 instance, you should see a listing similar to what is shown
below.

Make sure you have internet connectivity and the following two channels enabled in
the /etc/yum.repos.d/public-yum-ol6.repo file:

[ol6_latest]
[ol6_uek_latest]

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 32 of 66

OL 6 Package Management - Lab 3


To enable a channel, remember you have to set enabled=1 as we did in an earlier
lab.
[root@examplehost yum.repos.d]# vi public-yum-ol6.repo
[ol6_latest]
name=Oracle Linux $releasever Latest ($basearch)
baseurl=http://publicyum.oracle.com/repo/OracleLinux/OL6/latest/$basearch/
gpgkey=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6
gpgcheck=1
enabled=1
[ol6_UEK_latest]
name=Latest Unbreakable Enterprise Kernel for Oracle Linux
$releasever ($basearch)
baseurl=http://publicyum.oracle.com/repo/OracleLinux/OL6/UEK/latest/$basearch/
gpgkey=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6
gpgcheck=1
enabled=1

If you do not have the public-yum-ol6.repo file on your system, you can use the
wget http://public-yum.oracle.com/public-yum-ol6.repo command to get that file
and then make sure both the above channels are enabled.
[root@examplehost ~]# cd /etc/yum.repos.d/
[root@examplehost yum.repos.d]# wget http://publicyum.oracle.com/public-yum-ol6.repo

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 33 of 66

OL 6 Package Management - Lab 3

After you have enabled the channels in the repository configuration file (publicyum-ol6.repo file), you can verify the available repositories by running the yum
repolist command.
[root@examplehost /]# yum repolist

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 34 of 66

OL 6 Package Management - Lab 3


Running the yum repolist all command will list the all available channels and their
status as shown in the example below.
[root@examplehost /]# yum repolist all
Loaded plugins: refresh-packagekit, security
repo id
repo name
status
local
OL6u3 DVD Repository
enabled: 3,563
ol6_UEK_base
Unbreakable Enterprise Kernel for
Oracle disabled
ol6_UEK_latest
Latest Unbreakable Enterprise Kernel
for enabled:
120
ol6_addons
Oracle Linux 6Server Add ons (x86_64)
disabled
ol6_ga_base
Oracle Linux 6Server GA installation
medi disabled
ol6_latest
Oracle Linux 6Server Latest (x86_64)
enabled: 18,419
ol6_playground_latest Latest mainline stable kernel for
Oracle disabled
ol6_u1_base
Oracle Linux 6Server Update 1
installatio disabled
ol6_u2_base
Oracle Linux 6Server Update 2
installatio disabled
ol6_u3_base
Oracle Linux 6Server Update 3
installatio disabled
repolist: 22,102
[root@examplehost /]#

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 35 of 66

OL 6 Package Management - Lab 3


Once you have confirmed that above channels are enabled in your repository
configuration file, you can proceed with running the yum command examples
below.
Lets start with a few yum list command and line options. The yum list all
command lists all available and installed packages. The yum list available command
only lists additional available packages that have not been installed yet. The
installed argument creates a list of all packages that are currently installed on the
local system.
[root@examplehost /]# yum list installed
[root@examplehost /]#
[root@examplehost /]# yum list available
[root@examplehost /]#
[root@examplehost /]# yum list all
[root@examplehost /]#

We will now install a package using the yum command. In the example below, we
first check using rpm to see if ftp package is already installed. If it is installed,
remove it first using the e option.
[root@examplehost /]# rpm -q ftp
ftp-0.17-51.1.el6.x86_64
[root@examplehost /]# rpm -e ftp
[root@examplehost /]# rpm -q ftp
package ftp is not installed
[root@examplehost /]#

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 36 of 66

OL 6 Package Management - Lab 3

After removing the ftp package, install this package using the yum install
command as shown below.
[root@examplehost /]# yum install ftp
Loaded plugins: refresh-packagekit, security
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package ftp.x86_64 0:0.17-51.1.el6_3.1 will be
installed
--> Finished Dependency Resolution
......
......
Installed size: 95 k
Is this ok [y/N]: y
Downloading Packages:
.....
.....
Installed:
ftp.x86_64 0:0.17-51.1.el6_3.1
Complete!
[root@examplehost /]#

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 37 of 66

OL 6 Package Management - Lab 3

Observe the above output and note that the ftp package was installed from the
ol6_latest channel repository on the Oracle Public Yum Server.
You can list any package installed using the yum list <package> command. In the
example below, we list the ftp package that was just installed.
[root@examplehost /]# yum list ftp
Loaded plugins: refresh-packagekit, security
Installed Packages
ftp.x86_64
0.17-51.1.el6_3.1
@ol6_latest
[root@examplehost /]#

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 38 of 66

OL 6 Package Management - Lab 3


The yum info command provides a summary and description information among
other things. It also provides Version, release, size information of the package.
[root@examplehost /]# yum info ftp

Another neat option of yum command is the provides or whatprovides option.


The provides option is used to find which package provides some feature or file. In
the example below, we first list all the files of the ftp package. Then we run the
yum provides command to find out about the package information for
/usr/bin/pftp file.
[root@examplehost /]# rpm -ql ftp
/usr/bin/ftp
/usr/bin/pftp
/usr/share/man/man1/ftp.1.gz
/usr/share/man/man1/pftp.1.gz
/usr/share/man/man5/netrc.5.gz
[root@examplehost /]#

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 39 of 66

OL 6 Package Management - Lab 3

[root@examplehost /]# yum provides /usr/bin/pftp


Loaded plugins: refresh-packagekit, security
ftp-0.17-51.1.el6_3.1.x86_64 : The standard UNIX FTP (File
Transfer Protocol)
: client
Repo
: ol6_latest
Matched from:
Filename
: /usr/bin/pftp
ftp-0.17-51.1.el6.x86_64 : The standard UNIX FTP (File
Transfer Protocol)
: client
Repo
: ol6_latest
Matched from:
Filename
: /usr/bin/pftp
ftp-0.17-51.1.el6.x86_64 : The standard UNIX FTP (File
Transfer Protocol)
: client
Repo
: local
Matched from:
Filename
: /usr/bin/pftp
ftp-0.17-51.1.el6_3.1.x86_64 : The standard UNIX FTP (File
Transfer Protocol)
: client
Repo
: installed
Matched from:
Other
: Provides-match: /usr/bin/pftp

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 40 of 66

OL 6 Package Management - Lab 3

To remove a package, you can run the yum remove command as shown in the
example below where we are removing the ftp package.
[root@examplehost /]# yum remove ftp
Loaded plugins: refresh-packagekit, security
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package ftp.x86_64 0:0.17-51.1.el6_3.1 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
....
....
....
Removed:
ftp.x86_64 0:0.17-51.1.el6_3.1
Complete!
[root@examplehost /]#

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 41 of 66

OL 6 Package Management - Lab 3

The yum clean all command can be used to clean the yum cache directory. See
more details of the things that can be cleaned from the yum cache directory by
reading the man pages of the yum command.
[root@examplehost /]# yum clean all
Loaded plugins: refresh-packagekit, security
Cleaning repos: local ol6_UEK_latest ol6_latest
Cleaning up Everything
[root@examplehost /]#

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 42 of 66

OL 6 Package Management - Lab 3


Lets look at the yum update command. The yum update command will list all the
updates available for your system. In the example below, it shows updates are
available for 2 packages. We will skip this update packages and answer N to not
install the listed updates.
NOTE: The number of packages available for update depends on when you are
running this command. It may be possible that a new 6.4 release is available and
running this will upgrade you to a new release. Do not run this upgrade if you have
slow network connection as this process can take some time. Enter N to abort.
[root@examplehost /]# yum update
Loaded plugins: refresh-packagekit, security
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package firefox.x86_64 0:10.0.11-1.0.1.el6_3 will be
updated
---> Package firefox.x86_64 0:10.0.12-1.0.1.el6_3 will be
an update
---> Package xulrunner.x86_64 0:10.0.11-1.0.1.el6_3 will be
updated
---> Package xulrunner.x86_64 0:10.0.12-1.0.1.el6_3 will be
an update
--> Finished Dependency Resolution
Dependencies Resolved
===========================================================
====================
Package
Arch
Version
Repository
Size
===========================================================
====================
Updating:
firefox
x86_64
10.0.12-1.0.1.el6_3
ol6_latest
20 M
xulrunner
x86_64
10.0.12-1.0.1.el6_3
ol6_latest
12 M
Transaction Summary
===========================================================
====================
Upgrade
2 Package(s)
Total download size: 31 M
Is this ok [y/N]: N

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 43 of 66

OL 6 Package Management - Lab 3

The yum version command provides version information of the rpmdb.


[root@examplehost /]# yum version -v
Not loading "rhnplugin" plugin, as it is disabled
Loading "refresh-packagekit" plugin
Loading "security" plugin
Config time: 0.036
Yum Version: 3.2.29
rpmdb time: 0.000
Installed: 6Server/x86_64
1105:27fc9ae4d52be4f30f57cbafc49fd01c7fdd8641
@anaconda-OracleLinuxServer201206261930.x86_64/1340761113
983:c0b9686ac4ec4eee40915e6af0637cbbbdb6185e
@anaconda-UEK2/1340761412
2:90298f71eecc65eef0dde5e0356a6d6752dae199
@local/1340761113
1:7d984de900ff9726014ffe6c445128c617eba0be
@ol6_UEK_latest

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 44 of 66

OL 6 Package Management - Lab 3


3:9b14832f3037e39fb04c6e5d320f783bdc6f9dad
@ol6_latest
115:f16be6cb13cbfe8bc2d55227cf6afbecfb87ad78
installed
1:7f9d92ed17ec41db742f514ecc87b54171cbfde1
Group-Installed: yum
13:e185ed7482b5c711b7a82068acf98a893c93c85a
@anaconda-OracleLinuxServer201206261930.x86_64/1340761113
10:8f6dee8abc81fc92ad3d2109f75d1e0164607068
@ol6_latest
3:a10a504bd8486be240ef391de79d5240d2ec86fd
version
[root@examplehost /]#

We have now tried out some of the common yum command line options.
Lets now look at the yumdownloader command. The yumdownloader command
can be used to download RPM packages from the yum repositories. In the example
below, we will create a /tmp/myrpm directory and then use the yumdownloader
command to download the ftp RPM package to that directory.

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 45 of 66

OL 6 Package Management - Lab 3


[root@examplehost /]# mkdir /tmp/myrpm
[root@examplehost /]# cd /tmp/myrpm
[root@examplehost myrpm]# yumdownloader ftp
Loaded plugins: refresh-packagekit
ftp-0.17-51.1.el6_3.1.x86_64.rpm
57 kB
00:00
[root@examplehost myrpm]#
[root@examplehost myrpm]# pwd
/tmp/myrpm
[root@examplehost myrpm]# ls
ftp-0.17-51.1.el6_3.1.x86_64.rpm
[root@examplehost myrpm]#

Now that we have looked at yum command line examples, lets look at the yum
configuration file /etc/yum.conf and understand all the parameters in this file.
Read the man pages of yum.conf file by running the man yum.conf command.
[root@examplehost /]# man yum.conf

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 46 of 66

OL 6 Package Management - Lab 3

After reading the man pages of yum.conf configuration file, examine the
/etc/yum.conf file on your system. Review all the options and look at the default
values. Go through this file and make sure you understand each option as described
in the man pages.
Some of the important options in yum.conf file are listed below; this is not a
complete list. Refer to man pages of yum.conf for complete list and more details.
cachedir - stores cache and db files
keepcache - Determines whether or not yum keeps the cache of headers and
packages after successful installation. Value1 means keep cache
debuglevel - Debug message output level. Practical range is 0-10. Default is 2.
installonlypkgs - List of package provides that should only ever be installed, never
updated. Kernels in particular fall into this category.
installonly_limit - Number of packages listed in installonlypkgs to keep installed at
the same time. Setting to 0 disables this feature. Default is 3.

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 47 of 66

OL 6 Package Management - Lab 3

This concludes the yum package management tool lab.


NOTE: Make sure you eject the Oracle Linux 6.3 DVD (ISO image used in Lab 5.1). You
should also unselect the V33411-01.iso from the Devices->CD/DVD Devices Menu
option as shown in the screenshot below. If you dont eject and remove the Oracle
Linux ISO file, the VM will try to reinstall the OS at the next reboot.

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 48 of 66

OL 6 Package Management - Lab 3


5.4 Install the Oracle RDBMS Server 11gR2 Pre-install RPM package
The Oracle RDBMS Server 11gR2 Pre-install RPM package (formerly known as
oracle-validated) is designed specifically for Oracle Linux 6. This RPM aids in the
installation of the Oracle Database 11GR2 release
The package name is oracle-rdbms-server-11gR2-preinstall package. This
package is available both from the Oracle Public Yum Server and the ULN network
for Oracle Linux 6 x86_64 (64 Bit) architecture.
In order to install the Oracle Database 11g R2 on Oracle Linux 6, your system needs
to meet a few prerequisites, as outlined in the Linux Installation Guides. Using the
Oracle RDBMS Server 11gR2 Pre-install RPM, you can complete most of the preinstallation configuration tasks. This makes the database installation simpler and
easy.
In this last Package Management lab, we will install this oracle-rdbms-server11gR2-preinstall RPM package and look at some of the changes that this package
makes on a Oracle Linux 6.3 system. This package among other things creates the
oracle user and groups needed for Oracle Database installation.
Lets look at our Oracle Linux 6.3 instance and make sure we do not have an already
existing oracle user and group.
[root@examplehost /]# cat /etc/passwd | grep -i oracle
[root@examplehost /]# cat /etc/group | grep -i oracle
[root@examplehost /]#

As you can see the cat command above did not find any pre-existing oracle
user/group on this system.
Install the oracle-rdbms-server-11gR2-preinstall package using the yum
command as shown below.

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 49 of 66

OL 6 Package Management - Lab 3


[root@examplehost /]# yum install oracle-rdbms-server11gR2-preinstall
Loaded plugins: refresh-packagekit, security
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package oracle-rdbms-server-11gR2-preinstall.x86_64
0:1.0-6.el6 will be installed
--> Processing Dependency: compat-libstdc++-33 for package:
oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64
....
....
....
--> Finished Dependency Resolution
Dependencies Resolved
===========================================================
Package
Arch
Version
Repository
Size
===========================================================
Installing:
oracle-rdbms-server-11gR2-preinstall x86_64 1.0-6.el6
local
15 k
Installing for dependencies:
compat-libcap1
x86_64 1.10-1
local
17 k
compat-libstdc++-33
x86_64 3.2.3-69.el6
local 183 k
gcc-c++
x86_64 4.4.6-4.el6
local 4.7 M
ksh
x86_64 2010062116.el6
local 684 k
libaio-devel
x86_64 0.3.10710.el6
local
13 k
libstdc++-devel
x86_64 4.4.6-4.el6
local 1.5 M
Transaction Summary
===========================================================
=====================
Install
7 Package(s)
Total download size: 7.2 M
Installed size: 22 M

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 50 of 66

OL 6 Package Management - Lab 3


Is this ok [y/N]: y
.....
....
Installed:
oracle-rdbms-server-11gR2-preinstall.x86_64 0:1.0-6.el6
Dependency Installed:
compat-libcap1.x86_64 0:1.10-1
compat-libstdc++-33.x86_64 0:3.2.3-69.el6
gcc-c++.x86_64 0:4.4.6-4.el6
ksh.x86_64 0:20100621-16.el6
libaio-devel.x86_64 0:0.3.107-10.el6
libstdc++-devel.x86_64 0:4.4.6-4.el6
Complete!
[root@examplehost /]#

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 51 of 66

OL 6 Package Management - Lab 3

Once the oracle-rdbms-server-11gR2-preinstall package has been installed, we


can now look at some of the things that this package changes on our Oracle Linux
6.3 system. Lets begin by looking at the /etc/passwd and /etc/group files to see if
the oracle user/group information was created.
[root@examplehost /]# cat /etc/passwd | grep -i oracle
oracle:x:54321:54321::/home/oracle:/bin/bash
[root@examplehost /]#
[root@examplehost /]# cat /etc/group | grep -i oracle
dba:x:54322:oracle
[root@examplehost /]#

As you can see from the above output, this package have created oracle user and
group needed to perform an Oracle DB 11g R2 installation.
This package also makes changes to the /etc/sysctl.conf file and adds settings that
are required for Oracle DB 11g. You can check the changes made using the cat
command as shown below.

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 52 of 66

OL 6 Package Management - Lab 3


[root@examplehost /]# cat /etc/sysctl.conf | grep oracle |
more
# oracle-rdbms-server-11gR2-preinstall setting for fs.filemax is 6815744
# oracle-rdbms-server-11gR2-preinstall setting for
kernel.sem is '250 32000 100
128'
# oracle-rdbms-server-11gR2-preinstall setting for
kernel.shmmni is 4096
# oracle-rdbms-server-11gR2-preinstall setting for
kernel.shmall is 1073741824 o
n x86_64
# oracle-rdbms-server-11gR2-preinstall setting for
kernel.shmall is 2097152 on i
386
# oracle-rdbms-server-11gR2-preinstall setting for
kernel.shmmax is 439804651110
4 on x86_64
# oracle-rdbms-server-11gR2-preinstall setting for
kernel.shmmax is 4294967295 o
n i386
# oracle-rdbms-server-11gR2-preinstall setting for
net.core.rmem_default is 2621
44
# oracle-rdbms-server-11gR2-preinstall setting for
net.core.rmem_max is 4194304
# oracle-rdbms-server-11gR2-preinstall setting for
net.core.wmem_default is 2621
44
# oracle-rdbms-server-11gR2-preinstall setting for
net.core.wmem_max is 1048576
# oracle-rdbms-server-11gR2-preinstall setting for fs.aiomax-nr is 1048576
# oracle-rdbms-server-11gR2-preinstall setting for
net.ipv4.ip_local_port_range
is 9000 65500
[root@examplehost /]#

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 53 of 66

OL 6 Package Management - Lab 3

This package also makes changes to the /etc/security/limits.conf file and adds
settings that are required for Oracle DB 11g. You can check the changes made using
the cat command as shown below.
[root@examplehost /]# cat /etc/security/limits.conf | grep
oracle
# oracle-rdbms-server-11gR2-preinstall setting for nofile
soft limit is 1024
oracle
soft
nofile
1024
# oracle-rdbms-server-11gR2-preinstall setting for nofile
hard limit is 65536
oracle
hard
nofile
65536
# oracle-rdbms-server-11gR2-preinstall setting for nproc
soft limit is 2047
oracle
soft
nproc
2047
# oracle-rdbms-server-11gR2-preinstall setting for nproc
hard limit is 16384
oracle
hard
nproc
16384
# oracle-rdbms-server-11gR2-preinstall setting for stack
soft limit is 10240KB
oracle
soft
stack
10240
# oracle-rdbms-server-11gR2-preinstall setting for stack
hard limit is 32768KB
oracle
hard
stack
32768
[root@examplehost /]#

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 54 of 66

OL 6 Package Management - Lab 3

Well, that completes this lab exercise. We will not be doing the actual Database
installation in this boot camp. If you are interested in learning how to do a Database
install on Oracle Linux 6, you can refer to this Viewlet.

5.5 Setup a Local YUM Repository


The article below describes how to download the latest Oracle Linux packages from
the Unbreakable Linux Network (ULN) and make the packages available through a
local yum server. We will not be doing a lab on this topic but it is recommended to
go through the document below and practice this lab independently at a later time.
How to Create a Local Yum Repository
The high level steps involve registering your server machine with ULN using the
uln_register command, subscribing to channels, creating and then populating the
yum repository directory and finally making the repository directory available via
HTTP access.

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 55 of 66

OL 6 Package Management - Lab 3


5.6 Ksplice Zero Downtime Patching
Ksplice is a feature of Oracle Linux that lets you install and apply important kernel
and security updates without rebooting the system. Most Kernel updates require a
system reboot for them to become effective. Using Ksplice Zero Downtime patching,
you can eliminate downtime, disruption, rebooting when installing and applying
important kernel and security updates. This means you can install a Ksplice
delivered kernel patch while applications are running on your Oracle Linux 6
system. There is literally no interruption what so ever. This Ksplice Zero downtime
patching feature comes free with Oracle Linux Premier Support offering. Oracle is
the only enterprise Linux vendor that can offer zero downtime updates.
Ksplice technology offers several advantages over the traditional approach of
installing updates. Some advantages of using Ksplice are listed below:

Improved Availability of Oracle Linux systems

Enhanced Security

Reduced Operational Cost

Improved Serviceability

There are 3 modes of operation for Ksplice:

Standard

Local

Offline

Note: Installation of Ksplice is very simple but it requires a license key. If your
instructor provides you with a trial license key, you can do the following Ksplice lab.
If the trial license key is unavailable, you will not be able to perform the Ksplice lab
but you can however go through the following Viewlet which covers the standard
mode of operation for Ksplice:
Getting Started with Ksplice Zero Downtime Updates
The above viewlet will show you how to install and use Ksplice Zero downtime
updates on your Oracle Linux 6 systems. To learn about the Local and Offline modes,
you can refer to this blog and also the Ksplice Users Guide. We have also provided
some other resources in the References section below.

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 56 of 66

OL 6 Package Management - Lab 3


Ksplice Standard Mode Lab Exercise: Applying Rebootless Kernel updates
In multi-tier and cloud environments, scheduling reboots of Linux Servers can be
troublesome and inconvenient as service disruptions are usually frowned upon
because they introduce time delays and increase cost of service.
Oracle Ksplice delivers zero downtime updates for Oracle Linux and these updates
are made available via the Oracle Ksplice Uptrack service for both the Unbreakable
Enterprise Kernel (UEK) as well as the Red Hat compatible kernel. Ksplice Uptrack
service enables the customers to apply security and other critical fixes without
rebooting.
In this exercise, you will learn how to download and install Ksplice and how to use it
for applying kernel patches without rebooting. In order for Ksplice to work, you
should actually be running a Linux kernel version for which an update is available.
Setting up Ksplice involves 3 simple steps:
a) Get the Ksplice Uptrack access key (license key)
b) Setup Oracle Ksplice Uptrack account
c) Download and install Ksplice software
Note: Your instructor will provide you with the Ksplice trial license key to perform
this lab. You do not have to setup Oracle Ksplice Uptrack account as this has already
been done by the instructor while obtaining the trial key.
We will only perform the 3rd step of downloading and installing the Ksplice software
in this lab exercise.
To get the Ksplice install package, you will need to make sure you have internet
connectivity available on your system. Also, if needed, setup your proxy server
settings. You can use the following export command line option to set the proxy
server.
# export http_proxy=http://proxy.yourcompany.com:port
# export https_proxy=https://proxy.company.com:port

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 57 of 66

OL 6 Package Management - Lab 3


The next step is to use the wget command to download the install-uptrack script.
Change directory and go to the Downloads directory as shown below.

Run the wget -N https://www.ksplice.com/uptrack/install-uptrack command as


shown below to download the uptrack script.
[root@examplehost Downloads]# wget -N
https://www.ksplice.com/uptrack/install-uptrack

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 58 of 66

OL 6 Package Management - Lab 3


Typing the sh install-uptrack command will list the usage options as shown in the
screenshot below.
[root@examplehost]# sh install-uptrack

As you can see from the above screenshot, you need to provide the Ksplice trial
access key that you received from your instructor as the argument to the sh installuptrack command. Run the sh install-uptrack <ACCESS KEY> command to install
the Ksplice software. See example below.
[root@examplehost]# sh install-uptrack <ACCESS KEY ##>

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 59 of 66

OL 6 Package Management - Lab 3

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 60 of 66

OL 6 Package Management - Lab 3

The Ksplice Uptrack service is now installed. Check the initial kernel version of your
Oracle Linux 6 system using the uname r command. In the example below, the
initial kernel version is 2.6.39-400.17.1.
[root@examplehost ~]# uname -r
2.6.39-400.17.1.el6uek.x86_64
[root@examplehost ~]#

On systems installed with Ksplice uptrack service, it is recommended to use the


uptrack-uname command. The uptrack-uname command accepts the same flags
as the uname command. Run the uptrack-uname r command to check the
effective kernel version. You can see the output is same as what you received with
uname r command at this time. This is because we have not yet started using the
Ksplice uptrack service to apply kernel patches.

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 61 of 66

OL 6 Package Management - Lab 3


[root@examplehost ~]# uptrack-uname -r

There are a couple of different ways to check for available kernel updates. You can
use the rpm query command or the yum list command as shown below to check
for available updates. In the example below, we check for UEK kernel updates using
the yum list kernel-uek command. The output shows that there is a new kernel
update available and its version is 2.6.39-400.17.2.
[root@examplehost ~]# yum list kernel-uek

You can also check for available Ksplice updates using the uptrack-show --available
command. As you can see in the output below, this command also shows that there
is a Ksplice update available.
[root@examplehost ~]# uptrack-show --available

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 62 of 66

OL 6 Package Management - Lab 3


We will install and apply the available Ksplice update using the uptrack-upgrade
command. As you can see that the uptrack-upgrade command has applied the
available update and it then shows the new effective kernel version as 2.6.39400.17.2.
[root@examplehost ~]# uptrack-upgrade

You can also run the uptrack-uname r command to check the effective kernel
version.
[root@examplehost ~]# uptrack-uname -r

This shows how easily you updated the kernel version of your Oracle Linux 6 system
without rebooting the system and while your applications were running on the
system. Ksplice Uptrack service applies the kernel updates in memory of the system.
Run the uname r command and you will notice that it continues to show the old
kernel version. We do this intentionally by design because some applications are not
used to kernel version changes underneath them while they are running and
because of some other technical reasons. Hence it is recommended to use the
uptrack-uname command on Ksplice enabled systems.
[root@examplehost ~]# uname -r

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 63 of 66

OL 6 Package Management - Lab 3

To find out what Ksplice updates are installed on an Oracle Linux 6 system, you can
run the uptrack-show command as shown in the example below.
[root@examplehost ~]# uptrack-show

The good thing about Ksplice updates are that they are easy to remove as well. If you
install a Kernel update using Ksplice and for some reason want to back out and go
back to the original kernel version you can do that using the uptrack-remove
command. You can run the uptrack-remove command to remove all updates or
specific updates using the update IDs.
Run the uptrack-remove command to remove the installed Ksplice updates. In the
example below, we do not remove the Ksplice updates by answering N to abort.
[root@examplehost ~]# uptrack-remove --all

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 64 of 66

OL 6 Package Management - Lab 3

The main configuration file of Ksplice uptrack service is the


/etc/uptrack/uptrack.conf file. Examine the /etc/uptrack/uptrack.conf file on
your system and familiarize with the available settings. You can run the cat
/etc/uptrack/uptrack.conf command to examine this configuration file. You can
configure your systems to automatically install updates as they become available. To
enable autoinstall, set autoinstall = yes in your /etc/uptrack/uptrack.conf file, or
pass the --autoinstall flag during installation.
[root@examplehost ~]# cat /etc/uptrack/uptrack.conf

Oracle Ksplice patches are stored locally on the file system in /var/cache/uptrack
directory and by default will automatically be re-applied after a reboot.
Ksplice also offers a web interface that can you used to manage your Ksplice enabled
systems. If you are interested in seeing the Ksplice web interface, you can ask your
instructor to use the Ksplice Uptrack account to log in and demonstrate the available
functionality. This concludes the short lab on using Ksplice zero downtime patching.

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 65 of 66

OL 6 Package Management - Lab 3


6 Lab Summary
In this lab you learned about package management on Oracle Linux 6.3 using a local
repository as well as using the Oracle Public Yum Server. You installed, listed,
removed packages using both RPM and YUM commands. You also looked the
oracle-rdbms-server-11gR2-preinstall package and observed what it changes on
the system. We also learned about the unique Ksplice Zero Downtime Patching
feature of Oracle Linux 6 that helps you keep your systems secure and reduces
operational costs.

7 References
For more information and next steps, please consult additional resources: Click the
hyperlinks to access the resource.
Oracle Linux 6 Yum Documentation
Oracle Linux 6 ULN Documentation
Ksplice Users Guide
Ksplice (PDF)
Ksplice Offline (PDF)
Ksplice (FAQ)

For Oracle employees and authorized partners only. Do


not distribute to third parties.
2013 Oracle Corporation

OL 6 - Lab 03

Page 66 of 66

Anda mungkin juga menyukai