Packages to install

These core development tools are required to compile software and build new rpms and including the following packages:

autoconf

bison

gdb

flex

gcc (c/c++ compiler)

gcc-c++ compiler

redhat-rpm-config

strace

strace64

rpm-build

make

automake

pkgconfig

gettext

libtool

binutils (and all dependencies)

How to switch from FirewallD to Iptables on CentOS 7

Starting with RHEL 7 / CentOS 7, firewalld was introduced to manage iptables. As such, you will either need to use `firewall-cmd` commands or disable firewalld and enable iptables.

If you prefer to use the classic iptables setup, you will first need to stop and mask the firewalld service (see: systemd for details):

$ systemctl stop firewalld
$ systemctl mask firewalld

Then, install the "iptables-services" package (if it is not already installed):

$ yum install iptables-services

Enable the service at boot-time:

$ systemctl enable iptables

You can now either add iptables rules from the CLI (e.g., `iptables -I INPUT ...`) or create/edit the /etc/sysconfig/iptables file to look something like the following (very basic with ports 22 and 80 open):

If you are saving your rules in that /etc/sysconfig/iptables file, you will then need to run one of the following commands:

$ service iptables restart # OR:
$ systemctl restart iptables

Next, check that the iptables service is "active" with:

$ systemctl status iptables

Check your iptables rules with:

$ iptables -L
#~OR~
$ iptables -nvL

If you have any NAT rules, you can view them with:

$ iptables -t nat -vL

and that your server is listening on those ports you opened (22 and 80 in the above example):

$ netstat -plant

and you can query the systemd journal for a "log" of the changes you made to the iptables service with:

$ journalctl -f -u iptables.service

If you reboot your server after the above, your iptables rules should be saved and loaded again.

Remove old/unneeded kernels

It is sometimes necessary to remove old kernels, especially if you have a /boot partition running out of free space. The easiest (and safest) way to manually remove old/unneeded kernels is by using yum.

The above output shows that there are 3 kernels installed. It is a good practice to keep 3 to 5 kernels just in case a kernel update breaks something and you have to revert to an older version.

To remove the oldest version in the above kernel list, execute the following:

$ yum remove kernel-2.6.32-431.29.2.el6

You can also use a yum plugin to keep a given number of kernels and automatically remove the older ones (e.g., always keep the latest 3 kernels). You can edit the /etc/yum/pluginconf.d/installonlyn.conf file (or create it if it does not exist) and add/change the following lines:

[main]
enabled=1
# set the number of package versions to keep:
tokeep=3

The "enabled=1" line enables the yum plugin. The next time you run a `yum update`, yum will automatically remove the older versions and keep the latest 3 (note: This plugin will never remove your current working kernel). If you would prefer to keep any and all previous kernels, simply change that line to "tokeep=0".