Open In App
Related Articles

Getting Started with CentOS

Improve Article
Improve
Save Article
Save
Like Article
Like

CentOS is a popular open-source Linux distribution aimed at servers and provides compatibility with Red Hat’s RPM package manager. It is built with the goal of providing a stable operating system that provided great compatibility with the upstream RHEL (Red Hat Enterprise Linux) CentOS is therefore one of the best free Linux distributions to utilize in server space.

Choosing CentOS over Ubuntu

CentOS is based on Red Hat Enterprise Linux while Ubuntu is based on Debian. CentOS is considered a little more stable than Ubuntu because CentOS doesn’t get as many updates as ubuntu. It is very common that when you have tons of updates, the latest features, patches, modules, and the latest software then sometimes it can be a little buggy so it’s considered a little more stable. 

Ubuntu on the other hand can be considered a higher-performance OS because it has the latest packages and the latest software out there. 

Since CentOS has more stability and is a platform functionally compatible with its upstream source, it would be preferable in cases when it comes to business or if we are hosting a web server for other clients. Typically web servers would probably be more compatible with CentOS.

Hardware Requirements CentOS

  • It requires a processor of 1.1GHz or more.
  • The minimum requirement of RAM is 1GB whereas the recommended RAM is 2GB.
  • The minimum disk space required is 20GB whereas the recommended disk space is 40GB.
  • The architecture of the system is Intel 64 or AMD64.

Graphical Installation of CentOS 7

We can install CentOS with an installation utility called Anaconda. CentOS installer, Anaconda, provides a simple graphical method to install CentOS. Anaconda is a tool that provides an interactive graphical interface for installing CentOS through which a user can easily install it. The graphical interface of Anaconda has a built-in help system that can guide users through installation steps. 

Most operating system installer programs follow a linear path of installation but Anaconda is different due to its parallel nature. We can customize and configure advanced installation options if required. While installing the OS, if the configuration of a certain option gets blocked due to a background task like network initialization or disk detection then in that case we can configure other options while waiting for the task to be over.

To install CentOS 7 Server with GUI follow the steps given below :

Step 1: First, we need to download CentOS’s Disk Image (ISO File) from their official website centos.org. 

 

Step 2: Now click on the available architectures according to your system.

 

Step 3: Choose any mirror to download the ISO File. Now once the downloading is over we can start the Disk Image installation. Click on the option Install CentOS 7” and wait till a new interface appears.

 

Step 4: Choose the language for the installation process.

 

Step 5: Now configure options such as date and time, software selection, installation path, network configuration, etc. 

 

Step 6: For demonstration, here we choose the environment as a Server with GUI having the following add-ons.

 

Step 7: Now click on the “Begin Installation” option to start the installation. Now, set up a root password and user account.

 

Step 8: Once the installation completes, reboot and accept the license agreement.

 

Step 9: Now use the password created before to log in to the user account for the system.

 

 

After completing the installation process we can do the following:

 Example 1: Getting the IP address of the Server

To get the IP address of the server we can use the ifconfigcommand.

ifconfig | grep 192

The above command will display the IP address of the host system.

 

We can also use the “ip addr” with grep to get the same result.

ip addr | grep 192

 

Example 2: Updating the Packages

To check for any updates available for your installed packages, use the “yum” package manager. Type the command below on the terminal:

yum check-update

 

To update a single package to the latest available version, run the command below:

yum update [package name]

To update all packages to the latest available version, run the command below:

yum update -y

 

Example 3: Installing VIM 

To install the VIM editor on CentOS, type the command given below on the terminal.

sudo yum install vim-enhanced -y  

 

Nowadays, the VIM editor comes pre-installed with CentOS.

Example 4: Installing EPEL repository

We can use the “yum” package manager to install the EPEL repository. Connect to the server via SSH as the root user or open a terminal and type the command below 

sudo yum install epel-release

 

It will simply install all the required packages of EPEL. In this case, it is already installed.

Example 5: Install Byobu

After installing the EPEL repository, we can also use the “yum” package manager to install the Byobu. Type the command below:

yum -y install byobu

 

One thing to keep in mind is that the EPEL repository should be enabled before installing Byobu. To enable the EPEL repository type the command below.

yum --enablerepo="epel"

To check whether the repository is enabled or not type the command below.

yum repolist enabled

 

Example 6: Permanently Disable SELinux

To permanently disable SELinux and make it persist across reboots follow the steps below :

Open the SELinux configuration file on any editor.

nano /etc/selinux/config

 

  • Now change the SELINUX directive to either permissive or disabled.
  • Now just save and exit the configuration file and then reboot the system.

Example 7: Granting Users Sudo

To grant the superuser permission to the normal user account, type “sudo su” and then type the root account password.

sudo su

 


Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 04 Dec, 2022
Like Article
Save Article
Similar Reads
Related Tutorials