安装
[root@urumqi ~]# dnf install git python-pip libvirt-python libxml2-python python-websockify python-devel
firmware for qemu, built by jenkins, fresh from 0.0 B/s | 0 B 00:00
firmware for qemu, built by jenkins, fresh from git repos 1.2 kB/s | 8.0 kB 00:06
CentOS-7 - Base 0.0 B/s | 0 B 00:00
CentOS-7 - Updates 0.0 B/s | 0 B 00:00
CentOS-7 - Updates 2.3 MB/s | 5.4 MB 00:02
CentOS-7 - Extras 0.0 B/s | 0 B 00:00
No match for argument: python-pip
Package libvirt-python-4.5.0-1.el7.x86_64 is already installed.
Package libxml2-python-2.9.1-6.el7_2.3.x86_64 is already installed.
No match for argument: python-websockify
Error: Unable to find a match: python-pip python-websockify
[root@urumqi ~]#
这里怀疑dnf不稳定,所以下面改为yum安装方式。
[root@urumqi ~]# yum -y install git python-pip libvirt-python libxml2-python python-websockify python-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.bit.edu.cn
* extras: mirror.bit.edu.cn
* updates: mirror.bit.edu.cn
base | 3.6 kB 00:00:00
extras | 2.9 kB 00:00:00
qemu-firmware-jenkins | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
qemu-firmware-jenkins/primary_db | 7.9 kB 00:00:06
No package python-pip available.
Package libvirt-python-4.5.0-1.el7.x86_64 already installed and latest version
Package libxml2-python-2.9.1-6.el7_2.3.x86_64 already installed and latest version
No package python-websockify available.
Resolving Dependencies
--> Running transaction check
---> Package git.x86_64 0:1.8.3.1-20.el7 will be installed
--> Processing Dependency: perl-Git = 1.8.3.1-20.el7 for package: git-1.8.3.1-20.el7.x86_64
--> Processing Dependency: rsync for package: git-1.8.3.1-20.el7.x86_64
--> Processing Dependency: perl(Term::ReadKey) for package: git-1.8.3.1-20.el7.x86_64
--> Processing Dependency: perl(Git) for package: git-1.8.3.1-20.el7.x86_64
--> Processing Dependency: perl(Error) for package: git-1.8.3.1-20.el7.x86_64
---> Package python-devel.x86_64 0:2.7.5-86.el7 will be installed
--> Processing Dependency: python2-rpm-macros > 3-30 for package: python-devel-2.7.5-86.el7.x86_64
--> Processing Dependency: python-rpm-macros > 3-30 for package: python-devel-2.7.5-86.el7.x86_64
--> Running transaction check
---> Package perl-Error.noarch 1:0.17020-2.el7 will be installed
---> Package perl-Git.noarch 0:1.8.3.1-20.el7 will be installed
---> Package perl-TermReadKey.x86_64 0:2.30-20.el7 will be installed
---> Package python-rpm-macros.noarch 0:3-32.el7 will be installed
--> Processing Dependency: python-srpm-macros for package: python-rpm-macros-3-32.el7.noarch
---> Package python2-rpm-macros.noarch 0:3-32.el7 will be installed
---> Package rsync.x86_64 0:3.1.2-6.el7_6.1 will be installed
--> Running transaction check
---> Package python-srpm-macros.noarch 0:3-32.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================================================================================================================================================================
Package Arch Version Repository Size
==============================================================================================================================================================================================================================================
Installing:
git x86_64 1.8.3.1-20.el7 base 4.4 M
python-devel x86_64 2.7.5-86.el7 base 398 k
Installing for dependencies:
perl-Error noarch 1:0.17020-2.el7 base 32 k
perl-Git noarch 1.8.3.1-20.el7 base 55 k
perl-TermReadKey x86_64 2.30-20.el7 base 31 k
python-rpm-macros noarch 3-32.el7 base 8.8 k
python-srpm-macros noarch 3-32.el7 base 8.4 k
python2-rpm-macros noarch 3-32.el7 base 7.7 k
rsync x86_64 3.1.2-6.el7_6.1 base 404 k
Transaction Summary
==============================================================================================================================================================================================================================================
Install 2 Packages (+7 Dependent packages)
Total download size: 5.3 M
Installed size: 24 M
Downloading packages:
(1/9): perl-Error-0.17020-2.el7.noarch.rpm | 32 kB 00:00:01
(2/9): perl-Git-1.8.3.1-20.el7.noarch.rpm | 55 kB 00:00:00
(3/9): perl-TermReadKey-2.30-20.el7.x86_64.rpm | 31 kB 00:00:00
(4/9): python-devel-2.7.5-86.el7.x86_64.rpm | 398 kB 00:00:00
(5/9): python-rpm-macros-3-32.el7.noarch.rpm | 8.8 kB 00:00:00
(6/9): python-srpm-macros-3-32.el7.noarch.rpm | 8.4 kB 00:00:00
(7/9): python2-rpm-macros-3-32.el7.noarch.rpm | 7.7 kB 00:00:00
(8/9): rsync-3.1.2-6.el7_6.1.x86_64.rpm | 404 kB 00:00:00
(9/9): git-1.8.3.1-20.el7.x86_64.rpm | 4.4 MB 00:00:01
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 2.8 MB/s | 5.3 MB 00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
Installing : 1:perl-Error-0.17020-2.el7.noarch 1/9
Installing : rsync-3.1.2-6.el7_6.1.x86_64 2/9
Installing : python2-rpm-macros-3-32.el7.noarch 3/9
Installing : python-srpm-macros-3-32.el7.noarch 4/9
Installing : python-rpm-macros-3-32.el7.noarch 5/9
Installing : perl-TermReadKey-2.30-20.el7.x86_64 6/9
Installing : perl-Git-1.8.3.1-20.el7.noarch 7/9
Installing : git-1.8.3.1-20.el7.x86_64 8/9
Installing : python-devel-2.7.5-86.el7.x86_64 9/9
Verifying : perl-TermReadKey-2.30-20.el7.x86_64 1/9
Verifying : 1:perl-Error-0.17020-2.el7.noarch 2/9
Verifying : python-devel-2.7.5-86.el7.x86_64 3/9
Verifying : git-1.8.3.1-20.el7.x86_64 4/9
Verifying : perl-Git-1.8.3.1-20.el7.noarch 5/9
Verifying : python-srpm-macros-3-32.el7.noarch 6/9
Verifying : python2-rpm-macros-3-32.el7.noarch 7/9
Verifying : python-rpm-macros-3-32.el7.noarch 8/9
Verifying : rsync-3.1.2-6.el7_6.1.x86_64 9/9
Installed:
git.x86_64 0:1.8.3.1-20.el7 python-devel.x86_64 0:2.7.5-86.el7
Dependency Installed:
perl-Error.noarch 1:0.17020-2.el7 perl-Git.noarch 0:1.8.3.1-20.el7 perl-TermReadKey.x86_64 0:2.30-20.el7 python-rpm-macros.noarch 0:3-32.el7 python-srpm-macros.noarch 0:3-32.el7 python2-rpm-macros.noarch 0:3-32.el7
rsync.x86_64 0:3.1.2-6.el7_6.1
Complete!
[root@urumqi ~]#
这里我们发现No package python-pip available.
、No package python-websockify available.
用no package python-pip available. centos
做为关键词在搜索引擎上搜索,发现普遍认为需要先安装epel-release
,接下来我们安装epel-release
。
[root@urumqi ~]# yum -y install epel-release
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.bit.edu.cn
* extras: mirror.bit.edu.cn
* updates: mirror.bit.edu.cn
Package epel-release-7-11.noarch already installed and latest version
Nothing to do
[root@urumqi ~]#
也有的认为需要安装yum-utils
,安装吧。
[root@urumqi ~]# yum install -y yum-utils
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.bit.edu.cn
* extras: mirror.bit.edu.cn
* updates: mirror.bit.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package yum-utils.noarch 0:1.1.31-52.el7 will be installed
--> Processing Dependency: python-kitchen for package: yum-utils-1.1.31-52.el7.noarch
--> Running transaction check
---> Package python-kitchen.noarch 0:1.1.1-5.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
yum-utils noarch 1.1.31-52.el7 base 121 k
Installing for dependencies:
python-kitchen noarch 1.1.1-5.el7 base 267 k
Transaction Summary
================================================================================
Install 1 Package (+1 Dependent package)
Total download size: 388 k
Installed size: 1.7 M
Downloading packages:
(1/2): python-kitchen-1.1.1-5.el7.noarch.rpm | 267 kB 00:01
(2/2): yum-utils-1.1.31-52.el7.noarch.rpm | 121 kB 00:02
--------------------------------------------------------------------------------
Total 147 kB/s | 388 kB 00:02
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : python-kitchen-1.1.1-5.el7.noarch 1/2
Installing : yum-utils-1.1.31-52.el7.noarch 2/2
Verifying : python-kitchen-1.1.1-5.el7.noarch 1/2
Verifying : yum-utils-1.1.31-52.el7.noarch 2/2
Installed:
yum-utils.noarch 0:1.1.31-52.el7
Dependency Installed:
python-kitchen.noarch 0:1.1.1-5.el7
Complete!
[root@urumqi ~]# yum install -y python-pip
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.bit.edu.cn
* extras: mirror.bit.edu.cn
* updates: mirror.bit.edu.cn
No package python-pip available.
Error: Nothing to do
[root@urumqi ~]#
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.bit.edu.cn
* extras: mirror.bit.edu.cn
* updates: mirror.bit.edu.cn
No package python-pip available.
Error: Nothing to do
[root@urumqi ~]# yum install -y yum-utils && yum-config-manager --enable epel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.bit.edu.cn
* extras: mirror.bit.edu.cn
* updates: mirror.bit.edu.cn
Package yum-utils-1.1.31-52.el7.noarch already installed and latest version
Nothing to do
Loaded plugins: fastestmirror
[root@urumqi ~]# yum -y install epel-release
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.bit.edu.cn
* extras: mirror.bit.edu.cn
* updates: mirror.bit.edu.cn
Package epel-release-7-11.noarch already installed and latest version
Nothing to do
[root@urumqi ~]#
怀疑是镜像出了问题,接下来我们打算用中国科技大学开源镜像源来替换默认镜像。
这是中国科技大学开源镜像站首页,如上图所示,我们需要分别点击"centos"、"epel"对应的"Help"链接,并分别进入,按照相应配置进行配置。
这个是centos帮助页面。按照这里的提示我们来对文件/etc/yum.repos.d/CentOS-Base.repo做修改,具体如下:
[root@urumqi ~]# cd /etc/yum.repos.d/
[root@urumqi /etc/yum.repos.d]# ll
total 48
drwxr-xr-x. 2 root root 208 Nov 27 13:54 .
drwxr-xr-x. 89 root root 8192 Nov 28 10:04 ..
-rw-r--r--. 1 root root 1664 Sep 5 21:05 CentOS-Base.repo
-rw-r--r--. 1 root root 1309 Sep 5 21:05 CentOS-CR.repo
-rw-r--r--. 1 root root 649 Sep 5 21:05 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 314 Sep 5 21:05 CentOS-fasttrack.repo
-rw-r--r--. 1 root root 630 Sep 5 21:05 CentOS-Media.repo
-rw-r--r--. 1 root root 1331 Sep 5 21:05 CentOS-Sources.repo
-rw-r--r--. 1 root root 6639 Sep 5 21:05 CentOS-Vault.repo
-rw-r--r--. 1 root root 174 Mar 1 2017 firmware.repo
[root@urumqi /etc/yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo.backup
[root@urumqi /etc/yum.repos.d]# vim CentOS-Base.repo
[root@urumqi /etc/yum.repos.d]# cat CentOS-Base.repo
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=https://mirrors.ustc.edu.cn/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-$releasever - Updates
# mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=https://mirrors.ustc.edu.cn/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
# mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=https://mirrors.ustc.edu.cn/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
# mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
baseurl=https://mirrors.ustc.edu.cn/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[root@urumqi /etc/yum.repos.d]#
[root@urumqi /etc/yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
base | 3.6 kB 00:00
extras | 2.9 kB 00:00
qemu-firmware-jenkins | 2.9 kB 00:00
updates | 2.9 kB 00:00:00
(1/2): qemu-firmware-jenkins/filelists_db | 6.7 kB 00:00:01
(2/2): qemu-firmware-jenkins/other_db | 2.2 kB 00:00:01
Metadata Cache Created
[root@urumqi /etc/yum.repos.d]#
这是epel的帮助页面,我们看到需要使用如下命令进行修改epel的配置。
sudo yum install -y epel-release
sudo sed -e 's!^mirrorlist=!#mirrorlist=!g' \
-e 's!^#baseurl=!baseurl=!g' \
-e 's!//download\.fedoraproject\.org/pub!//mirrors.ustc.edu.cn!g' \
-e 's!http://mirrors\.ustc!https://mirrors.ustc!g' \
-i /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel-testing.repo
接下来,我们将会在当前系统中查找配置文件/etc/yum.repos.d/epel.repo与 /etc/yum.repos.d/epel-testing.repo,但是我们找了一圈,发现没有找到这两个配置文件。后来在网上搜索了一下,我们在官网找到如下信息。
[root@urumqi /etc/yum]# cd
[root@urumqi ~]# yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Loaded plugins: fastestmirror
Cannot open: https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm. Skipping.
Error: Nothing to do
[root@urumqi ~]#
这里出了问题,可能是网络不好的原因吧,我们决定手动下载,然后放到用户目录~
中,
[root@urumqi ~]# ll
total 40
dr-xr-x---. 6 root root 201 Nov 28 13:07 .
dr-xr-xr-x. 17 root root 242 Nov 20 11:39 ..
-rw-------. 1 root root 1993 Nov 19 18:45 anaconda-ks.cfg
-rw-------. 1 root root 7900 Nov 27 18:10 .bash_history
-rw-r--r--. 1 root root 18 Dec 29 2013 .bash_logout
-rw-r--r--. 1 root root 176 Dec 29 2013 .bash_profile
-rw-r--r--. 1 root root 176 Dec 29 2013 .bashrc
drwxr-xr-x. 3 root root 21 Nov 26 10:36 .cache
-rw-r--r--. 1 root root 100 Dec 29 2013 .cshrc
drwxr-xr-x. 3 root root 17 Nov 20 12:41 data
drwxr-----. 3 root root 19 Nov 20 20:18 .pki
drwx------. 2 root root 29 Nov 19 19:05 .ssh
-rw-r--r--. 1 root root 129 Dec 29 2013 .tcshrc
-rw-------. 1 root root 6492 Nov 28 10:34 .viminfo
[root@urumqi ~]#
已上传守成,现在安装epel-release-latest-7.noarch.rpm
[root@urumqi ~]# ll
total 56
dr-xr-x---. 6 root root 241 Nov 28 10:30 .
dr-xr-xr-x. 17 root root 242 Nov 20 11:39 ..
-rw-------. 1 root root 1993 Nov 19 18:45 anaconda-ks.cfg
-rw-------. 1 root root 7900 Nov 27 18:10 .bash_history
-rw-r--r--. 1 root root 18 Dec 29 2013 .bash_logout
-rw-r--r--. 1 root root 176 Dec 29 2013 .bash_profile
-rw-r--r--. 1 root root 176 Dec 29 2013 .bashrc
drwxr-xr-x. 3 root root 21 Nov 26 10:36 .cache
-rw-r--r--. 1 root root 100 Dec 29 2013 .cshrc
drwxr-xr-x. 3 root root 17 Nov 20 12:41 data
-rw-r--r--. 1 root root 15264 Nov 28 10:30 epel-release-latest-7.noarch.rpm
drwxr-----. 3 root root 19 Nov 20 20:18 .pki
drwx------. 2 root root 29 Nov 19 19:05 .ssh
-rw-r--r--. 1 root root 129 Dec 29 2013 .tcshrc
-rw-------. 1 root root 6602 Nov 28 10:27 .viminfo
[root@urumqi ~]# yum install epel-release-latest-7.noarch.rpm
Loaded plugins: fastestmirror
Examining epel-release-latest-7.noarch.rpm: epel-release-7-12.noarch
Marking epel-release-latest-7.noarch.rpm as an update to epel-release-7-11.noarch
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-11 will be updated
---> Package epel-release.noarch 0:7-12 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
===================================================================================================================================================================================
Package Arch Version Repository Size
===================================================================================================================================================================================
Updating:
epel-release noarch 7-12 /epel-release-latest-7.noarch 24 k
Transaction Summary
===================================================================================================================================================================================
Upgrade 1 Package
Total size: 24 k
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Updating : epel-release-7-12.noarch 1/2
Cleanup : epel-release-7-11.noarch 2/2
Verifying : epel-release-7-12.noarch 1/2
Verifying : epel-release-7-11.noarch 2/2
Updated:
epel-release.noarch 0:7-12
Complete!
[root@urumqi ~]# cd /etc/yum.repos.d/
[root@urumqi /etc/yum.repos.d]# ll
total 64
drwxr-xr-x. 2 root root 4096 Nov 28 10:32 .
drwxr-xr-x. 89 root root 8192 Nov 28 10:04 ..
-rw-r--r--. 1 root root 1624 Nov 28 10:17 CentOS-Base.repo
-rw-r--r--. 1 root root 1664 Sep 5 21:05 CentOS-Base.repo.backup
-rw-r--r--. 1 root root 1309 Sep 5 21:05 CentOS-CR.repo
-rw-r--r--. 1 root root 649 Sep 5 21:05 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 314 Sep 5 21:05 CentOS-fasttrack.repo
-rw-r--r--. 1 root root 630 Sep 5 21:05 CentOS-Media.repo
-rw-r--r--. 1 root root 1331 Sep 5 21:05 CentOS-Sources.repo
-rw-r--r--. 1 root root 6639 Sep 5 21:05 CentOS-Vault.repo
-rw-r--r--. 1 root root 1050 Sep 18 07:25 epel.repo
-rw-r--r--. 1 root root 1149 Sep 18 07:25 epel-testing.repo
-rw-r--r--. 1 root root 174 Mar 1 2017 firmware.repo
[root@urumqi /etc/yum.repos.d]#
这时已经有了相关文件了,现在按照中国科学大学开源镜像站的提示对其做替换工作,具体如下所示:
[root@urumqi /etc/yum.repos.d]# sed -e 's!^mirrorlist=!#mirrorlist=!g' \
> -e 's!^#baseurl=!baseurl=!g' \
> -e 's!//download\.fedoraproject\.org/pub!//mirrors.ustc.edu.cn!g' \
> -e 's!http://mirrors\.ustc!https://mirrors.ustc!g' \
> -i /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel-testing.repo
[root@urumqi /etc/yum.repos.d]# ll
total 64
drwxr-xr-x. 2 root root 4096 Nov 28 10:34 .
drwxr-xr-x. 89 root root 8192 Nov 28 10:04 ..
-rw-r--r--. 1 root root 1624 Nov 28 10:17 CentOS-Base.repo
-rw-r--r--. 1 root root 1664 Sep 5 21:05 CentOS-Base.repo.backup
-rw-r--r--. 1 root root 1309 Sep 5 21:05 CentOS-CR.repo
-rw-r--r--. 1 root root 649 Sep 5 21:05 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 314 Sep 5 21:05 CentOS-fasttrack.repo
-rw-r--r--. 1 root root 630 Sep 5 21:05 CentOS-Media.repo
-rw-r--r--. 1 root root 1331 Sep 5 21:05 CentOS-Sources.repo
-rw-r--r--. 1 root root 6639 Sep 5 21:05 CentOS-Vault.repo
-rw-r--r--. 1 root root 1017 Nov 28 10:34 epel.repo
-rw-r--r--. 1 root root 1116 Nov 28 10:34 epel-testing.repo
-rw-r--r--. 1 root root 174 Mar 1 2017 firmware.repo
[root@urumqi /etc/yum.repos.d]# cat epel.repo
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
baseurl=https://mirrors.ustc.edu.cn/epel/7/$basearch
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch&infra=$infra&content=$contentdir
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
baseurl=https://mirrors.ustc.edu.cn/epel/7/$basearch/debug
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch&infra=$infra&content=$contentdir
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1
[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
baseurl=https://mirrors.ustc.edu.cn/epel/7/SRPMS
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch&infra=$infra&content=$contentdir
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1
[root@urumqi /etc/yum.repos.d]# cat epel-testing.repo
[epel-testing]
name=Extra Packages for Enterprise Linux 7 - Testing - $basearch
baseurl=https://mirrors.ustc.edu.cn/epel/testing/7/$basearch
metalink=https://mirrors.fedoraproject.org/metalink?repo=testing-epel7&arch=$basearch&infra=$infra&content=$contentdir
failovermethod=priority
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
[epel-testing-debuginfo]
name=Extra Packages for Enterprise Linux 7 - Testing - $basearch - Debug
baseurl=https://mirrors.ustc.edu.cn/epel/testing/7/$basearch/debug
metalink=https://mirrors.fedoraproject.org/metalink?repo=testing-debug-epel7&arch=$basearch&infra=$infra&content=$contentdir
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1
[epel-testing-source]
name=Extra Packages for Enterprise Linux 7 - Testing - $basearch - Source
baseurl=https://mirrors.ustc.edu.cn/epel/testing/7/SRPMS
metalink=https://mirrors.fedoraproject.org/metalink?repo=testing-source-epel7&arch=$basearch&infra=$infra&content=$contentdir
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1
[root@urumqi /etc/yum.repos.d]#
[root@urumqi /etc/yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink | 8.6 kB 00:00:00
* epel: mirrors.ustc.edu.cn
base | 3.6 kB 00:00:00
epel | 5.3 kB 00:00:00
extras | 2.9 kB 00:00:00
qemu-firmware-jenkins | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/6): epel/x86_64/prestodelta | 1.9 kB 00:00:01
(2/6): epel/x86_64/filelists_db | 12 MB 00:00:02
(3/6): epel/x86_64/primary_db | 6.9 MB 00:00:01
(4/6): epel/x86_64/other_db | 3.3 MB 00:00:01
(5/6): epel/x86_64/updateinfo_zck | 1.5 MB 00:00:00
(6/6): epel/x86_64/updateinfo | 1.0 MB 00:00:03
Metadata Cache Created
[root@urumqi /etc/yum.repos.d]# cd
[root@urumqi ~]#
现在我们来安装 python-pip:
[root@urumqi ~]# yum install -y python-pip
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* epel: mirror.xeonbd.com
qemu-firmware-jenkins | 2.9 kB 00:00:00
Resolving Dependencies
--> Running transaction check
---> Package python2-pip.noarch 0:8.1.2-10.el7 will be installed
--> Processing Dependency: python-setuptools for package: python2-pip-8.1.2-10.el7.noarch
--> Running transaction check
---> Package python-setuptools.noarch 0:0.9.8-7.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
===================================================================================================================================================================================
Package Arch Version Repository Size
===================================================================================================================================================================================
Installing:
python2-pip noarch 8.1.2-10.el7 epel 1.7 M
Installing for dependencies:
python-setuptools noarch 0.9.8-7.el7 base 397 k
Transaction Summary
===================================================================================================================================================================================
Install 1 Package (+1 Dependent package)
Total download size: 2.1 M
Installed size: 9.1 M
Downloading packages:
warning: /var/cache/yum/x86_64/7/epel/packages/python2-pip-8.1.2-10.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY ] 0.0 B/s | 0 B --:--:-- ETA
Public key for python2-pip-8.1.2-10.el7.noarch.rpm is not installed
(1/2): python2-pip-8.1.2-10.el7.noarch.rpm | 1.7 MB 00:00:05
python-setuptools-0.9.8-7.el7. FAILED
https://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/python-setuptools-0.9.8-7.el7.noarch.rpm: [Errno 12] Timeout on https://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/python-setuptools-0.9.8-7.el7.noarch.rpm: (28, 'Operation timed out after 30001 milliseconds with 0 out of 0 bytes received')
Trying other mirror.
(2/2): python-setuptools-0.9.8-7.el7.noarch.rpm | 397 kB 00:00:08
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 54 kB/s | 2.1 MB 00:00:39
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Importing GPG key 0x352C64E5:
Userid : "Fedora EPEL (7) <epel@fedoraproject.org>"
Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5
Package : epel-release-7-12.noarch (@/epel-release-latest-7.noarch)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : python-setuptools-0.9.8-7.el7.noarch 1/2
Installing : python2-pip-8.1.2-10.el7.noarch 2/2
Verifying : python-setuptools-0.9.8-7.el7.noarch 1/2
Verifying : python2-pip-8.1.2-10.el7.noarch 2/2
Installed:
python2-pip.noarch 0:8.1.2-10.el7
Dependency Installed:
python-setuptools.noarch 0:0.9.8-7.el7
Complete!
[root@urumqi ~]#
考虑到最初我们在安装的时候,python-websockify
没有安装成功,所以,这里重新用最初的命令来一次完整的安装:
[root@urumqi ~]# yum install git python-pip libvirt-python libxml2-python python-websockify python-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* epel: mirrors.ustc.edu.cn
Package git-1.8.3.1-20.el7.x86_64 already installed and latest version
Package python2-pip-8.1.2-10.el7.noarch already installed and latest version
Package libvirt-python-4.5.0-1.el7.x86_64 already installed and latest version
Package libxml2-python-2.9.1-6.el7_2.3.x86_64 already installed and latest version
Package python-devel-2.7.5-86.el7.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package python-websockify.noarch 0:0.6.0-2.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================================================================================================================================================================
Package Arch Version Repository Size
==============================================================================================================================================================================================================================================
Installing:
python-websockify noarch 0.6.0-2.el7 epel 62 k
Transaction Summary
==============================================================================================================================================================================================================================================
Install 1 Package
Total download size: 62 k
Installed size: 182 k
Is this ok [y/d/N]: y
Downloading packages:
python-websockify-0.6.0-2.el7.noarch.rpm | 62 kB 00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : python-websockify-0.6.0-2.el7.noarch 1/1
Verifying : python-websockify-0.6.0-2.el7.noarch 1/1
Installed:
python-websockify.noarch 0:0.6.0-2.el7
Complete!
[root@urumqi ~]#
至此安装完成。
参考文献
- kvm虚拟化管理平台WebVirtMgr部署-完整记录(0)
- kvm虚拟化管理平台WebVirtMgr部署-完整记录(1)
- WebVirtMgr 基于Centos7.3的KVM虚拟化管理平台安装
- WebVirtMgr
- Install WebVirtMgr
- Setup Host Server
- http://pianshen.com/article/7150268568/
- http://www.programmersought.com/article/9361762643/
- http://www.programmersought.com/article/50522160362/