Archive

Posts Tagged ‘CentOS’

Install R language in CentOs Linux

2014/03/10 Leave a comment

Let’s see how to install R language in CentOs Linux. It is pretty simple:

Trying just that didn’t work…:

yum install R
No package R available.

And this one neither did:

yum install R-core R-devel
No pack…

# Install epel for El6 or CentOS 6
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
yum install R

Ok. Now R is already intelled. Let’s check it out:

R

R version 3.0.2 (2013-09-25) — “Frisbee Sailing”
Copyright (C) 2013 The R Foundation for Statistical Computing
Platform: x86_64-redhat-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type ‘license()’ or ‘licence()’ for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type ‘contributors()’ for more information and
‘citation()’ on how to cite R or R packages in publications.

Type ‘demo()’ for some demos, ‘help()’ for on-line help, or
‘help.start()’ for an HTML browser interface to help.
Type ‘q()’ to quit R.

> a=(1)
> a
[1] 1
> ls()
[1] “a”
> a
[1] 1
> b=(1:9)
> b
[1] 1 2 3 4 5 6 7 8 9
> a+b
[1] 2 3 4 5 6 7 8 9 10
> sum(a)
[1] 1
> sum(b)
[1] 45
> mean(b)
[1] 5
> var(b)
[1] 7.5
> b^2
[1] 1 4 9 16 25 36 49 64 81

 

It works!

Categories: Snippets of Code Tags: , , , , ,

How to fix failed dependencies when installing rpm Sphinx Search on CentOs

2014/02/15 4 comments

Trying to install the open source Sphinx Search Engine on my CentOs Linux server I got these errors:


wget "http://sphinxsearch.com/files/sphinx-2.1.5-1.rhel6.x86_64.rpm"
rpm -i sphinx-2.1.5-1.rhel6.x86_64.rpm

error: Failed dependencies:
libodbc.so.2()(64bit) is needed by sphinx-2.1.5-1.rhel6.x86_64
libpq.so.5()(64bit) is needed by sphinx-2.1.5-1.rhel6.x86_64

It means there are some libraries left in the system. To find out which are they I used this command:


yum provides **/libpq.so.5

This way I could install the missing libraries:


yum install unixODBC unixODBC-devel postgresql-libs

And then, I tried again (successfully this time) to reinstall Sphinx Search:


# rpm -i sphinx-2.1.5-1.rhel6.x86_64.rpm

Sphinx installed!
Now create a full-text index, start the search daemon, and you're all set.

To manage indexes:
editor /etc/sphinx/sphinx.conf

To rebuild all disk indexes:
sudo -u sphinx indexer --all --rotate

To start/stop search daemon:
service searchd start/stop

To query search daemon using MySQL client:
mysql -h 0 -P 9306
mysql> SELECT * FROM test1 WHERE MATCH('test');

See the manual at /usr/share/doc/sphinx-2.1.5 for details.

For commercial support please contact Sphinx Technologies Inc at
http://sphinxsearch.com/contacts.html

I hope this tip can help someone …

Easy install MySQL on CentOS 6

2011/08/08 1 comment
CentOS

Install MySQL on CentOS 6

Assuming you have installed Linux CentOS 6 and network is running correctly, follow next commands to install MySQL server. I did run these commands on a fresh Full Desktop CentOS 6 (64 bits) install over VM VirtualBox. Nevertheless, the following commands will be useful also on other configurations. Use root permissions.

yum install mysql mysql-server
service mysqld start
chkconfig --levels 235 mysqld on
/usr/bin/mysql_secure_installation

mysql -u root -p
	CREATE DATABASE mydb;
	CREATE USER 'mydbuser'@'*' IDENTIFIED BY 'mydbpass';
	GRANT ALL ON mydb.* TO mydbuser@'*';
	FLUSH PRIVILEGES;

// Granting remote access to MySQL Server on port 3306:
vi /etc/sysconfig/iptables
// Write this line before last line "COMMIT"
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT

service iptables restart

Done! Now try to connect to your database.