CentOS 8 Setup for Developers

In this article, I will discuss why CentOS 8 is amazing for developers, and walk you through an install script I have created to make downloading all the additional software you may need easy and automatic.

CentOS 8 after much delay is finally released! It is a free copy of RHEL 8 which was branched from Fedora 28. Why would this be of interest to you? I consider this version of CentOS to be the first that can be considered a viable long term support version of Fedora. This is mainly due to two technical innovations, flatpak, and appstream.

CentOS 8 is the First Version with AppStream

Previous versions of CentOS went out of date too fast for developers, but now updated applications can be accessed in a much more timely manner without sacrificing the stability of the OS. The main way it does this is with a new technology called AppStream. Applications like Node can now have officially supported latest versions as well as crusty old supported versions.

Many people consider CentOS to be only for server use, and in the past, it has been hard to setup for development and a general use desktop. Today I will show you that is not true anymore, so follow along and join me on this magical journey into the promised land of stability and up-to-date applications!

This guide is for developers, so I am assuming you know a bit about computers and operating systems, I am just going to point out the things that are specific to this setup.

Installation from the ISO image

Download and Burn the ISO Image to a USB drive

Download the official ISO image and write it to a USB stick.

If you have a computer already running Gnome desktop, the Disks utility can write a disk image easily for you. Select the USB drive you want to write to and Restore Disk Image … from the drop-down menu

If you are running Windows follow the official guide to Making Installation USB Media on Windows, and for Mac: Making Installation USB Media on Mac OS X

Backup Everything and Prepare to Beam Yourself into the Future…

It is possible to run Linux and Windows on the same machine, but that would be a giant waste of time. Windows 10 is awful, and now completely redundant. If you want to get up to that kind of nonsense I suggest you close this tab and never darken my website again 🙂

I am going assume you have backed up all the data you want to keep and can wipe the hard drive on the computer you wish to install CentOS on.

Boot into the computer and use whatever BIOS options you have available to choose to boot from the USB stick. Now the quest for the ultimate desktop developer experience can begin! Let the installer run and follow the options you want.

Important note I am assuming that you will choose to select SOFTWARE / Software Selection / Base Environment > Workstation and also when you create user tick make user administrator. If you need some help with the installer you can read this guide.

Install All the Packages You Need with This Install Script

Download the following script and make it executable. We will then look at how it works so you can customize it.

https://raw.githubusercontent.com/David-Else/fedora-ultimate-setup-script/master/centos8-ultimate-install-script.sh

Now you have CentOS 8 installed in its basic unmodified form. Before you do anything else, it is time to run the install script to install all the additional software you will require. I will break down the important parts of the script so you can edit them for your own custom version.

General Script Setup

set -euo pipefail
exec 2> >(tee "error_log_$(date -Iseconds).txt")

GREEN=$(tput setaf 2)
BOLD=$(tput bold)
RESET=$(tput sgr0)

if [ "$(id -u)" != 0 ]; then
    echo "You're not root! Run script with sudo" && exit 1
fi

Here we set the script to run with more conservative settings, generate a date stamped error log file, set some text colors and exit if it is not run using sudo.

Packages to Install / Remove

packages_to_remove=(
...)

packages_to_install=(
...)

flathub_packages_to_install=(
...)

fedora_flatpak_packages_to_install=(
... )

These arrays of package titles are self-explanatory. The only unusual one is the fedora_flatpak_packages_to_install option. CentOS uses an ancient LTS version of Firefox by default, so I am using a Fedora flatpak version here. This is not ideal, but it seems to work well apart from a bug I have that seems to prevent updates. To overcome the bug you need to uninstall and then reinstall.

Soon there will be an official Firefox flatpak and I suggest you switch to that. Another solution is to manually download the latest Mozilla Linux build, for example, https://ftp.mozilla.org/pub/firefox/releases/70.0/linux-x86_64/en-US/ or for the latest version:

mkdir temp
wget -O- "https://download.mozilla.org/?product=firefox-latest-ssl&os=linux64&lang=en-US" | tar -jx -C ./temp

There is some logic involved in the script with regard to the packages. For example, if you don’t include code then it won’t install the repository needed to download it. This is located in the add default and conditional repositories section.

Selecting Standard or Web Developer Install

read -p "Are you going to use this machine for web development? (y/n) " -n 1
...
packages_to_install+=("${developer_packages[@]}")

The user (you) has the option of selecting a standard or web development install. It will add a load more packages for web development, and do the additional setup. You can edit these additional package names too.

Download Binaries for Unavailable Packages

echo "${BOLD}Downloading and installing binaries...${RESET}"
curl -Of https://shellcheck.storage.googleapis.com/shellcheck-v0.7.0.linux.x86_64.tar.xz
echo "84e06bee3c8b8c25f46906350fb32708f4b661636c04e55bd19cdd1071265112d84906055372149678d37f09a1667019488c62a0561b81fe6a6b45ad4fae4ac0 ./shellcheck-v0.7.0.linux.x86_64.tar.xz" |
    sha512sum --check
tar -C /usr/local/bin/ -xf shellcheck-v0.7.0.linux.x86_64.tar.xz --no-anchored 'shellcheck' --strip=1

Not all packages are available at this time, so I manually download and install some binaries to /usr/local/bin/ Note I have added additional sha512 checks in case the US government is trying to man in the middle your brand new CentOS install. That is not happening using this script!

Setting Up The Desktop

I have written the centos8-ultimate-setup-script to take care of this, there are some general details in the fedora-ultimate-setup-script repository. If you would like another article to cover that then please leave a comment. I will gage the demand… these articles take a long time! 🙂

Enjoy CentOS 8!

Leave a Comment

Your email address will not be published. Required fields are marked *