Minimal installation of CentOS/Fedora/RedHat

I have no doubt that noble dons - Linux administrators - strive to minimize the set of packages installed on the server as much as possible. It is more economical, safer and gives the administrator a feeling of complete control and understanding of the ongoing processes.

Therefore, a typical scenario for the initial installation of the operating system looks like choosing the minimum option, and then filling it with the necessary packages.

Minimal installation of CentOS/Fedora/RedHat

However, the minimal option offered by the CentOS installer turns out to be not quite minimal. There is a way to reduce the size of the initial installation of the system in a standard documented way.

Using the CentOS operating system at work, sooner or later you discover the automation of its installation using the Kickstart mechanism. I have not installed CentOS with the standard installer for a long time. During the work, a sufficient arsenal of configuration kickstart files has been accumulated, allowing you to automatically deploy systems, including on LVM, crypto partitions, with a minimal GUI, etc.

And so, in one of the releases of the 7th version, RedHat added an amazing option to Kickstart, which allows you to further minimize the image of the installed system:

--nocore

Disables installation of the Core package group which is otherwise always installed by default. Disabling the Core package group should be used for creating lightweight containers; installing a desktop or server system with --nocore will result in an unusable system.

RedHat warns honestly about the possible consequences of using this option, but my years of use in a real environment confirms its stability and applicability.

Below is an example of a minimal installation kickstart file. The brave can exclude yum from it. Get ready for surprises:

install
text

url --url="http://server/centos/7/os/x86_64/"

eula --agreed
firstboot --disable

keyboard --vckeymap=us --xlayouts='us'
lang en_US.UTF-8
timezone Africa/Abidjan

auth --enableshadow --passalgo=sha512
rootpw --plaintext ***

ignoredisk --only-use=sda

zerombr
bootloader --location=mbr
clearpart --all --initlabel

part /boot/efi --fstype="efi" --size=100 --fsoptions="umask=0077,shortname=winnt"
part / --fstype="ext4" --size=1 --grow

network --bootproto=dhcp --hostname=localhost --onboot=on --activate

#reboot
poweroff

%packages --nocore --nobase --excludedocs
yum

%end

%addon com_redhat_kdump --disable

%end

I want to note that CentOS / RedHat is more loyal to Fedora in the interpretation of the option. The latter will emasculate the system so much that it will need to be reinstalled with the addition of vital utilities.

As a bonus, I will give a β€œspell” for installing a minimal graphical environment in CentOS / RedHat (version 7):

yum -y groupinstall x11
yum -y install gnome-classic-session
systemctl set-default graphical.target

Both the minimal operating system image and the minimal graphical environment have been tested by me and work on real systems.

Source: habr.com

Add a comment