4

I was able to install Yum in Ubuntu 18.04 but I can't install it anymore in Ubuntu 20.04. So, when I try to run a CentOS LXC container in my Ubuntu I get an error like this one:

# lxc-create -n centos7 -t centos -- -R 7
Host CPE ID from /etc/os-release: 
'yum' command is missing
lxc-create: centos7: lxccontainer.c: create_run_template: 1626 Failed to create container from template
lxc-create: centos7: tools/lxc_create.c: main: 319 Failed to create container centos7

I've tryed to download the latest yum.deb packages from several sites (pkgs.org, etc.) but there is no way to satisfy the package dependencies (i.e python-lzma).

So, the question is either of these: how do I install YUM in Ubuntu 20.04 or how do I run a CentOS container using LXC in Ubuntu 20.04?. Previous LTS versions of Ubuntu worked great.

Thank you.

3 Answers3

1

Well, definitely it is not an optimal solution, but it is the only one I found.

As I'm using Dockers quite often, I have docker installed and I've created a new /usr/bin/yum file (executable) with this code:

#!/bin/bash

docker run --rm -v /var/cache:/var/cache roboxes/centos8 bin/yum $*

So when yum is executed, my own docker version of "yum" runs. It is not a nice solution, but at least it does the job.

I've previously run, though this is not mandatory.

docker pull roboxes/centos8

No RPM package is needed either.

No CentOS 8 is supported in this LXC version (because of the lxc-centos template). It is not optimal, but it worked.

1

Try this command:

lxc-create --name centos7 --template=download -- --dist=centos --release=7 --arch=amd64

works fine on ubuntu20

kllaud
  • 11
0

install yum :

apt install yum

after that Try this command:

lxc-create -t centos -n client11

ou

/usr/share/lxc/templates/lxc-centos -n centos01 -R 7