RedHat 7 – Setup locally mounted CD/DVD/ISO as yum repository

1. Mount the disk to /media folder
2. copy media.repo from the root of the disk to /etc/yum.repos.d/ and set permission to 644
3. edit the media.repo changing gpgchedk from 0 to 1 and adding the following lines:


4. Clear caches:
yum clean all
subscription-manager clean

5. list and update yum

yum list
yum update

LINUX – Using Local YUM REPO on RedHat 7 using DVD ISO

Often I need to install packages that are on the RHEL install DVD and being able to use the install ISO without having a Red Hat subscription or license is extremely useful.

  • Mount the DVD to cdrom folder
mkdir /cdrom
 mount /dev/cdrom /cdrom
  • Create yum local repo file:
cd /etc/yum.repos.d
 vi local.repo

and past this content:

 name=Local Repository

save the file and clean yum repository cache:

yum clean all

Job done.

Linux – CentOS – disable/enable SELinux

From  CentOS 7 SELinux is enabled and set to enforcing by default.

To disable it pernamently open and edit /etc/selinux/config
and set the SELINUX=enforcing to permissive or disabled

After that change is made it is necessary to restart the system.

There is another way to disable it right away by running this command:

#setenforce 0

than to check the status run:

SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: permissive
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 28

Systemd – creating a custom service

Generally speaking when creating new custom service, best practice dictates that it is saved in the /etc/systemd/system directory (as opposed to the /lib/systemd/system)

My template for systemd service startup script:

Description=My service description

ExecStart=/full/path/to/command -with "Parameters"


The script is saved as service_name.service under /etc/systemd/system
Once the service unit file is saved it needs to be enabled:

systemctl enable service_name.service
systemctl start service_name
systemctl status service_name

and to double check:

journalctl -xn

to see if there are any errors caused by the new service.

To memorise few useful systemd terms I have created a memrise course: