Tag Archives: centos

grep: error while loading shared libraries: libpcre.so.0

I have a server running CentOS 6 successfully upgraded to CentOS 7.

The only problem I encountered so far is that ‘grep’ doesn’t work.

[root@zilla ~]# grep
grep: error while loading shared libraries: libpcre.so.0: cannot open shared object file: No such file or directory
[root@zilla ~]# ldd /usr/bin/grep
        linux-vdso.so.1 =>  (0x00007ffc0b639000)
        libpcre.so.0 => not found
        libc.so.6 => /lib64/libc.so.6 (0x00007f6be1c6c000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f6be2038000)

First thing I tried was to reinstall pcre package which provides libpcre.so*. It still didn’t work. Fortunately, someone has posted a solution as the following:

[root@zilla ~]# link /usr/lib64/libpcre.so.1 /lib64/libpcre.so.0
[root@zilla ~]# grep --version
grep (GNU grep) 2.20
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later .
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and others, see .

Credit: update to Centos 7; libpcre.so.0 No such file or directory

ISC Dhcpd Duplicate UID Lease

Someone asked this question in one of his blog posts:

Ever see this?

dhcpd: uid lease for client xx:xx:xx:xx:xx:xx is duplicate on 192.168.1/24

Yes, I’m seeing something like that now in the my dhdcp logs. Here is the actual message:

DHCPREQUEST for from 08:00:27:6e:61:b8 via eth0
DHCPACK on to 08:00:27:6e:61:b8 via eth0
DHCPINFORM from via eth0
DHCPACK to (08:00:27:6e:61:b8) via eth0
uid lease for client 08:00:27:6e:61:b8 is duplicate on
DHCPREQUEST for from 08:00:27:6e:61:b8 via eth0
DHCPACK on to 08:00:27:6e:61:b8 via eth0

I think I know why this happened. Basically, the machine with MAC address of ’08:00:27:6e:61:b8′ used to have grab an IP address
from the pool. Then later on, I have created a reservation for it.

host mathtXXX-win {
    hardware ethernet 08:00:27:6e:61:b8;

On Centos 7, the lease file is located at: /var/lib/dhcpd/dhcpd.leases. Here’s the duplicated lease for mathtXXX:

lease {
  starts 3 2015/06/10 01:44:21;
  ends 3 2015/06/10 01:49:24;
  tstp 3 2015/06/10 01:49:24;
  cltt 3 2015/06/10 01:44:21;
  binding state free;
  hardware ethernet 08:00:27:6e:61:b8;
  uid "\001\010\000'na\270";

By removing the above block and restarting dhcpd service, the “uid lease duplicate” message no longer appears in the log.

YUM what provides this file, huh?

This post is primarily written to remind myself, an Ubuntu user, to figure out how to find what RPM package provides a file — for example a header file.

Today, I’m trying to compile and install R 3.1.3 on CentOS 6 from source code. This R installation is one of the requirements to install Tessera stack. The instruction from the installation page is:

sudo yum install blas blas-devel lapack lapack-devel
wget http://cran.r-project.org/src/base/R-3/R-3.1.3.tar.gz
tar zxvf R-3.1.3.tar.gz
cd R-3.1.3
./configure --with-blas --with-lapack --with-x --enable-R-shlib
sudo make install

Unfortunately, the process failed with ./configure with the complain about missing readline library. To fix it, I had to install readline-devel package.

sudo yum install blas blas-devel lapack lapack-devel readline-devel

After that, I re-ran the ./configure. This time it still complains that some X11 header files are missing, one of them is: Intrinsic.h.

Let’s find out what package provides this file:

# yum provides \*/Intrinsic.h
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.mirror.digitalpacific.com.au
 * extras: centos.mirror.digitalpacific.com.au
 * updates: centos.mirror.digitalpacific.com.au
libXt-devel-1.1.4-6.1.el6.x86_64 : X.Org X11 libXt development package
Repo        : base
Matched from:
Filename    : /usr/include/X11/Intrinsic.h

libXt-devel-1.1.4-6.1.el6.i686 : X.Org X11 libXt development package
Repo        : base
Matched from:
Filename    : /usr/include/X11/Intrinsic.h

Ah ha, so let’s install libXt-devel. This time, I was able to configure, make and install the R.

References: https://www.centos.org/forums/viewtopic.php?t=5933

Good permission for /tmp

I have been having issues getting X2Go running on a CentOS 6.5 box. It took me a while to figure out that the problem laid with the permission of /tmp directory. I’ll write how to solve the X2Go problem in another post.

The recommended permission for /tmp is 1777. Notice that the forwarding ‘1’ is the sticky bit which only allows the owner of the file within /tmp (or the root user) to delete/rename the file.

# chmod 1777 /tmp
# ls -ld /tmp
drwxrwxrwt. 11 root root 4096 Feb 16 11:00 /tmp

Install crontab on CentOS 6

When you install CentOS 6 using minimal CD, a lot of packages aren’t installed by default; cron  included. To install it,

# yum install cronie

After the installation, you can verify that crond is running:

# chkconfig --list crond
crond 0:off 1:off 2:on 3:on 4:on 5:on 6:off