RPM Package Manager

rpm verify packages

On RHEL, CentOS, Fedora etc use RPM for package menagement. To find the package that provides a binary file, run

List all files in an rpm package

To see change log for a rpm package, run


To find which RPM package owns a file

See yum

Open MySQL Port 3306 in CentOS 7

To allow MySQL to connect from remote server on CentOS 7 server, you need to enable port 3306 in firewall.

To do this, edit file


Add above

Restart server.

Install python 3.6 on CentOS 7

CentOS 7 come with Python 2.7. To install python 3.6, first install EPEL repo.

Install IUS repo.


For CentOS 7, run

Now you can install python 3.6 with yum

Python 3.6 binary will be available as “python3.6” and “pip3.6”

Install Python 2.7 on CentOS 6

CentOS 6 comes with python 2.6, to install python 2.7, first install gcc and dependencies yum

Download latest Python 2.7 from


For Python 2.7.2 (latest at the time of writing this post).

We use “make altinstall” so python will be installed as python2.7. If you do “make install”, it replace system python binary and break CentOS.

Install pip

centos 7 php memcache

Install memcached on CentOS 7

To install memcached on CentOS 7, run

Set memcached to start on boot

Start memcached with

Installing PHP Module

You need remi repository installed, that provide memcached module for all versions of php they support.

For PHP 5.6, run

Now phpinfo() will show

centos 7 php memcache

See memcached

Adding IP Range in CentOS 6

To add an IP range in CentOS 6 server, create file


Replace IP with your actual start and end IP.

Restart network service with


Install MySQL 8 on CentOS, RHEL 6/7

To Add MySQL yum repository to your server, go to


Download the rpm file available.

For RHEL/CentOS 7

For RHEL/CentOS 6

Installing MySQL Server

Stop/Start MySQL

To stop/start MySQL, use service name “mysqld”.

MySQL 8 root Password

When MySQL first starts, it create a random password and store in MySQL log file. To find the MySQL root password, run

This default password don’t allow you to do anything, so login to MySQL with this password and set a secure password for root.

MYSQL_ROOT_PASSOWRD – replace it with you secure new MySQL root password.

Installing Older Version of MySQL

When you add MySQL repository, it activate latest version by default. If you want older version, say 5.7, you need to activate it.

To see available repository, run

To disable MySQL 8 repository, run

To enable MySQL 5.7 repository, run

Now installing MySQL server will install MySQL 5.7 instead of latest version.



chkconfig is a command available in CentOS 6 to set a service start on boot.

To start lighttpd on boot run.

chkconfig command list all services and its run levels.

Install FFmpeg on CentOS using yum

Install epel repository using

Method 1

Install scrpms repo

On CentOS 7

On CentOS 6

Install ffmpeg with

NOTE: On 2019-12-11 i tested it on CentOS 7. ffmpeg worked. Version is 4.2.1. mplayer/mencoder install failed with dependency error.

Method 2


On CentOS 7

Install ffmpeg with

NOTE: On 2019-12-11 i tested it on CentOS 7. ffmpeg and mencoder install worked. But version is very old. ffmpeg version 2.8.15. MPlayer SVN-r37391-4.8.3

See ffmpeg