Lab 2 Working with packages

Goal: To gain working experience with package management

System Setup: A working install of Red Hat Enterprise Linux 5 connected to the classroom network

Situation: You have been asked to connect a system to your company's private yum repository to install and update software.

Sequence 1: Using RPM

Instructions:

1. Change to /net/server1/var/ftp/pub. In the Server directory, use rpm -i to install the x3270-x11 RPM. This should fail. Correct the problem.

# cd /net/server1/var/ftp/pub
# cd Server
# rpm -ivh x3270-x11*
warning: x3270-x11-3.3.4p73.el5.1.i386.rpm: Header V3 DSA ...
error: Failed dependencies:
x3270 = 3.3.4p7 is needed by x3270-x11-3.3.4p73.el5.1.i386

The RPM is indicating it can not install until you resolve the dependencies. Install the x3270 RPM, then attempt x3270-x11 again.

# rpm -ivh x3270-3.3.4p7*
warning: x3270-3.3.4p73.el5.1.i386.rpm: Header V3 DSA ...
Preparing... ############################ [100%]
1:x3270 ############################ [100%]

# rpm -ivh x3270x11*
warning: x3270-x11-3.3.4p73.el5.1.i386.rpm: Header V3 DSA ...
Preparing... ############################ [100%]
1:x3270-x11 ############################ [100%]

2. In the errata directory, use rpm -i to install the autofs RPM. This should fail. Correct the problem.

a. [root@stationX]# cd ../errata

b. [root@stationX]# rpm -ivh autofs*
warning: autofs...
Preparing... ############################ [100%]
file /usr/lib/autofs/lookup_file.so from install of
autofs-5.0.10.rc2.43.0.2 conflicts with file from package
autofs-5.0.10.rc2.42
... output truncated ...

c. The install failed, since another version of the RPM is already installed. This time, attempt an upgrade instead of an install.

d. [root@stationX]# rpm -Uvh autofs*
warning: autofs...
Preparing... ############################ [100%]
1:autofs ############################ [100%]

3. Use rpm queries to answer the following questions. In the blank spaces, write in the command used to find the answers.

What files are in the initscripts package?

[root@stationX]# rpm -ql initscripts

On what host was the bash RPM built, and what is its installed size?

[root@stationX]# rpm -qi bash

Has the pam package changed since it was installed?

[root@stationX]# rpm -V pam

Which installed packages have "gnome" in their names?

[root@stationX]# rpm -qa | grep gnome

Which RPM provides /etc/inittab?

[root@stationX]# rpm -qf /etc/inittab

Which RPM provides /etc/hosts? Why?

[root@stationX]# rpm -qf /etc/hosts

No RPM provides /etc/hosts because this file is created by Anaconda during installation.

4. RPM signatures

Practice checking the signature and integrity of an RPM package file of your choosing from your CD-ROM or from server1.

Import Red Hat's GPG key to RPM's system-wide keyring. The key can be found on first CD or /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release.

[root@stationX]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

Check the signature of some original RPMs from the server.

[root@stationX]# cd /net/server1/var/ft/pub/Server
[root@stationX]# rpm -K mutt-version.i386.rpm

Create a corrupted RPM, and then verify it. Start by copying an RPM file to /tmp, then use the cat command to append some extraneous data to the end of the file.

[root@stationX]# cp /net/server1/var/ftp/pub/Server/mutt-version.i386.rpm /tmp
[root@stationX]# cat /bin/date >> /tmp/mutt-version.i386.rpm
[root@stationX]# rpm -K /tmp/mutt-version.i386.rpm

This command should fail.

Sequence 2: Connecting to a private repository

Scenario: You are asked to connect your system to the private repository located on server1.

Deliverable: A system configured to use the repository located on server1

Instructions:

1. Create a file /etc/yum.repos.d/server1.repo pointing to a repository with the name GLS located at the URL http://server1.example.com/pub/gls/RPMS. Make sure you enable the repository.

Create the file /etc/yum.repos.d/server1.repo with the following content:

[GLS]
name=Private classroom repository
baseurl=http://server1.example.com/pub/gls/RPMS
enabled=1
gpgcheck=0

Make sure you have configured the repository correctly by issuing the command: yum list rhce-ts.

Sequence 3: Installing new packages using yum

Instructions:

1. Use yum to list all packages containing 'rhce-ts' in their name.

To list all packages containing 'rhce-ts' in their name you could issue the command: yum list '*rhce-ts*'

2. Install the package you just found in the previous step.

To install the package rhce-ts you could issue the command yum install rhce-ts When yum asks for confirmation enter y.

Sequence 4: Updating software using yum

Instructions:

1. Use yum to check if there are updates available for your system.

Replace your existing /etc/yum.repos.d/server1.repo file by downloading an updated copy from the URL ftp://server1.example.com/pub/gls/server1.repo. This will point yum to additional repositories containing the base Red Hat Enterprise Linux packages and available updates to those packages.

a. [root@stationX]# cd /etc/yum.repos.d

b. [root@stationX]# mv server1.repo /tmp/

c. [root@stationX]# wget ftp://server1.example.com/pub/gls/server1.repo

d. To find out if there are updates available for your system use the command: yum check-update

2. Select one package from the previous step and update it.

a. To update only a specific package you can use yum update package-name

b. Install the kernel package:

[root@stationX]# yum update kernel

3. Now install all available updates for your system.

a. To install all available updates for your system issue the command: yum update

RH133读书笔记(2)-Lab 2 Working with packages的更多相关文章

  1. RH133读书笔记(1)-Lab 1 Managing Startup

    Lab 1 Managing Startup Goal: To familiarize yourself with the startup process System Setup: A system ...

  2. RH133读书 笔记(5) - Lab 5 User and Group Administration

    Lab 5 User and Group Administration Goal: To build skills for user and group administration. Estimat ...

  3. RH133读书 笔记(4) - Lab 4 System Services

    Lab 4 System Services Goal: Develop skills using system administration tools and setting up and admi ...

  4. RH133读书 笔记(3) - Lab 3 Configuring the kernel

    Lab 3 Configuring the kernel Goal: Develop skills tuning the /proc filesystem. Gain some experience ...

  5. RH133读书笔记(6) - Lab 6 Adding New Filesystems to the Filesystem Tree

    Lab 6 Adding New Filesystems to the Filesystem Tree Goal: Develop skills and knowlege related to par ...

  6. RH133读书笔记(9)-Lab 9 Installation and System-Initialization

    Lab 9 Installation and System-Initialization Goal: Successfully install Red Hat Enterprise Linux. Sy ...

  7. RH133读书笔记(8)-Lab 8 Manage Network Settings

    Lab 8 Manage Network Settings Goal: To build skills needed to manually configure networking Estimate ...

  8. RH133读书笔记(7)-Lab 7 Advanced Filesystem Mangement

    Lab 7 Advanced Filesystem Mangement Goal: Develop skills and knowlege related to Software RAID, LVM, ...

  9. RH133读书笔记(10)-Lab 10 Exploring Virtualization

    Lab 10 Exploring Virtualization Goal: To explore the Xen virtualization environment and the creation ...

随机推荐

  1. Matlab---串口操作---数据採集篇

    matlab功能强大,串口操作也非常easy.相信看过下面两个实验你就能掌握咯! 開始吧! 实验1: 从电脑COM2口读取数据.并将数据保存在TXT文件里,方便数据分析,以下是M脚本: %名 称:Ma ...

  2. Android清理设备内存具体完整演示样例(一)

    MainActivity例如以下: package come.on; import android.app.Activity; import android.content.Context; impo ...

  3. python列表和QVariant

    pyqt中.要给QAbstractTableModel的setData函数传递一个list參数: [20,'00:00:19'] 涉及到QVariant和list的转换. 能够使用QVariant类中 ...

  4. Filter基金会

    一个.总结 简单的说,Filter的作用就是拦截(Tomcat的)service(Request,Response)方法.拿到Request.Response对象进行处理.然后释放控制.继续自己主动流 ...

  5. (转)Python获取当时时间

    我有的时候写程序要用到当前时间,我就想用python去取当前的时间,虽然不是很难,但是老是忘记,用一次丢一次, 为了能够更好的记住,我今天特意写下python 当前时间这篇文章,如果你觉的对你有用的话 ...

  6. Ubuntu下将vim配置为Python IDE(转)

    工欲善其事,必先利其器. 配置好了Django的环境,该把vim好好配置一下当做python的IDE来用. 在Windows下用惯了各种现成的工具,转到Linux下,一下没了头绪……好歹google出 ...

  7. Eclipse设置的断点失效的解决办法

    使用Eclipse的同胞们,如果你哪天惊奇的发现调试时,明明设置了断点,按道理就是要执行设置断点的那条语句的,可是偏偏Eclipse视你设置的断点不见,不要害怕,不要恐慌,这样的问题不应该导致偶们疯狂 ...

  8. elf 文件格式探秘——程序运行背后的故事

    摘要:本文主要讲解elf文件格式,通过readelf命令结合底层的相关数据结构,讲解相关内容,分析程序运行的基本原理. 本文来源:elf 文件格式探秘——程序运行背后的故事 http://blog.c ...

  9. Java 小样例:图书馆课程设计(Java 8 版)

    用 Java 模拟一个图书馆.包含创建图书.创建读者.借书.还书.列出全部图书.列出全部读者.列出已借出的图书.列出过期未还的图书等功能. 每一个读者最多仅仅能借 3 本书,每一个书最多仅仅能借 3 ...

  10. Learning Cocos2d-x for WP8(2)——深入刨析Hello World

    原文:Learning Cocos2d-x for WP8(2)--深入刨析Hello World cocos2d-x框架 在兄弟篇Learning Cocos2d-x for XNA(1)——小窥c ...