前言
搞 OpenStack 开发 Libvirt 版本会随着 OpenStack 版本切来切去的,记录一下 Libvirt 从 4.5 降级到 3.9.0 的过程。
步骤
直接 downgrade
[root@control01 ~]# yum downgrade 'libvirt*3.9.0*'Loaded plugins: fastestmirrorLoading mirror speeds from cached hostfile * base: mirrors.aliyun.com * epel: mirrors.yun-idc.com * extras: mirrors.tuna.tsinghua.edu.cn * updates: mirrors.tuna.tsinghua.edu.cnhttps://copr-be.cloud.fedoraproject.org/results/mcepl/vim8/epel-7-x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not FoundTrying other mirror.To address this issue please refer to the below wiki articlehttps://wiki.centos.org/yum-errorsIf above article doesn't help to resolve this issue please use https://bugs.centos.org/.Resolving Dependencies--> Running transaction check---> Package libvirt-libs.x86_64 0:4.5.0-10.el7_6.2 will be a downgrade---> Package libvirt-libs.x86_64 0:4.5.0-10.el7_6.3 will be erased--> Finished Dependency ResolutionError: Package: libvirt-daemon-driver-storage-gluster-4.5.0-10.el7_6.3.x86_64 (@updates) Requires: libvirt-libs = 4.5.0-10.el7_6.3 Removing: libvirt-libs-4.5.0-10.el7_6.3.x86_64 (@updates) libvirt-libs = 4.5.0-10.el7_6.3 Downgraded By: libvirt-libs-4.5.0-10.el7_6.2.x86_64 (updates) libvirt-libs = 4.5.0-10.el7_6.2 Available: libvirt-libs-4.5.0-10.el7.i686 (base) libvirt-libs = 4.5.0-10.el7Error: Package: libvirt-4.5.0-10.el7_6.3.x86_64 (@updates) Requires: libvirt-libs = 4.5.0-10.el7_6.3 Removing: libvirt-libs-4.5.0-10.el7_6.3.x86_64 (@updates) libvirt-libs = 4.5.0-10.el7_6.3 Downgraded By: libvirt-libs-4.5.0-10.el7_6.2.x86_64 (updates) libvirt-libs = 4.5.0-10.el7_6.2 Available: libvirt-libs-4.5.0-10.el7.i686 (base) libvirt-libs = 4.5.0-10.el7Error: Package: libvirt-daemon-driver-storage-rbd-4.5.0-10.el7_6.3.x86_64 (@updates) Requires: libvirt-libs = 4.5.0-10.el7_6.3 Removing: libvirt-libs-4.5.0-10.el7_6.3.x86_64 (@updates) libvirt-libs = 4.5.0-10.el7_6.3 Downgraded By: libvirt-libs-4.5.0-10.el7_6.2.x86_64 (updates) libvirt-libs = 4.5.0-10.el7_6.2 Available: libvirt-libs-4.5.0-10.el7.i686 (base) libvirt-libs = 4.5.0-10.el7Error: Package: libvirt-daemon-driver-lxc-4.5.0-10.el7_6.3.x86_64 (@updates) Requires: libvirt-libs = 4.5.0-10.el7_6.3 Removing: libvirt-libs-4.5.0-10.el7_6.3.x86_64 (@updates) libvirt-libs = 4.5.0-10.el7_6.3 Downgraded By: libvirt-libs-4.5.0-10.el7_6.2.x86_64 (updates) libvirt-libs = 4.5.0-10.el7_6.2 Available: libvirt-libs-4.5.0-10.el7.i686 (base) libvirt-libs = 4.5.0-10.el7Error: Package: libvirt-daemon-driver-storage-logical-4.5.0-10.el7_6.3.x86_64 (@updates) Requires: libvirt-libs = 4.5.0-10.el7_6.3 Removing: libvirt-libs-4.5.0-10.el7_6.3.x86_64 (@updates) libvirt-libs = 4.5.0-10.el7_6.3 Downgraded By: libvirt-libs-4.5.0-10.el7_6.2.x86_64 (updates) libvirt-libs = 4.5.0-10.el7_6.2 Available: libvirt-libs-4.5.0-10.el7.i686 (base) libvirt-libs = 4.5.0-10.el7Error: Package: libvirt-daemon-driver-network-4.5.0-10.el7_6.3.x86_64 (@updates) Requires: libvirt-libs = 4.5.0-10.el7_6.3 Removing: libvirt-libs-4.5.0-10.el7_6.3.x86_64 (@updates) libvirt-libs = 4.5.0-10.el7_6.3 Downgraded By: libvirt-libs-4.5.0-10.el7_6.2.x86_64 (updates) libvirt-libs = 4.5.0-10.el7_6.2 Available: libvirt-libs-4.5.0-10.el7.i686 (base) libvirt-libs = 4.5.0-10.el7Error: Package: libvirt-daemon-driver-nodedev-4.5.0-10.el7_6.3.x86_64 (@updates) Requires: libvirt-libs = 4.5.0-10.el7_6.3 Removing: libvirt-libs-4.5.0-10.el7_6.3.x86_64 (@updates) libvirt-libs = 4.5.0-10.el7_6.3 Downgraded By: libvirt-libs-4.5.0-10.el7_6.2.x86_64 (updates) libvirt-libs = 4.5.0-10.el7_6.2 Available: libvirt-libs-4.5.0-10.el7.i686 (base) libvirt-libs = 4.5.0-10.el7Error: Package: libvirt-daemon-driver-storage-disk-4.5.0-10.el7_6.3.x86_64 (@updates) Requires: libvirt-libs = 4.5.0-10.el7_6.3 Removing: libvirt-libs-4.5.0-10.el7_6.3.x86_64 (@updates) libvirt-libs = 4.5.0-10.el7_6.3 Downgraded By: libvirt-libs-4.5.0-10.el7_6.2.x86_64 (updates) libvirt-libs = 4.5.0-10.el7_6.2 Available: libvirt-libs-4.5.0-10.el7.i686 (base) libvirt-libs = 4.5.0-10.el7Error: Package: libvirt-client-4.5.0-10.el7_6.3.x86_64 (@updates) Requires: libvirt-libs = 4.5.0-10.el7_6.3 Removing: libvirt-libs-4.5.0-10.el7_6.3.x86_64 (@updates) libvirt-libs = 4.5.0-10.el7_6.3 Downgraded By: libvirt-libs-4.5.0-10.el7_6.2.x86_64 (updates) libvirt-libs = 4.5.0-10.el7_6.2 Available: libvirt-libs-4.5.0-10.el7.i686 (base) libvirt-libs = 4.5.0-10.el7Error: Package: libvirt-daemon-driver-storage-mpath-4.5.0-10.el7_6.3.x86_64 (@updates) Requires: libvirt-libs = 4.5.0-10.el7_6.3 Removing: libvirt-libs-4.5.0-10.el7_6.3.x86_64 (@updates) libvirt-libs = 4.5.0-10.el7_6.3 Downgraded By: libvirt-libs-4.5.0-10.el7_6.2.x86_64 (updates) libvirt-libs = 4.5.0-10.el7_6.2 Available: libvirt-libs-4.5.0-10.el7.i686 (base) libvirt-libs = 4.5.0-10.el7Error: Package: libvirt-daemon-driver-qemu-4.5.0-10.el7_6.3.x86_64 (@updates) Requires: libvirt-libs = 4.5.0-10.el7_6.3 Removing: libvirt-libs-4.5.0-10.el7_6.3.x86_64 (@updates) libvirt-libs = 4.5.0-10.el7_6.3 Downgraded By: libvirt-libs-4.5.0-10.el7_6.2.x86_64 (updates) libvirt-libs = 4.5.0-10.el7_6.2 Available: libvirt-libs-4.5.0-10.el7.i686 (base) libvirt-libs = 4.5.0-10.el7Error: Package: libvirt-daemon-driver-nwfilter-4.5.0-10.el7_6.3.x86_64 (@updates) Requires: libvirt-libs = 4.5.0-10.el7_6.3 Removing: libvirt-libs-4.5.0-10.el7_6.3.x86_64 (@updates) libvirt-libs = 4.5.0-10.el7_6.3 Downgraded By: libvirt-libs-4.5.0-10.el7_6.2.x86_64 (updates) libvirt-libs = 4.5.0-10.el7_6.2 Available: libvirt-libs-4.5.0-10.el7.i686 (base) libvirt-libs = 4.5.0-10.el7Error: Package: libvirt-daemon-driver-interface-4.5.0-10.el7_6.3.x86_64 (@updates) Requires: libvirt-libs = 4.5.0-10.el7_6.3 Removing: libvirt-libs-4.5.0-10.el7_6.3.x86_64 (@updates) libvirt-libs = 4.5.0-10.el7_6.3 Downgraded By: libvirt-libs-4.5.0-10.el7_6.2.x86_64 (updates) libvirt-libs = 4.5.0-10.el7_6.2 Available: libvirt-libs-4.5.0-10.el7.i686 (base) libvirt-libs = 4.5.0-10.el7Error: Package: libvirt-daemon-driver-secret-4.5.0-10.el7_6.3.x86_64 (@updates) Requires: libvirt-libs = 4.5.0-10.el7_6.3 Removing: libvirt-libs-4.5.0-10.el7_6.3.x86_64 (@updates) libvirt-libs = 4.5.0-10.el7_6.3 Downgraded By: libvirt-libs-4.5.0-10.el7_6.2.x86_64 (updates) libvirt-libs = 4.5.0-10.el7_6.2 Available: libvirt-libs-4.5.0-10.el7.i686 (base) libvirt-libs = 4.5.0-10.el7Error: Package: libvirt-daemon-driver-storage-core-4.5.0-10.el7_6.3.x86_64 (@updates) Requires: libvirt-libs = 4.5.0-10.el7_6.3 Removing: libvirt-libs-4.5.0-10.el7_6.3.x86_64 (@updates) libvirt-libs = 4.5.0-10.el7_6.3 Downgraded By: libvirt-libs-4.5.0-10.el7_6.2.x86_64 (updates) libvirt-libs = 4.5.0-10.el7_6.2 Available: libvirt-libs-4.5.0-10.el7.i686 (base) libvirt-libs = 4.5.0-10.el7Error: Package: libvirt-daemon-driver-storage-iscsi-4.5.0-10.el7_6.3.x86_64 (@updates) Requires: libvirt-libs = 4.5.0-10.el7_6.3 Removing: libvirt-libs-4.5.0-10.el7_6.3.x86_64 (@updates) libvirt-libs = 4.5.0-10.el7_6.3 Downgraded By: libvirt-libs-4.5.0-10.el7_6.2.x86_64 (updates) libvirt-libs = 4.5.0-10.el7_6.2 Available: libvirt-libs-4.5.0-10.el7.i686 (base) libvirt-libs = 4.5.0-10.el7Error: Package: libvirt-devel-4.5.0-10.el7_6.3.x86_64 (@updates) Requires: libvirt-libs = 4.5.0-10.el7_6.3 Removing: libvirt-libs-4.5.0-10.el7_6.3.x86_64 (@updates) libvirt-libs = 4.5.0-10.el7_6.3 Downgraded By: libvirt-libs-4.5.0-10.el7_6.2.x86_64 (updates) libvirt-libs = 4.5.0-10.el7_6.2 Available: libvirt-libs-4.5.0-10.el7.i686 (base) libvirt-libs = 4.5.0-10.el7Error: Package: libvirt-daemon-4.5.0-10.el7_6.3.x86_64 (@updates) Requires: libvirt-libs = 4.5.0-10.el7_6.3 Removing: libvirt-libs-4.5.0-10.el7_6.3.x86_64 (@updates) libvirt-libs = 4.5.0-10.el7_6.3 Downgraded By: libvirt-libs-4.5.0-10.el7_6.2.x86_64 (updates) libvirt-libs = 4.5.0-10.el7_6.2 Available: libvirt-libs-4.5.0-10.el7.i686 (base) libvirt-libs = 4.5.0-10.el7Error: Package: libvirt-daemon-driver-storage-scsi-4.5.0-10.el7_6.3.x86_64 (@updates) Requires: libvirt-libs = 4.5.0-10.el7_6.3 Removing: libvirt-libs-4.5.0-10.el7_6.3.x86_64 (@updates) libvirt-libs = 4.5.0-10.el7_6.3 Downgraded By: libvirt-libs-4.5.0-10.el7_6.2.x86_64 (updates) libvirt-libs = 4.5.0-10.el7_6.2 Available: libvirt-libs-4.5.0-10.el7.i686 (base) libvirt-libs = 4.5.0-10.el7 You could try using --skip-broken to work around the problem** Found 1 pre-existing rpmdb problem(s), 'yum check' output follows:python2-requests-2.14.2-1.el7.noarch has missing requires of python2-urllib3 = ('0', '1.21.1', None)
报错,原因是上面这些高版本的包,在 yum repo 没有对应的低版本包。所以先把这个包强制卸载掉。
rpm -e --nodeps \ libvirt-daemon-driver-storage-core \ libvirt-libs \ libvirt-daemon-driver-storage-disk \ libvirt-daemon-driver-storage-gluster \ libvirt-daemon-driver-storage-iscsi \ libvirt-daemon-driver-storage-logical \ libvirt-daemon-driver-storage-mpath \ libvirt-daemon-driver-storage-rbd \ libvirt-daemon-driver-storage-scsi
然后在 downgrade
[root@control01 ~]# yum downgrade 'libvirt*3.9.0*'Loaded plugins: fastestmirrorLoading mirror speeds from cached hostfile * base: mirrors.aliyun.com * epel: mirrors.tuna.tsinghua.edu.cn * extras: mirrors.tuna.tsinghua.edu.cn * updates: mirrors.tuna.tsinghua.edu.cnhttps://copr-be.cloud.fedoraproject.org/results/mcepl/vim8/epel-7-x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not FoundTrying other mirror.To address this issue please refer to the below wiki articlehttps://wiki.centos.org/yum-errorsIf above article doesn't help to resolve this issue please use https://bugs.centos.org/.No Match for available package: libvirt-libs-4.5.0-10.el7.i686No Match for available package: libvirt-libs-4.5.0-10.el7.x86_64Nothing to do
还是失败,原因是因为环境的 yum repo CentOS /7
已经没有 3.9.0 版本的包了,所以修改一下 CentOS repo 配置文件。
vim CentOS-Base.repo
[base]name=CentOS-$releasever - Base#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/baseurl=http://vault.centos.org/7.5.1804/os/x86_64/gpgcheck=1gpgkey=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&infra=$infra#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/baseurl=http://vault.centos.org/7.5.1804/updates/x86_64/gpgcheck=1gpgkey=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&infra=$infra#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/baseurl=http://vault.centos.org/7.5.1804/extras/x86_64/gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7#additional packages that extend functionality of existing packages[centosplus]name=CentOS-$releasever - Plusmirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/gpgcheck=1enabled=0gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
然后在 downgrade 就应该可以成功了,如果还是不行,那么请继续挖坑吧。
[root@control01 yum.repos.d]# libvirtd --versionlibvirtd (libvirt) 3.9.0