1

I run a docker image (gitlab-runner) on a centos 7 host machine. In the container, it is strange that it has apt command but has no yum command.But the system seems to be a centos but not ubuntu?

root@vultr:/usr/local/java# uname -r 
3.10.0-1062.4.1.el7.x86_64

I used apt-get install yum to install yum and then I want to do yum update, but I get the following problems, how to deal with it?

    root@vultr:/usr/local/java# yum update      
    There are no enabled repos.
    Run "yum repolist all" to see the repos you have.
    You can enable repos with yum-config-manager --enable <repo>
    root@vultr:/usr/local/java# yum repolist all
    repolist: 0
    root@vultr:/usr/local/java# yum list
    root@vultr:/usr/local/java#
    root@vultr:/usr/local/java#
    root@vultr:/usr/local/java# yum-config-manager --enable
    Error: Trying to enable already enabled repos.
    ==================================================================================================== main ====================================================================================================
    [main]
    alwaysprompt = True
    assumeyes = False
    bandwidth = 0
    bugtracker_url = http://yum.baseurl.org/report
    cache = 0
    cachedir = /var/cache/yum
    clean_requirements_on_remove = False
    color = auto
    color_list_available_downgrade = dim,cyan
    color_list_available_install = normal
    color_list_available_reinstall = bold,underline,green
    color_list_available_upgrade = bold,blue
    color_list_installed_extra = bold,red
    color_list_installed_newer = bold,yellow
    color_list_installed_older = bold
    color_list_installed_reinstall = normal
    color_search_match = bold
    color_update_installed = normal
    color_update_local = bold
    color_update_remote = normal
    commands =
    debuglevel = 2
    diskspacecheck = True
    distroverpkg = redhat-release
    enable_group_conditionals = True
    enabled = True
    enablegroups = True
    errorlevel = 2
    exactarch = True
    exactarchlist = kernel,
       kernel-smp,
       kernel-hugemem,
       kernel-enterprise,
       kernel-bigmem,
       kernel-devel,
       kernel-PAE,
       kernel-PAE-debug
    exclude =
    exit_on_lock = False
    failovermethod = roundrobin
    gaftonmode = False
    gpgcheck = False
    group_package_types = mandatory,
       default
    groupremove_leaf_only = False
    history_list_view = single-user-commands
4

The GitLab Runner images are based on either Ubuntu or Alpine Linux. This is stated in the docs:

The following Docker images are available:

  • gitlab/gitlab-runner:latest based on Ubuntu.
  • gitlab/gitlab-runner:alpine based on Alpine with much a smaller footprint (~160/350 MB Ubuntu vs ~45/130 MB Alpine compressed/decompressed).

Both Ubuntu and Alpine Linux have their own package management systems - apt and apk respectively. You can use these package managers to add/remove packages inside your container. yum is a package manager for RHEL/Fedora class of Linux distributions, and is not used by either Ubuntu or Alpine Linux.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.