在CentOS 6上安装OpenVZ

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在CentOS 6上安装OpenVZ相关的知识,希望对你有一定的参考价值。

我试图在CentOS 6上安装OpenVZ。 我用这个指令安装OpenVZ: https://www.unixmen.com/install-and-configure-openvz-on-centos/ 我试图更新内核,修改openvz repo,没有任何帮助。这是问题所在:

[root@CentOS-69-64-minimal ~]# yum install vzkernel
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirror.fra10.de.leaseweb.net
 * extras: mirror.fra10.de.leaseweb.net
 * openvz-kernel-rhel6: mirror.netinch.com
 * openvz-utils: mirror.netinch.com
 * updates: mirror.fra10.de.leaseweb.net
Resolving Dependencies
--> Running transaction check
---> Package vzkernel.x86_64 0:2.6.32-042stab131.1 will be installed
--> Processing Dependency: kernel-firmware >= 2.6.32-754.el6 for package: vzkernel-2.6.32-042stab131.1.x86_64
--> Finished Dependency Resolution
Error: Package: vzkernel-2.6.32-042stab131.1.x86_64 (openvz-kernel-rhel6)
           Requires: kernel-firmware >= 2.6.32-754.el6
           Installed: kernel-firmware-2.6.32-696.30.1.el6.noarch (@updates)
               kernel-firmware = 2.6.32-696.30.1.el6
           Available: kernel-firmware-2.6.32-696.el6.noarch (base)
               kernel-firmware = 2.6.32-696.el6
           Available: kernel-firmware-2.6.32-696.1.1.el6.noarch (updates)
               kernel-firmware = 2.6.32-696.1.1.el6
           Available: kernel-firmware-2.6.32-696.3.1.el6.noarch (updates)
               kernel-firmware = 2.6.32-696.3.1.el6
           Available: kernel-firmware-2.6.32-696.3.2.el6.noarch (updates)
               kernel-firmware = 2.6.32-696.3.2.el6
           Available: kernel-firmware-2.6.32-696.6.3.el6.noarch (updates)
               kernel-firmware = 2.6.32-696.6.3.el6
           Available: kernel-firmware-2.6.32-696.10.1.el6.noarch (updates)
               kernel-firmware = 2.6.32-696.10.1.el6
           Available: kernel-firmware-2.6.32-696.10.2.el6.noarch (updates)
               kernel-firmware = 2.6.32-696.10.2.el6
           Available: kernel-firmware-2.6.32-696.10.3.el6.noarch (updates)
               kernel-firmware = 2.6.32-696.10.3.el6
           Available: kernel-firmware-2.6.32-696.13.2.el6.noarch (updates)
               kernel-firmware = 2.6.32-696.13.2.el6
           Available: kernel-firmware-2.6.32-696.16.1.el6.noarch (updates)
               kernel-firmware = 2.6.32-696.16.1.el6
           Available: kernel-firmware-2.6.32-696.18.7.el6.noarch (updates)
               kernel-firmware = 2.6.32-696.18.7.el6
           Available: kernel-firmware-2.6.32-696.20.1.el6.noarch (updates)
               kernel-firmware = 2.6.32-696.20.1.el6
           Available: kernel-firmware-2.6.32-696.23.1.el6.noarch (updates)
               kernel-firmware = 2.6.32-696.23.1.el6
           Available: kernel-firmware-2.6.32-696.28.1.el6.noarch (updates)
               kernel-firmware = 2.6.32-696.28.1.el6
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
[root@CentOS-69-64-minimal ~]#

另外,我找不到任何方法在centos 7,debian 9或ubuntu上安装openvz。看起来OpenVZ会死。它太糟糕了,我使用它的原因很多。

答案

目前我在安装vzkernel后出现同样的问题。

问题是新版本需要CentOS 7+的内核,这不适用于CentOS 6.9因此我设法下载旧版本的vzkernel软件包并使用RPM安装它。

  1. 下载最新的兼容RPM wget http://download.openvz.org/kernel/branches/rhel6-2.6.32/042stab126.2/vzkernel-2.6.32-042stab126.2.x86_64.rpm
  2. 安装它 rpm -ivh vzkernel-2.6.32-042stab126.2.x86_64.rpm
  3. 核实 rpm -qa vzkernel
  4. 利润。
另一答案

你可以在kernel-firmware >= 2.6.32-754.el6 repo找到[centosplus]。只需在/etc/yum.repos.d/中的repo文件中启用它,例如:

[centosplus] 
name=CentOS-$releasever - Plus 
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus 
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/ 
gpgcheck=1 
enabled=1 
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

以上是关于在CentOS 6上安装OpenVZ的主要内容,如果未能解决你的问题,请参考以下文章

centos6.8安装openvz

CentOS7上LNMP安装包一步搭建LNMP环境

docker

CentOS yum 命令出现 [Errno 14] curl#6 - "Couldn't resolve host ..." 的解决方法(代码片段

centos7上安装virt-what及使用

LNAP安装