Categories
Centos Linux

CentOS 8 Setup for Developers

CentOS 8 is a free version of RHEL 8 which was branched from Fedora 28. I consider this new version of CentOS to be the first viable long term support version of Fedora.

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

Many people consider CentOS to be only for server use. In the past, it has been hard to setup for development and as a general use desktop. This 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.

CentOS 8 includes AppStream

Previously software in CentOS went out of date too quickly for developers, but with AppStream officially supported updated applications can be accessed faster without sacrificing the stability of the OS. Applications like NodeJS can now have multiple officially supported versions, including the latest.

$ dnf module list nodejs

CentOS-8 - AppStream
Name                                 Stream
nodejs                               10 [d]
nodejs                               12 [e

Extra Packages for Enterprise Linux Modular 8 - x86_64
Name                                 Stream
nodejs                               12 [e]
nodejs                               13

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

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 important data and can wipe the hard drive 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. If you have more options choose UEFI mode. 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

Follow the instructions in the Github repo to download the install scripts. We will then look at how they work so you can customize them.

Now should by now have CentOS 8 installed in its basic unmodified form. Before you do anything else, it is time to run the centos8-ultimate-install-script.sh. 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=(
)

These arrays of package titles are self-explanatory.

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.

case " ${packages_to_install[*]} " in
*' code '*)
    # only run if code is included in packages to install
    ;;&
*' brave-browser '*)
    # ....
    ;;
esac

Selecting Standard or Web Developer Install

read -p "Are you going to use this machine for web development? (y/n) " -n 1 webdev

You have 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 Reply

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