Tag: AlmaLinux

  • How to Migrate CentOS 7 to AlmaLinux 8

    How to Migrate CentOS 7 to AlmaLinux 8

    Upgrade CentOS 7 to latest version with

    yum update -y
    

    Reboot the server

    reboot
    

    Install elevate repo rpm file

    yum install -y http://repo.almalinux.org/elevate/elevate-release-latest-el$(rpm --eval %rhel).noarch.rpm
    

    Install leapp

    yum install -y leapp-upgrade leapp-data-almalinux
    

    Run pre upgrade check

    leapp preupgrade
    

    After the preupgrade script run, it will generate a log file /var/log/leapp/leapp-report.txt, you need to fix any problems reported in this file.

    On CentOS 7, you need to run these 2 commands as they will cause upgrade blocking.

    rmmod pata_acpi
    leapp answer --section remove_pam_pkcs11_module_check.confirm=True
    

    Run the upgrade

    leapp upgrade
    

    During the upgrade, server will reboot itself. This process can take a while to finish. Don’t interrupt the process or you will end up with non working server.

    Once the upgrade process is finished, reboot the server.

    reboot
    
  • How to Migrate CentOS 7 cPanel Server to Almalinux 8

    How to Migrate CentOS 7 cPanel Server to Almalinux 8

    CentOS Linux was discontinued at the end of 2021 in favor of CentOS Stream. CentoS 7 will continue to be supported through the remainder of the RHEL 7 life cycle, which will end on June 30, 2024. If you are using CentOS 7 server with cPanel, it is better to upgrade to AlmaLinux 8, which is a clone of RHEL 8 supported by cPanel.

    cPanel provides an open-source script to upgrade your CentOS 7 installation to AlmaLinux.

    https://github.com/cpanel/elevate

    Download elevate-cpanel

    To download elevate-cpanel, run

    wget -O /scripts/elevate-cpanel https://raw.githubusercontent.com/cpanel/elevate/release/elevate-cpanel
    chmod 700 /scripts/elevate-cpanel
    

    Update the server

    yum update
    /scripts/upcp
    

    Reboot the server

    reboot
    

    Check for upgrade blockers

    You need to run this script to see if any software installed on your server is computable or not.

    /scripts/elevate-cpanel --check --upgrade-to=almalinux
    

    If there is no problem detected, you can run the upgrade script.

    Upgrade to AlmaLinux 8

    To upgrade to AlmaLinux, run

    /scripts/elevate-cpanel --start --upgrade-to=almalinux
    

    Server will auto restart during the upgrade process. Once it is finished, you will have AlmaLinux 8.

    Back to Cpanel

  • How to install docker on AlmaLinux 8

    How to install docker on AlmaLinux 8

    To install docker on AlmaLinux, run the following commands

    Install yum-utils

    dnf install -y yum-utils

    Add docker repository

    yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

    Install Docker CE with

    dnf install docker-ce

    Enable docker

    systemctl enable docker

    Start Docker

    systemctl start docker

    To verify if docker is working properly, run

    docker run hello-world
    

    Example

    [root@cloud ~]# docker run hello-world
    Unable to find image 'hello-world:latest' locally
    latest: Pulling from library/hello-world
    2db29710123e: Pull complete 
    Digest: sha256:94ebc7edf3401f299cd3376a1669bc0a49aef92d6d2669005f9bc5ef028dc333
    Status: Downloaded newer image for hello-world:latest
    
    Hello from Docker!
    This message shows that your installation appears to be working correctly.
    
    To generate this message, Docker took the following steps:
     1. The Docker client contacted the Docker daemon.
     2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
        (amd64)
     3. The Docker daemon created a new container from that image which runs the
        executable that produces the output you are currently reading.
     4. The Docker daemon streamed that output to the Docker client, which sent it
        to your terminal.
    
    To try something more ambitious, you can run an Ubuntu container with:
     $ docker run -it ubuntu bash
    
    Share images, automate workflows, and more with a free Docker ID:
     https://hub.docker.com/
    
    For more examples and ideas, visit:
     https://docs.docker.com/get-started/
    
    [root@cloud ~]# 

    See docker

  • Install PHP 5.6 on AlmaLinux 8

    Install PHP 5.6 on AlmaLinux 8

    To install PHP 5.6 on AlmaLinux 8, first enable the epel repository.

    dnf install -y epel-release

    install remi repository with the command

    dnf install http://rpms.remirepo.net/enterprise/remi-release-8.rpm

    Now you can install PHP 5.6 with

    dnf install php56

    You can execute PHP with the command

    php56

    If you want PHP 5.6 to work with the command “php”, then edit

    vi ~/.bashrc

    At end of the file, add

    source /opt/remi/php56/enable

    Log off and login to the server or run command

    source /opt/remi/php56/enable

    Or you can create a symlink

    ln -s /opt/remi/php56/root/usr/bin/php /usr/bin/php

    If you need PHP work with Apache, run install Apache with

    dnf install httpd

    Install php-fpm with

    dnf install php56-php-fpm

    Enable and restart Apache

    systemctl enable php56-php-fpm
    systemctl enable httpd
    systemctl restart httpd
    systemctl restart php56-php-fpm

    php-fpm pool config file available at

    /etc/opt/remi/php56/php-fpm.d/www.conf
  • How to Migrate CentOS 8 to AlmaLinux

    How to Migrate CentOS 8 to AlmaLinux

    CentOS 8 is reaching its End of Life in December 2021. If you are using CentOS 8, you may need to consider migrating to other operating systems.

    Other alternatives for CentOS 8 are AlmaLinux, Rocky Linux, and Oracle Linux. All of these are free and are based on RHEL 8.

    AlmaLinux is released a migration script

    https://github.com/AlmaLinux/almalinux-deploy

    This script allows you to convert CentOS 8 to AlmaLinux.

    WARNING: Make sure you take a full system backup before migrating.

    Before migrating, make sure your system is up to date.

    dnf update
    

    If you get error, Error: Failed to download metadata for repo ‘appstream’, run

    sed -i -e "s|mirrorlist=|#mirrorlist=|g" /etc/yum.repos.d/CentOS-*
    sed -i -e "s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" /etc/yum.repos.d/CentOS-*
    dnf update
    

    Reboot the server

    reboot
    

    Once the server is back online, we can run the AlmaLinux migration script to start the migration.

    curl -O https://raw.githubusercontent.com/AlmaLinux/almalinux-deploy/master/almalinux-deploy.sh
    bash almalinux-deploy.sh
    

    After the migration is complete, run

    dnf distro-sync -y 
    

    Now you need to reboot the server

    reboot