日常linux相关工作问题汇总

此篇博文记录自己学习Linux及Linux工作中遇到的各种故障及问题的汇总


  • CentOS6.5中安装Mysql后在建立mysql库时并初始化时出现错误提示:Installing MySQL system
    tables…/bin/mysqld: error while loading shared libraries:
    libstdc++.so.5: cannot open shared object file: No such file or
    directory

**解决方案:**安装后重新初始化即可

yum install -y compat-libstdc++-33

  • CentOS6.5中安装PHP,在编译时出现错误提示:checking for xml2-config path…configure:
    error: xml2-config not found. Please check your libxml2 installation.

**解决方案:**安装后重新编译

yum install -y libxml2-devel

  • CentOS6.5中安装PHP,在编译时出现错误提示:checking whether libxml build works… noconfigure: error: build test failed. Please check the config.log for details.

**解决方案:**安装后重新编译

yum erase zlib-devel
yum install -y zlib-devel
yum install -y libxml2-devel

  • CentOS6.5中安装PHP,在编译时出现错误提示:configure:error: Cannot find OpenSSL’s <\evp.h>

**解决方案:**安装后重新编译

yum install -y openssl-devel

  • CentOS6.5中安装PHP,在编译时出现错误提示:checking for BZip2 in default path… not found configure: error: Please reinstall the BZip2 distribution

**解决方案:**安装后重新编译

yum install -y bzip2-devel

  • CentOS6.5中安装PHP,在编译时出现错误提示:configure: error: mcrypt.h not found. Please reinstall libmcrypt.

**解决方案:**安装后重新编译

yum install -y epel-release
yum install -y libmcrypt-devel

  • CentOS6.5中安装PHP扩展模块memcache时/usr/local/php/bin/phpize生成config配置文件出现错误提示:
    Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script.

解决方案:

yum install -y autoconf

  • CentOS6.5中用scp命令从其他系统中拷贝文件时出现错误提示:ssh: connect to host 188.188.7.41 port 22: Connection refused

解决方案:

安装完openssh-clents及openssh-server后用检查iptables中SSH端口是什么,用scp -P SSH端口号 root@192.168.0.22:/tmp/1.txt ./2.txt  ---指定SSH端口号为2222并将远程192.168.0.22的root帐户服务器的/tmp/1.txt文件拷贝到本机当前目录的2.txt

  • CentOS6.5中安装LNMP的PHP时出现错误提示:checking for cURL in default path… not found configure: error: Please reinstall the libcurl distribution - easy.h should be in /include/curl/

解决方案:

yum install -y libcurl-devel

  • CentOS6.5中安装LNMP的PHP时出现错误提示:configure: error: jpeglib.h not found.

解决方案:

yum install -y libjpeg-devel

  • CentOS6.5中安装LNMP的PHP时出现错误提示:configure: error: png.h not found.

解决方案:

yum install -y libpng-devel

  • CentOS6.5中安装LNMP的PHP时出现错误提示:configure: error: freetype.h not found.

解决方案:

yum install -y freetype-devel

  • CentOS6.5中安装LNMP的PHP时出现错误提示:configure: error: libXpm.(a|so) not found.

解决方案:

yum install -y libXpm-devel

  • CentOS6.5中安装LNMP的PHP时进行make步骤提示错误:/usr/bin/ld: cannot find -lltdl collect2: ld returned 1 exit status

解决方案:

yum install -y libtool-ltdl-devel

  • CentOS6.5中安装LNMP环境的Nginx时在编译步骤提示错误:
    checking for PCRE library … not found
    checking for PCRE library in /usr/local/ … not found
    checking for PCRE library in /usr/include/pcre/ … not found
    checking for PCRE library in /usr/pkg/ … not found
    checking for PCRE library in /opt/local/ … not found

解决方案:

yum install -y pcre-devel

解决方案:

添加sohu源
vim CentOS-Media.repo
把enabled=1改成enabled=0
然后再修改:你所有采用的源,例如我采用的是sohu 的,就修改sohu的:
vim CentOS-Base-sohu.repo
在[addons] 下面添加:
enabled=0
然后,再执行yum makecache


  • CentOS6.5中使用yum工具安装ipvsadm提示错误:GPG key retrieval failed: [Errno 14] Could not open/read file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

解决方案:

rpm --import /etc/pki/rpm-gpg/RPM*

  • CentOS6.5中安装memcache后启动memcache时提示错误: error while loading shared libraries: libevent-2.0.so.5

解决方案:

ln -s /usr/lib/libevent-2.0.so.5 /lib64/libevent-2.0.so.5

  • CentOS6.5中编译安装PHP时出现报错:
    checking for specified location of the MySQL UNIX socket… no configure: error: Cannot find libmysqlclient under /usr.Note that the MySQL client library is not bundled anymore!

解决方案:

cp -rp /usr/lib64/mysql/libmysqlclient.so.16.0.0 /usr/lib/libmysqlclient.so

  • CentOS6.5中安装Mysql后无法用root帐户远程连接到数据库

解决方案:

调整好iptables后使用GRANT ALL PRIVILEGES ON *.* TO '账号'@'%' IDENTIFIED BY '密码' WITH GRANT OPTION;开启root帐户远程连接数据库即可

  • CentOS6.5中TOMCAT出现内存溢出无法启动TOMCAT(调整TOMCAT默认内存大小)

解决方案:

编辑tomcat安装目录下的bin/catalina.sh文件在cygwin=false一行前加入JAVA_OPTS="-server -Xms800m -Xmx800m -XX:PermSize=256m -XX:MaxPermSize=512m -XX:MaxNewSize=512m"(内存大小可自行设定)

  • CentOS6.5中安装vsftpd服务后登陆测试提示530 Login incorrect

解决方案:

vim /etc/pam.d/vsftpd将文件中的/lib内容修改为/lib64,重启vsftpd服务即可

  • CentOS6.5中对免编译二进制mysql包进行初始化时提示:bad ELF interpreter: No such file or directory

解决方案:

yum install -y mesa-libGL.i686安装后重新初始化即可

  • CentOS6.5中安装了python2.7.x版本后运行python时按方向键与回删键出现乱码

**解决方案:**安装后重新编译安装即可

yum install -y readline readline-devel

  • CentOS7中禁止root用户远程登陆后,用普通用户加sudo执行root权限命令时提示:xxx is not sudoers file.

解决方案:

su root
vim /etc/sudoers
在root  ALL=(ALL)  ALL下添加一行
XXX  ALL=(ALL)  ALL  #XXX代表你的用户名

  • CentOS7.1中编译安装mysql5.6.16在初始化数据库时提示:Can’t locate Data/Dumper.pm in @INC
    解决方案:
yum install -y perl-devel
yum install -y perl-CPAN

  • CentOS7.1中编译安装mysql5.6.16在初始化数据库时提示:Could not find ./bin/my_print_defaults
    解决方案:
./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql

  • CentOS7.1系统中,用ssh远程登陆无法登陆,或者很长时间都卡在提示:
    Connecting to 192.168.14.104:22…
    Connection established.
    To escape to local shell, press ‘Ctrl+Alt+]’.
    解决方案:
vim /etc/ssh/sshd_config
将#UseDNS yes修改为UseDNS no

  • CentOS7.1系统中编译安装某软件时提示:No package ‘glib-2.0’ found
    解决方案:
yum install -y libgnomeui-devel

  • Ubuntu中编译安装faad2解码器时出现报错:
    configure.ac:17: error: possibly undefined macro: AC_PROG_LIBTOOL
    If this token and others are legitimate, please use m4_pattern_allow.
    See the Autoconf documentation
    autoreconf: /usr/bin/autoconf failed with exit status: 1
    **解决方案:**安装后重新编译
apt-get install libtool
apt-get install libsysfs-dev

  • Ubuntu中编译安装ffmpeg时出现报错:ERROR: libopencore_amrnb not found
    解决方案:
apt-get install libx264-dev libxvidcore-dev libopencore-amrwb-dev libopencore-amrnb-dev libfaad-dev libfaac-dev libmp3lame-dev \
libtwolame-dev liba52-0.7.4-dev libcddb2-dev libcdaudio-dev libcdio-cdda-dev libvorbis-dev libopenjpeg-dev

  • CentOS中编译安装ffmpeg时出现报错:ERROR: libopencore_amrnb not found
    解决方案:
下载源码包
http://sourceforge.net/projects/opencore-amr/files/opencore-amr/
tar -zxvf opencore-amr-0.1.5.tar.gz
cd opencore-amr-0.1.5.tar.gz
./configure
make
make install

  • CentOS中编译安装faac编码器时出现报错:
mpeg4ip.h:126: error: new declaration ‘char* strcasestr(const char*, const char*)’
/usr/include/string.h:367: error: ambiguates old declaration ‘const char* strcasestr(const char*, const char*)’
make[3]: *** [3gp.o] Error 1
make[3]: Leaving directory `/home/rexevol/FFMEPG_preinstall_toolkit/faac-1.28/common/mp4v2'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/rexevol/FFMEPG_preinstall_toolkit/faac-1.28/common'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/rexevol/FFMEPG_preinstall_toolkit/faac-1.28'
make: *** [all] Error 2

解决方案:
编辑/usr/local/src/ffmpeg/faac-1.28/common/mp4v2/mpeg4ip.h文件修改如下内容:

从123行开始修改此文件mpeg4ip.h,到129行结束
修改前:
#ifdef __cplusplus
extern "C" {
#endif
char *strcasestr(const char *haystack, const char *needle);
#ifdef __cplusplus
}
#endif

修改后:
#ifdef __cplusplus
extern "C++" {
#endif
const char *strcasestr(const char *haystack, const char *needle);
#ifdef __cplusplus
}
#endif

  • CentOS7中安装MySQL-python模块时报错:
$ python setup.py build
Traceback (most recent call last):
  File "setup.py", line 7, in <module>
    import setuptools
ImportError: No module named setuptools

解决方案:
下载此文件ez_setup.py,运行后自动安装setuptools即可

$ python ez_setup.py

  • CentOS7中用yum工具安装某软件时报错:
error: rpmdb: BDB0113 Thread/process 6165/140518932318016 failed: BDB1507 Thread died in Berkeley DB library
error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db5 -  (-30973)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:

Error: rpmdb open failed

解决方案:

$ rm -f /var/lib/rpm/__db*  #删除缓存文件
$ rpm --rebuilddb  #重建缓存即可

如文章对您有帮助,请打开支付宝扫码领取红包,就当做对作者的支持,谢谢
这里写图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Benson_xuhb

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值