Tag Archives: Centos6

[Solved] Cannot use lsof command “- bash: lsof: command not found” in centos6

1. Problem Description
Under centos, the command lsof cannot be used, and the following message appears:
# lsof -i:3690
-bash: lsof: command not found
2. Solution
We can install it via yum:
# yum install lsof
I will do the following:
# yum install lsof
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirrors.163.com
* epel: ftp.cuhk.edu.hk
* extras: mirrors.aliyun.com
* updates: mirrors.163.com
Resolving Dependencies
–> Running transaction check
—> Package lsof.x86_64 0:4.82-4.el6 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
lsof x86_64 4.82-4.el6 base 319 k

Transaction Summary
================================================================================
Install 1 Package(s)

Total download size: 319 k
Installed size: 890 k
Is this ok [y/N]: y
Downloading Packages:
lsof-4.82-4.el6.x86_64.rpm | 319 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : lsof-4.82-4.el6.x86_64 1/1
Verifying : lsof-4.82-4.el6.x86_64 1/1

Installed:
lsof.x86_64 0:4.82-4.el6

Complete!
3. Some common commands of lsof
lsof -i:(port number)
For example,
lsof -i:3306 (3306 is the port of mysql server by default)
lsof -i:3690 (3690 is the default port for the svn server)

OK, Enjoy it!!!

[Solved] Centos6: Python 2.6 upgrade to 3.7, error handling [no module named ‘_ctypes’]

Centos6 upgrade from Python 2.6 to 3.7, error handling [no module named ‘_ctypes’]

Because of the need of development, we upgrade Python 2 to Python 3 on CentOS 6 server. Due to the limitation of Intranet, manual installation is used here

1. View the current Python version

[python@VM000001564 ~]$ python -V
Python 2.6.6

2. Download Python stable version (current 3.7.2) from the official website for installation

Here, download software using Python User, install using root user

[python@VM000001564 ~]$ wget https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tgz
[python@VM000001564 ~]$ tar -xzvf Python-3.7.2.tgz
[python@VM000001564 ~]$ cd Python-3.7.2


[root@VM000001564 Python-3.7.2]# ./configure
[root@VM000001564 Python-3.7.2]# make && make install

3. Post verification version after installation

[python@VM000001564 Python-3.7.2]$ python3 -V
Python 3.7.2

4. Set 3.7.2 as the default version

The default version is 2.6.6, and 3.7.2 needs to be set

[root@VM000001564 Python-3.7.2]# ls -al /usr/bin | grep python
-rwxr-xr-x.  1 root root      11232 Oct 16  2014 abrt-action-analyze-python
-rwxr-xr-x.  2 root root       9032 Jan 22  2014 python
lrwxrwxrwx.  1 root root          6 Oct 27  2014 python2 -> python
-rwxr-xr-x.  2 root root       9032 Jan 22  2014 python2.6

Back up the original Python soft link:

# mv /usr/bin/python /usr/bin/python.bak

links python to python3:

# ln -s /usr/local/bin/python3 /usr/bin/python

5. Problems encountered in installation

ModuleNotFoundError: No module named ‘_ ctypes’

Because version 3.7 uses external modules_ Ctypes, you need a new package libffi devel. After installing this package, you can install it again

yum install libffi-devel -y
make install

If you remove the file link dependency of Python under/usr/bin before the installation, then Yum can’t be used normally. You need to download the relevant software package to install. To save readers’ time, put the link

Download this version from CentOS 7

wget http://mirror.centos.org/centos/7/os/x86_64/Packages/libffi-devel-3.0.13-18.el7.x86_64.rpm
rpm -ivh libffi-devel-3.0.13-18.el7.x86_64.rpm

Download this version from CentOS 6

wget http://mirror.centos.org/centos/6/os/x86_64/Packages/libffi-devel-3.0.5-3.2.el6.x86_64.rpm
rpm -ivh  libffi-devel-3.0.5-3.2.el6.x86_64.rpm

after installing this package, recompile it again. Just follow the installation steps, and remember

Centos6 upgrades glibc-2.17 to solve requirements: libc. So. 6 (glibc)_ 2.14) (64bit) error resolution

This article gives you a comprehensive understanding of Java object serialization and deserialization>>>

Centos6 upgrades glibc-2.17 to solve requirements: libc. So. 6 (glibc)_ 2.14) (64bit) error resolution

problems

The error of installing MySQL 5.7. X Series in centos6 is as follows:

[root@VM_0_5_centos mysql]# rpm -ivh mysql-community-libs-5.7.18-1.el6.x86_64.rpm 
warning: mysql-community-libs-5.7.18-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
error: Failed dependencies:
    libc.so.6(GLIBC_2.14)(64bit) is needed by mysql-community-libs-5.7.18-1.el6.x86_64
[root@VM_0_5_centos mysql]# 

You need to install libc. So. 6 (glibc)_ 2.14)(64bit)

View installed gblic version

strings /lib64/libc.so.6 | grep GLIBC

The implementation is as follows:

[root@VM_0_5_centos glibc-2.14]# strings /lib64/libc.so.6 | grep GLIBC
GLIBC_2.2.5
GLIBC_2.2.6
GLIBC_2.3
GLIBC_2.3.2
GLIBC_2.3.3
GLIBC_2.3.4
GLIBC_2.4
GLIBC_2.5
GLIBC_2.6
GLIBC_2.7
GLIBC_2.8
GLIBC_2.9
GLIBC_2.10
GLIBC_2.11
GLIBC_2.12
GLIBC_PRIVATE

use Yum to update installation dependencies

yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make -y

Download RPM package

wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-utils-2.17-55.el6.x86_64.rpm 
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-static-2.17-55.el6.x86_64.rpm 
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-2.17-55.el6.x86_64.rpm 
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-common-2.17-55.el6.x86_64.rpm 
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-devel-2.17-55.el6.x86_64.rpm 
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-headers-2.17-55.el6.x86_64.rpm 
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/nscd-2.17-55.el6.x86_64.rpm 

After downloading, the installation package is as follows:

[root@VM_0_5_centos glibc-2.17]# ls -ll -h
total 22M
-rw-r--r-- 1 root root  4.0M Feb 17  2015 glibc-2.17-55.el6.x86_64.rpm
-rw-r--r-- 1 root root   14M Feb 17  2015 glibc-common-2.17-55.el6.x86_64.rpm
-rw-r--r-- 1 root root 1020K Feb 17  2015 glibc-devel-2.17-55.el6.x86_64.rpm
-rw-r--r-- 1 root root  663K Feb 17  2015 glibc-headers-2.17-55.el6.x86_64.rpm
-rw-r--r-- 1 root root  1.7M Feb 17  2015 glibc-static-2.17-55.el6.x86_64.rpm
-rw-r--r-- 1 root root  193K Feb 17  2015 glibc-utils-2.17-55.el6.x86_64.rpm
-rw-r--r-- 1 root root  250K Feb 17  2015 nscd-2.17-55.el6.x86_64.rpm
[root@VM_0_5_centos glibc-2.17]# 

install RPM package

rpm -Uvh *-2.17-55.el6.x86_64.rpm --force --nodeps

After

is installed, check the version again

[root@VM_0_5_centos glibc-2.17]# strings /lib64/libc.so.6 | grep GLIBC
GLIBC_2.2.5
GLIBC_2.2.6
GLIBC_2.3
GLIBC_2.3.2
GLIBC_2.3.3
GLIBC_2.3.4
GLIBC_2.4
GLIBC_2.5
GLIBC_2.6
GLIBC_2.7
GLIBC_2.8
GLIBC_2.9
GLIBC_2.10
GLIBC_2.11
GLIBC_2.12
GLIBC_2.13
GLIBC_2.14
GLIBC_2.15
GLIBC_2.16
GLIBC_2.17
GLIBC_PRIVATE

You can see that the version numbers of 13 to 17 are added at one time