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. GitHub 优秀Android 开源项目

    阅读目录 1.Xabber客户端 2.oschina客户端 3.手机安全管家 4.星座连萌 5.玲闹铃 6.魔乐盒 7.PWP日历 8.Apollo音乐播放器 9.夏普名片识别 10.高仿人人网 11 ...

  2. 一种单片机支持WiFi的应用——SimpleWiFi在单片机中的应用

    一种单片机支持WiFi的应用——SimpleWiFi在单片机中的应用 先上图: 现在的智能控制都是基于微控制器,随着智能的手持终端的普及,基于智能终端的控制就会越来越普遍. WIFI便是其中的一种.W ...

  3. [Ext JS 4] Extjs 它 initComponent 和 constructor差分

    initComponent 和 constructor是什么 Extjs 提供的组件还是挺丰富的, 可是有时候需求更丰富. 当Extjs 原生的组件无法实现我们的要求的时候, 就须要扩展Extjs 的 ...

  4. Linux内核升级

    一.测试环境 CentOS6.5 X86 64位 内核版本为 2.6.32 VM 10.07 二.编译内核版本 2.1.kernel 3.2.71 2.2.kernel 3.4.108 2.3.ker ...

  5. centos5.5字体为方块问题的解决_深入学习编程_百度空间

    centos5.5字体为方块问题的解决_深入学习编程_百度空间 centos5.5字体为方块问题的解决 一.yum -y install fonts-chinese二.yum -y install f ...

  6. www.centos.org

    https://www.centos.org/forums/viewtopic.php?t=5770 In order to conserve the limited bandwidth availa ...

  7. hdu4578(线段树)

    题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=4578 题意:n个数,初始值为0,4种操作: 1.将某个区间所有值加上另一个值: 2.将区间所有值都乘上 ...

  8. Java多线程使用场景

    使用多线程就一定效率高吗? 有时候使用多线程并不是为了提高效率,而是使得CPU能够同时处理多个事件. 使用场景1 为什么了不阻塞主线程,启动其他线程来做耗时的事情. 比如app开发中耗时的操作都不在U ...

  9. Memcached在.net中的应用

    一.MemCached下载 服务端下载:http://memcachedproviders.codeplex.com/ client下载:path=/trunk">http://sou ...

  10. pygame系列_draw游戏画图

    说到画图,pygame提供了一些很有用的方法进行draw画图. ''' pygame.draw.rect - draw a rectangle shape draw a rectangle shape ...