skip to Main Content

The docker has released a new version of centos 8, so I try to use it with Dockerfile to build a new environment but I got some error message

Dockerfile content

FROM centos
RUN yum install

when I ran the above command, it got an error.

so I am going to the container and try to use a command line to check what is going on, and then I found the error when I try to use the command line “yum install” as the following picture.

enter image description here

4

Answers


  1. Chosen as BEST ANSWER

    This is a good method to handle this issue, please follow the code to install the package "glibc-langpack-en" in your environment or put the command line in your dockerfile.

    Dockerfile content

    FROM centos
    RUN yum install -y glibc-langpack-en
    

    Centos shell script

    sudo yum install -y glibc-langpack-en
    

    enter image description here


  2. you should set LANG and LC_ALL/LC_CTYPE variables before run yum update.

    export LANG=en_US.UTF-8
    export LANGUAGE=en_US.UTF-8
    export LC_COLLATE=C
    export LC_CTYPE=en_US.UTF-8
    
    Login or Signup to reply.
  3. #Set

    $ export LC_ALL=C
    

    #check

    $ printenv | grep LC
    

    LC_ALL=C
    #Try again

    $ sudo yum check
    

    Loaded plugins: fastestmirror, ovl
    check all

    Login or Signup to reply.
  4. as root user, then do steps:

    1. sed -i ‘s/mirrorlist/#mirrorlist/g’ /etc/yum.repos.d/CentOS-*
    2. sed -i ‘s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g’ /etc/yum.repos.d/CentOS-*
    3. sudo yum update -y
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search