CentOS因缺少libjpeg安装PHP7.4失败,yum服务异常:rpmdb open failed centos 7

今天装短链接cms:YOURLS-1.9.1,提示需要PHP7.4以上:

致命错误:Composer 在您的平台中检测到问题:您的 Composer 依赖项需要 PHP 版本 ">= 7.4.0"。您正在运行 7.2.33。在/www/wwwroot/d.xxx.cn/includes/vendor/composer/platform_check.php24行

安装php7.4时,显示安装成功,但是却没装上。

赶紧查看下执行日志吧,找到关键信息:

1
2
3
4
5
6
7
8
9
10
No package 'libjpeg' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables JPEG_CFLAGS
and JPEG_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
make: *** No targets specified and no makefile found.  Stop.
make: *** No rule to make target `install'.  Stop.

原因很明确了,需要安装libjpeg包。

于是连上ssh,执行安装命令:

1
yum install libjpeg libjpeg-devel

居然安装失败,提示:rpmdb open failed centos 7

多半是因为rpm数据库出现损坏所致,此错误可能导致多数(甚至是所有的)rpm软件的升级、安装甚至是删除都会出现问题。

[root@www rpm]rm -f __db.*     # 清除原rpmdb文件
[root@www rpm]rpm --rebuilddb     # 重建rpm数据库
[root@www rpm]yum clean all     # 清除所有yum的缓存
装好libjpeg,再安装PHP7.4就OK了

暂无评论

发表评论

您的电子邮件地址不会被公开,必填项已用*标注。

相关推荐