Skip to content

Instantly share code, notes, and snippets.

@tlatsas
Last active February 8, 2019 18:42
Show Gist options
  • Save tlatsas/5916790 to your computer and use it in GitHub Desktop.
Save tlatsas/5916790 to your computer and use it in GitHub Desktop.
centos cheatsheet

CentOS cheatsheet

Installing EPEL repo on Centos 6.x

# curl -O http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -Uvh epel-release-6-8.noarch.rpm

rpm and yum

List files contained in installed package files

# rpm -ql package_name

List files contained in non-installed package files

# rpm -qlp package_name.rpm 

List files contained in remote package files

First install yum-utils then run repoquery --list <pkg>

# yum install yum-utils
# repoquery --list python-virtualenvwrapper

List dependencies of non-installed packages

# rpm -qpR package_name.rpm

Install local file with its dependencies

# yum install --nogpgcheck package_name.rpm

Install VBox guest additions on Centos 6

  1. mount the iso
  2. install EPEL repo: rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
  3. install packages required for build: yum install gcc kernel-devel kernel-headers dkms make bzip2
  4. export kernel version
export KERN_DIR=/usr/src/kernels/2.6.18-194.11.1.el5-x86_64
  1. cd into the folder that contains the guest additions (1) and run: ./VBoxLinuxAdditions.run
  2. reboot

Asterisk - FreePBX

Asterisk

Install dnsmasq:

yum install dnsmasq

Add repo:

rpm -Uvh http://packages.asterisk.org/centos/6/current/i386/RPMS/asterisknow-version-3.0.0-1_centos6.noarch.rpm

Update:

yum update

Install asterisk11:

yum install asterisk asterisk-configs --enablerepo=asterisk-11

FreePBX

FreePBX is now available at the same repo

yum install freepbx

or if you want to build the freepbx package navigate in the source directory and run install_amp.

Dependencies:

  • install php
  • install php-pear-DB
  • install php-posix
  • install fakeroot (build dep)

allow ssh pubkey login (SELinux)

There is a bug in CentOS 6 / SELinux that results in all client presented certificates to be ignored when SELinux is set to Enforcing. To fix this simply:

[root@node01 ~]# ssh root@node02 'restorecon -R -v /root/.ssh'
restorecon reset /root/.ssh context system_u:object_r:ssh_home_t:s0->system_u:object_r:home_ssh_t:s0
restorecon reset /root/.ssh/authorized_keys context unconfined_u:object_r:ssh_home_t:s0->system_u:object_r:home_ssh_t:s0

source

clear caches

# yum clean expire-cache && yum update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment