redhat yum设置及安装httpd

##redhat7.3 yum设置及安装httpd

参考:

https://www.cnblogs.com/ontoweb-zp/p/9268008.html

使用163的yum
http://mirrors.163.com/centos/7/os/x86_64/Packages/
#下载yum安装包
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.27-14.el6.centos.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-158.el7.centos.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-45.el7.noarch.rpm

#安装
rpm -ivh python-iniparse-0.4-9.el7.noarch.
rpm -ivh yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
rpm -ivh yum-3.4.3-158.el7.centos.noarch.rpm #会出现问题1
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/rpm-4.11.3-32.el7.x86_64.rpm
rpm -Uvh rpm-4.11.3-32.el7.x86_64.rpm --nodeps
rpm -ivh yum-3.4.3-158.el7.centos.noarch.rpm yum-plugin-fastestmirror-1.1.31-45.el7.noarch.rpm
错误:依赖检测失败:

rpm >= 0:4.11.3-22 被 yum-3.4.3-154.el7.centos.noarch 需要
yum >= 3.0 被 yum-plugin-fastestmirror-1.1.31-45.el7.noarch 需要 

解决:
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/rpm-4.11.3-32.el7.x86_64.rpm
rpm -Uvh rpm-4.11.3-32.el7.x86_64.rpm --nodeps

设置yum文件(注意 baseurl=http://mirrors.163.com/centos/7.3.1611/updates/$basearch/中 7.3.1611需要统一更新为7)

vi /etc/yum.repos.d/aliyun.repo
[base]
name=CentOS- r e l e a s e v e r − B a s e b a s e u r l = h t t p : / / m i r r o r s . 163. c o m / c e n t o s / 7 / o s / releasever -Base baseurl=http://mirrors.163.com/centos/7/os/ releaseverBasebaseurl=http://mirrors.163.com/centos/7/os/basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7

#released updates
[updates]
name=CentOS- r e l e a s e v e r − U p d a t e s b a s e u r l = h t t p : / / m i r r o r s . 163. c o m / c e n t o s / 7 / u p d a t e s / releasever - Updates baseurl=http://mirrors.163.com/centos/7/updates/ releaseverUpdatesbaseurl=http://mirrors.163.com/centos/7/updates/basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7

[extras]
name=CentOS- r e l e a s e v e r − E x t r a s b a s e u r l = h t t p : / / m i r r o r s . 163. c o m / c e n t o s / 7 / e x t r a s / releasever - Extras baseurl=http://mirrors.163.com/centos/7/extras/ releaseverExtrasbaseurl=http://mirrors.163.com/centos/7/extras/basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS- r e l e a s e v e r − P l u s b a s e u r l = h t t p : / / m i r r o r s . 163. c o m / c e n t o s / 7 / c e n t o s p l u s / releasever - Plus baseurl=http://mirrors.163.com/centos/7/centosplus/ releaseverPlusbaseurl=http://mirrors.163.com/centos/7/centosplus/basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.163.com/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7

[root@localhost yum.repos.d]# yum install httpd
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

File contains no section headers.
file: file:///etc/yum.repos.d/aliyun.repo, line: 1
‘se]\n’
[root@localhost yum.repos.d]# vi ali*
[root@localhost yum.repos.d]# yum install httpd
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/4): base/x86_64/group_gz | 166 kB 00:00:00
(2/4): extras/x86_64/primary_db | 204 kB 00:00:00
(3/4): base/x86_64/primary_db | 5.9 MB 00:00:01
(4/4): updates/x86_64/primary_db | 6.0 MB 00:00:01
Resolving Dependencies
–> Running transaction check
—> Package httpd.x86_64 0:2.4.6-80.el7.centos.1 will be installed
–> Processing Dependency: httpd-tools = 2.4.6-80.el7.centos.1 for package: httpd-2.4.6-80.el7.centos.1.x86_64
–> Processing Dependency: /etc/mime.types for package: httpd-2.4.6-80.el7.centos.1.x86_64
–> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.4.6-80.el7.centos.1.x86_64
–> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.4.6-80.el7.centos.1.x86_64
–> Running transaction check
—> Package apr.x86_64 0:1.4.8-3.el7_4.1 will be installed
—> Package apr-util.x86_64 0:1.5.2-6.el7 will be installed
—> Package httpd-tools.x86_64 0:2.4.6-80.el7.centos.1 will be installed
—> Package mailcap.noarch 0:2.1.41-2.el7 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================
Package Arch Version Repository Size

Installing:
httpd x86_64 2.4.6-80.el7.centos.1 updates 2.7 M
Installing for dependencies:
apr x86_64 1.4.8-3.el7_4.1 base 103 k
apr-util x86_64 1.5.2-6.el7 base 92 k
httpd-tools x86_64 2.4.6-80.el7.centos.1 updates 90 k
mailcap noarch 2.1.41-2.el7 base 31 k

Transaction Summary

Install 1 Package (+4 Dependent packages)

Total download size: 3.0 M
Installed size: 10 M
Is this ok [y/d/N]: y
Downloading packages:
warning: /var/cache/yum/x86_64/$releasever/base/packages/apr-1.4.8-3.el7_4.1.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Public key for apr-1.4.8-3.el7_4.1.x86_64.rpm is not installed
(1/5): apr-1.4.8-3.el7_4.1.x86_64.rpm | 103 kB 00:00:00
Public key for httpd-tools-2.4.6-80.el7.centos.1.x86_64.rpm is not installed
(2/5): httpd-tools-2.4.6-80.el7.centos.1.x86_64.rpm | 90 kB 00:00:00
(3/5): apr-util-1.5.2-6.el7.x86_64.rpm | 92 kB 00:00:00
(4/5): mailcap-2.1.41-2.el7.noarch.rpm | 31 kB 00:00:00
(5/5): httpd-2.4.6-80.el7.centos.1.x86_64.rpm | 2.7 MB 00:00:00

Total 4.8 MB/s | 3.0 MB 00:00:00
Retrieving key from http://mirrors.163.com/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7
Importing GPG key 0xF4A80EB5:
Userid : “CentOS-7 Key (CentOS 7 Official Signing Key) security@centos.org
Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
From : http://mirrors.163.com/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
** Found 5 pre-existing rpmdb problem(s), ‘yum check’ output follows:
PackageKit-1.0.7-6.el7.x86_64 has missing requires of PackageKit-backend
anaconda-core-21.48.22.93-1.el7.x86_64 has missing requires of yum-utils >= (‘0’, ‘1.1.11’, ‘3’)
rhn-check-2.0.2-8.el7.noarch has missing requires of yum-rhn-plugin >= (‘0’, ‘1.6.4’, ‘1’)
rpm-libs-4.11.3-21.el7.x86_64 has missing requires of rpm = (‘0’, ‘4.11.3’, ‘21.el7’)
rpm-python-4.11.3-21.el7.x86_64 has missing requires of rpm = (‘0’, ‘4.11.3’, ‘21.el7’)
Installing : apr-1.4.8-3.el7_4.1.x86_64 1/5
Installing : apr-util-1.5.2-6.el7.x86_64 2/5
Installing : httpd-tools-2.4.6-80.el7.centos.1.x86_64 3/5
Installing : mailcap-2.1.41-2.el7.noarch 4/5
Installing : httpd-2.4.6-80.el7.centos.1.x86_64 5/5
Verifying : mailcap-2.1.41-2.el7.noarch 1/5
Verifying : httpd-tools-2.4.6-80.el7.centos.1.x86_64 2/5
Verifying : apr-util-1.5.2-6.el7.x86_64 3/5
Verifying : apr-1.4.8-3.el7_4.1.x86_64 4/5
Verifying : httpd-2.4.6-80.el7.centos.1.x86_64 5/5

Installed:
httpd.x86_64 0:2.4.6-80.el7.centos.1

Dependency Installed:
apr.x86_64 0:1.4.8-3.el7_4.1 apr-util.x86_64 0:1.5.2-6.el7
httpd-tools.x86_64 0:2.4.6-80.el7.centos.1 mailcap.noarch 0:2.1.41-2.el7

Complete!
[root@localhost yum.repos.d]# service httpd start
Redirecting to /bin/systemctl start httpd.service
[root@localhost yum.repos.d]#

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值