Get Social

Viber Desktop on Debian Lenny

Problem: Viber Desktop does not start on Debian Linux.

When we running the command /opt/viber/Viber in the terminal, we can see the error:

/opt/viber/Viber: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.15' not found (required by /opt/viber/Viber)
/opt/viber/Viber: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by /opt/viber/Viber)
/opt/viber/Viber: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by /opt/viber/libQt5Widgets.so.5)
/opt/viber/Viber: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.15' not found (required by /opt/viber/libQt5Network.so.5)
/opt/viber/Viber: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by /opt/viber/libQt5Network.so.5)
/opt/viber/Viber: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by /opt/viber/libQt5Sql.so.5)
/opt/viber/Viber: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by /opt/viber/libQt5WebKit.so.5)
/opt/viber/Viber: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by /opt/viber/libQt5WebKitWidgets.so.5)
/opt/viber/Viber: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by /opt/viber/libQt5Declarative.so.5)
/opt/viber/Viber: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by /opt/viber/libQt5DBus.so.5)
/opt/viber/Viber: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by /opt/viber/libQt5OpenGL.so.5)
/opt/viber/Viber: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by /opt/viber/libQt5Gui.so.5)
/opt/viber/Viber: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.15' not found (required by /opt/viber/libQt5Core.so.5)
/opt/viber/Viber: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by /opt/viber/libQt5Core.so.5)
/opt/viber/Viber: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by /opt/viber/libicui18n.so.48)
/opt/viber/Viber: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by /opt/viber/libicuuc.so.48)
/opt/viber/Viber: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by /opt/viber/libQt5Quick.so.5)
/opt/viber/Viber: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by /opt/viber/libQt5Qml.so.5)
/opt/viber/Viber: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by /opt/viber/libQt5PrintSupport.so.5)
/opt/viber/Viber: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by /opt/viber/libQt5XmlPatterns.so.5)
/opt/viber/Viber: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by /opt/viber/libQt5Script.so.5)

what to do?

The idea was found on superuser.com:

go to packages.debian.org, download fakeroot and install from individual packages:

mkdir /opt/fakeroot
dpkg -x libc6_2.19-11_amd64.deb /opt/fakeroot
dpkg -x libc6-dev_2.19-11_amd64.deb /opt/fakeroot

Now, start with new command:
LD_LIBRARY_PATH=/opt/fakeroot/lib/x86_64-linux-gnu/ /opt/viber/Viber

Profit!

Installing and configuring sphinx on centos 5

This information is suitable for sphinx versions 2.0.9 and below (also sphinx 1.x).
If you need to install and configure version 2.2.x (2.2.11, for example), then see here >>

[1] How to install sphinx on centos 5

Where to search for information?

As always – first we look, that is in search on query “installation sphinx on centos”.
We open several tabs and work on it. And of course, we look at the official documentation (http://sphinxsearch.com/docs)
yum search sphinx
yum install sphinx
cat /etc/redhat-release
CentOS release 5.9 (Final)

wget http://sphinxsearch.com/files/sphinx-2.0.9-1.rhel5.i386.rpm
yum --nogpgcheck localinstall sphinx-2.0.9-1.rhel5.i386.rpm

rpm -Uvh sphinx-2.0.9-1.rhel5.i386.rpm
error: Unsatisfied dependencies:
libmysqlclient.so.15 required for sphinx-2.0.9-1.rhel5.i386
libmysqlclient.so.15(libmysqlclient_15) required for sphinx-2.0.9-1.rhel5.i386

I go to http://sphinxsearch.com/docs/current.html#installing
wget http://sphinxsearch.com/files/sphinx-2.0.9-release.tar.gz

cd sphinx-2.0.9-release
./configure
make

libsphinx.a(sphinx.o): In function `xmlUnknownEncoding':
/root/install/sphinx-2.0.9-release/src/sphinx.cpp:22846: undefined reference to `libiconv_open'
/root/install/sphinx-2.0.9-release/src/sphinx.cpp:22864: undefined reference to `libiconv'
/root/install/sphinx-2.0.9-release/src/sphinx.cpp:22870: undefined reference to `libiconv_close'
collect2: ld completed with a return code 1

How to fix this error “collect2: ld completed with a return code 1” ?

replace:
LIBS = -lexpat -ldl -lm -lz -L/usr/local/lib -lrt -lpthread
to
LIBS = -lexpat -liconv -ldl -lm -lz -L/usr/local/lib -lrt -lpthread
profit!

make
make install

[2] How to configure sphinx on centos 5

just in case, backup the original configs:
cd /usr/local/etc
cp -i sphinx-min.conf.dist sphinx-min.conf.dist.copy
cp -i sphinx.conf sphinx.conf.copy

set the configuration for own database
nano /usr/local/etc/sphinx.conf

We will create the folders listed in the config (otherwise we’ll get errors … 🙂 )
mkdir /home/user/sphinx_data/
mkdir /var/log/sphinx/

start service:
searchd --config /usr/local/etc/sphinx.conf

check that the service on the required ports is working
lsof -i tcp:9312
lsof -i tcp:9306

check that the log files have been created:
ls -lh /var/log/sphinx/

Useful commands for sphinx search service

create index:
indexer --config /usr/local/etc/sphinx.conf --all

update index:
indexer --config /usr/local/etc/sphinx.conf --rotate

search test in the console:
search -q --config /usr/local/etc/sphinx.conf -a 123
or simple:
search -q 123
In order to use the search on the site, you need to use the Sphinx API for PHP.
This is the library that comes with the distribution. We find where it is:
locate sphinxapi.php
<?php
.....
// Plug sphinx-api
require_once ("sphinxapi.php");
.....
?>

Add cron task to the rotation every 15 minutes (the indexer path is full, because the cron are usually do not know where to look for executable files):
*/15 * * * * /usr/local/bin/indexer --config /usr/local/etc/sphinx.conf --rotate > /dev/null 2>&1

[3] How to make searchd (sphinx) start on reboot?

1) Beautiful method – as described in this article.

2) A simple method is to check in the cron every minute whether searchd is started and run it, if necessary. Criterion – check the existence of a pid-file:
* * * * * if [ ! -f /var/log/sphinx/searchd.pid ]; then /usr/local/bin/searchd --config /usr/local/etc/sphinx.conf; fi > /dev/null 2>&1

 

Update, 21.12.2016: This settings for Sphinx 1.x и 2.0.x; to learn how to install and configure Sphinx versions 2.2.x read: Installing and Configuring Sphinx 2.2.11 (Yii with delta Indexes) on Ubuntu / Debian and RHEL / CentOS 7