Minimal installation CentOS/Fedora/RedHat

I have no doubt that the noble dons are administrators Linux — strive to minimize the number of packages installed on the server. This is more cost-effective, secure, and gives the administrator a sense of complete control and understanding of the 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 CentOS/Fedora/RedHat

However, the minimum option offered by the installer CentOS, it turns out, isn't quite minimal. There is a way to reduce the size of the initial system installation using a standard, documented method.

Using the operating system CentOS Sooner or later, you discover that you can automate its installation using the Kickstart mechanism. I haven't installed it for a long time. CentOS A standard installer. Over time, we've accumulated a sufficient arsenal of kickstart configuration files, allowing for automated system deployment, including on LVM, crypto partitions, with a minimal GUI, and so on.

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 lenient than Fedora in interpreting this option. The latter will degrade the system so much that a reinstallation with the addition of essential utilities will be required.

As a bonus, I will give you 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

Buy reliable hosting for sites with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster