博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
RH133读书笔记(2)-Lab 2 Working with packages
阅读量:7199 次
发布时间:2019-06-29

本文共 5609 字,大约阅读时间需要 18 分钟。

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

 

转载于:https://www.cnblogs.com/thlzhf/p/3437783.html

你可能感兴趣的文章
git 命令自动补全
查看>>
(转)真实经纬度的最简单获得方法
查看>>
解读微信公众号的推广运营之道
查看>>
以后不用再出门购物?下单菜鸟就从你家门口发货,2小时就能到!
查看>>
我知道苏宁会玩,但没想到它能把“千人千面”玩到了极致
查看>>
年终回顾:2017年的重大软件开发事态发展
查看>>
国家邮政局:去年12月快递服务申诉量同比下降25.9%
查看>>
山西藏家捐献44幅明清寺观壁画在山西博物院展出(图)
查看>>
日本统合幕僚长否认“威胁飞行” 要求韩方冷静应对
查看>>
美银行电讯业出手援助联邦雇员 政府重开见曙光?
查看>>
去年检察机关依法决定不批捕29万余人 同比上升10.8%
查看>>
“走出去” 哈弗全球500万盛典暨全球战略发布会举行
查看>>
注解就这么简单
查看>>
每页500条数据的渲染优化思路(1)
查看>>
极客侦探闯关题:编程解密,拯救老板|2019福利贴
查看>>
Scrapy 如何设置日志
查看>>
BCH的超级大利好
查看>>
由React Router引起的组件重复渲染谈Route的使用姿势
查看>>
iOS性能优化之页面加载速率
查看>>
Google JavaScript 代码风格指南
查看>>