LAB 11.1_Managing Software
LAB 11.1_Managing Software
6. Now that you have created your own repository, you might as
well start using it. In the /etc/yum.repos.d directory, create a
file with the name my.repo. Make sure this file has the following
contents:
[myrepo]
name=myrepo
baseurl=file:///repo
7. Type yum repolist to verify the availability of the newly
created repository. It should show the name of the myrepo
repository, including the number of packages that is offered
through this repository.
Exercise 11.2 Using yum for Package Management
In this exercise, you use yum for common package management
tasks.
1. Type yum repolist to show a list of the current repositories
that your system is using.
2. Type yum search xeyes . This will give no matching result.
3. Type yum provides */xeyes . The command shows that the
xorg-x11-apps-<version> package contains this file.
4. Install this package using yum install -y xorg-x11-apps .
Depending on your current configuration, you might notice that
quite a few dependencies have to be installed also.
5. Type yum list xorg-x11-apps . You see that the package is
listed as installed.
6. Type yum history and notice the number of the last yum
command you used.
7. Type yum history undo <nn> (where <nn> is replaced with
the number that you found in step 6). This undoes the last action,
so it removes the package you just installed.
8. Repeat the yum list xorg-x11-apps command. The package
is now listed as available but not as installed.
Exercise 11.3 Using RPM Queries
In this exercise, you learn how to use RPM queries to get more
information about software that is installed on your RHEL system.
1. Type which dnsmasq . This command gives the complete path
name of the dnsmasq command.
2. Type rpm -qf $(which dnsmasq) . This will do an RPM file
query on the result of the which dnsmasq command; you learn
more about this technique in Chapter 31 , “An Introduction to
Bash Shell Scripting.”
3. Now that you know that the dnsmasq binary comes from the
dnsmasq package, use rpm -qi dnsmasq to show more
information about the package.
4. The information that is shown with rpm -qi is useful, but it does
not give the details that are needed to start working with the
software in the package. Use rpm -ql dnsmasq to show a list of
all files in the package.
5. Use rpm -qd dnsmasq to show the available documentation.
Notice that this command reveals that there is a man page, but
there is also a doc.html and a setup.html file in the
/usr/share/doc/dnsmasq-version directory. Open these files with
your browser to get more information about the use of dnsmasq.
6. Type rpm -qc dnsmasq to see which configuration files are
used by dnsmasq.
7. After installation, it does not make much sense, but it is always
good to know which scripts are executed when a package is
installed. Use rpm -q –scripts dnsmasq to show the script code
that can be executed from this RPM.
End-of-Chapter Labs
In the end-of-chapter labs, you use some of the essential RHEL
package managementskills. All assignments can be done on one
server.
Lab 11.1
1. Copy some RPM files from the installation disk to the /myrepo
directory.
Make this directory a repository and make sure that your server is
using this repository.
2. List the repositories currently in use on your server.
3. Search for the package that contains the cache only DNS name
server. Do not install it yet.
4. Perform an extensive query of the package so that you know
before you install it which files it contains, which dependencies it
has, and where to find the documentation and configuration.
5. Check whether the RPM contains any scripts. You may
download it, but you may not install it yet; you want to know
which scripts are in a package before actually installing it, right?
6. Install the package you have found in step 3.
7. Undo the installation.