1.将Linux系统的iso镜像文件上传到Linux中
2.将文件挂载到/mnt(这个文件夹随意)下
3.先查看挂载路径:df -h 然后设置永久挂载: vim /etc/fstab 去将文件修改下 (此步骤可不做)
4. 去挂载文件下的安装包文件 :cd /mnt/Packages/
5.执行这三个命令去安装三个yum文件(自己看自己包下面相对应的版本,不一定跟下面的版本一样,打前面几个字母用tab补全就行了):
rpm -ivh python-iniparse-0.4-9.el7.noarch.rpm
rpm -ivh yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
rpm -ivh yum-3.4.3-118.el7.centos.noarch.rpm yum-plugin-fastestmirror-1.1.31-24.el7.noarch.rpm
6.最后清一下缓存加载元数据:yum clean all && yum makecache
可以自行配置/etc/yum.repos.d/下面的repo文件:
aliyun.repo (阿里云的镜像文件):
[base]
name=CentOS-
r
e
l
e
a
s
e
v
e
r
−
B
a
s
e
−
m
i
r
r
o
r
s
.
a
l
i
y
u
n
.
c
o
m
f
a
i
l
o
v
e
r
m
e
t
h
o
d
=
p
r
i
o
r
i
t
y
b
a
s
e
u
r
l
=
h
t
t
p
:
/
/
m
i
r
r
o
r
s
.
a
l
i
y
u
n
.
c
o
m
/
c
e
n
t
o
s
/
releasever - Base - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/
releasever−Base−mirrors.aliyun.comfailovermethod=prioritybaseurl=http://mirrors.aliyun.com/centos/releasever/os/
b
a
s
e
a
r
c
h
/
h
t
t
p
:
/
/
m
i
r
r
o
r
s
.
a
l
i
y
u
n
c
s
.
c
o
m
/
c
e
n
t
o
s
/
basearch/ http://mirrors.aliyuncs.com/centos/
basearch/http://mirrors.aliyuncs.com/centos/releasever/os/
b
a
s
e
a
r
c
h
/
h
t
t
p
:
/
/
m
i
r
r
o
r
s
.
c
l
o
u
d
.
a
l
i
y
u
n
c
s
.
c
o
m
/
c
e
n
t
o
s
/
basearch/ http://mirrors.cloud.aliyuncs.com/centos/
basearch/http://mirrors.cloud.aliyuncs.com/centos/releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/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
−
m
i
r
r
o
r
s
.
a
l
i
y
u
n
.
c
o
m
f
a
i
l
o
v
e
r
m
e
t
h
o
d
=
p
r
i
o
r
i
t
y
b
a
s
e
u
r
l
=
h
t
t
p
:
/
/
m
i
r
r
o
r
s
.
a
l
i
y
u
n
.
c
o
m
/
c
e
n
t
o
s
/
releasever - Updates - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/
releasever−Updates−mirrors.aliyun.comfailovermethod=prioritybaseurl=http://mirrors.aliyun.com/centos/releasever/updates/
b
a
s
e
a
r
c
h
/
h
t
t
p
:
/
/
m
i
r
r
o
r
s
.
a
l
i
y
u
n
c
s
.
c
o
m
/
c
e
n
t
o
s
/
basearch/ http://mirrors.aliyuncs.com/centos/
basearch/http://mirrors.aliyuncs.com/centos/releasever/updates/
b
a
s
e
a
r
c
h
/
h
t
t
p
:
/
/
m
i
r
r
o
r
s
.
c
l
o
u
d
.
a
l
i
y
u
n
c
s
.
c
o
m
/
c
e
n
t
o
s
/
basearch/ http://mirrors.cloud.aliyuncs.com/centos/
basearch/http://mirrors.cloud.aliyuncs.com/centos/releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
#additional packages that may be useful
[extras]
name=CentOS-
r
e
l
e
a
s
e
v
e
r
−
E
x
t
r
a
s
−
m
i
r
r
o
r
s
.
a
l
i
y
u
n
.
c
o
m
f
a
i
l
o
v
e
r
m
e
t
h
o
d
=
p
r
i
o
r
i
t
y
b
a
s
e
u
r
l
=
h
t
t
p
:
/
/
m
i
r
r
o
r
s
.
a
l
i
y
u
n
.
c
o
m
/
c
e
n
t
o
s
/
releasever - Extras - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/
releasever−Extras−mirrors.aliyun.comfailovermethod=prioritybaseurl=http://mirrors.aliyun.com/centos/releasever/extras/
b
a
s
e
a
r
c
h
/
h
t
t
p
:
/
/
m
i
r
r
o
r
s
.
a
l
i
y
u
n
c
s
.
c
o
m
/
c
e
n
t
o
s
/
basearch/ http://mirrors.aliyuncs.com/centos/
basearch/http://mirrors.aliyuncs.com/centos/releasever/extras/
b
a
s
e
a
r
c
h
/
h
t
t
p
:
/
/
m
i
r
r
o
r
s
.
c
l
o
u
d
.
a
l
i
y
u
n
c
s
.
c
o
m
/
c
e
n
t
o
s
/
basearch/ http://mirrors.cloud.aliyuncs.com/centos/
basearch/http://mirrors.cloud.aliyuncs.com/centos/releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/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
−
m
i
r
r
o
r
s
.
a
l
i
y
u
n
.
c
o
m
f
a
i
l
o
v
e
r
m
e
t
h
o
d
=
p
r
i
o
r
i
t
y
b
a
s
e
u
r
l
=
h
t
t
p
:
/
/
m
i
r
r
o
r
s
.
a
l
i
y
u
n
.
c
o
m
/
c
e
n
t
o
s
/
releasever - Plus - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/
releasever−Plus−mirrors.aliyun.comfailovermethod=prioritybaseurl=http://mirrors.aliyun.com/centos/releasever/centosplus/
b
a
s
e
a
r
c
h
/
h
t
t
p
:
/
/
m
i
r
r
o
r
s
.
a
l
i
y
u
n
c
s
.
c
o
m
/
c
e
n
t
o
s
/
basearch/ http://mirrors.aliyuncs.com/centos/
basearch/http://mirrors.aliyuncs.com/centos/releasever/centosplus/
b
a
s
e
a
r
c
h
/
h
t
t
p
:
/
/
m
i
r
r
o
r
s
.
c
l
o
u
d
.
a
l
i
y
u
n
c
s
.
c
o
m
/
c
e
n
t
o
s
/
basearch/ http://mirrors.cloud.aliyuncs.com/centos/
basearch/http://mirrors.cloud.aliyuncs.com/centos/releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
#contrib - packages by Centos Users
[contrib]
name=CentOS-
r
e
l
e
a
s
e
v
e
r
−
C
o
n
t
r
i
b
−
m
i
r
r
o
r
s
.
a
l
i
y
u
n
.
c
o
m
f
a
i
l
o
v
e
r
m
e
t
h
o
d
=
p
r
i
o
r
i
t
y
b
a
s
e
u
r
l
=
h
t
t
p
:
/
/
m
i
r
r
o
r
s
.
a
l
i
y
u
n
.
c
o
m
/
c
e
n
t
o
s
/
releasever - Contrib - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/
releasever−Contrib−mirrors.aliyun.comfailovermethod=prioritybaseurl=http://mirrors.aliyun.com/centos/releasever/contrib/
b
a
s
e
a
r
c
h
/
h
t
t
p
:
/
/
m
i
r
r
o
r
s
.
a
l
i
y
u
n
c
s
.
c
o
m
/
c
e
n
t
o
s
/
basearch/ http://mirrors.aliyuncs.com/centos/
basearch/http://mirrors.aliyuncs.com/centos/releasever/contrib/
b
a
s
e
a
r
c
h
/
h
t
t
p
:
/
/
m
i
r
r
o
r
s
.
c
l
o
u
d
.
a
l
i
y
u
n
c
s
.
c
o
m
/
c
e
n
t
o
s
/
basearch/ http://mirrors.cloud.aliyuncs.com/centos/
basearch/http://mirrors.cloud.aliyuncs.com/centos/releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7