8月份的CentOS 7报错与解决(NodeJS与其他种种的安装失败

今天把所有VPS重做了一遍,用了CentOS,照例需要安装NodeJS,也需要编译Shadowsocks。然而不管什么全都不顺利,诸如kmod-nvidia-340xx缺少依赖,NodeJS缺少http_parser等等。

通过查询,发现是因为RHEL在最近发布了EHRL 7.4的源码。对其中源内对应的软件包做了一些更改,导致部分软件包被移除,而CentOS,理应从CentOS 7.3对应升级到7.4,却还处于CR(持续更新)状态。官方8月4日文章表示三周左右CentOS 7.4会加入正式源,然而在9月1日的今天,还处于CR状态,于是要想解决,只能是加入CR源了。

并非所有人都适合开启CR源,像我这种机器里只有Shadowsocks的家伙,自然也就无所谓了。

#首先需要安装yum-utils

yum install yum-utils -y

#通过yum-utils开启CR源

yum-config-manager --enable cr

#使用yum更新整个OS

yum update

#可选重启

reboot

完成后再次尝试安装NodeJS,就不会出现报错了。

[root@test02ss ~]# yum install nodejs
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.nethub.com.hk
* elrepo: hkg.mirror.rackspace.com
* epel: ftp.cuhk.edu.hk
* extras: repo.virtualhosting.hk
* updates: centos.nethub.com.hk
Resolving Dependencies
--> Running transaction check
---> Package nodejs.x86_64 1:6.11.1-1.el7 will be installed
--> Processing Dependency: npm = 1:3.10.10-1.6.11.1.1.el7 for package: 1:nodejs-6.11.1-1.el7.x86_64
--> Processing Dependency: libuv >= 1:1.9.1 for package: 1:nodejs-6.11.1-1.el7.x86_64
--> Processing Dependency: http-parser >= 2.7.0 for package: 1:nodejs-6.11.1-1.el7.x86_64
--> Processing Dependency: libuv.so.1()(64bit) for package: 1:nodejs-6.11.1-1.el7.x86_64
--> Processing Dependency: libicuuc.so.50()(64bit) for package: 1:nodejs-6.11.1-1.el7.x86_64
--> Processing Dependency: libicui18n.so.50()(64bit) for package: 1:nodejs-6.11.1-1.el7.x86_64
--> Processing Dependency: libicudata.so.50()(64bit) for package: 1:nodejs-6.11.1-1.el7.x86_64
--> Processing Dependency: libhttp_parser.so.2()(64bit) for package: 1:nodejs-6.11.1-1.el7.x86_64
--> Running transaction check
---> Package http-parser.x86_64 0:2.7.1-1.el7 will be installed
---> Package libicu.x86_64 0:50.1.2-15.el7 will be installed
---> Package libuv.x86_64 1:1.10.2-1.el7 will be installed
---> Package npm.x86_64 1:3.10.10-1.6.11.1.1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================================================================================================================
Installing:
nodejs x86_64 1:6.11.1-1.el7 epel 4.5 M
Installing for dependencies:
http-parser x86_64 2.7.1-1.el7 cr 27 k
libicu x86_64 50.1.2-15.el7 base 6.9 M
libuv x86_64 1:1.10.2-1.el7 epel 109 k
npm x86_64 1:3.10.10-1.6.11.1.1.el7 epel 2.5 M

Transaction Summary
=============================================================================================================================================================================================================================================
Install 1 Package (+4 Dependent packages)

Total download size: 14 M
Installed size: 50 M
Is this ok [y/d/N]: y
Downloading packages:
(1/5): libicu-50.1.2-15.el7.x86_64.rpm | 6.9 MB 00:00:01
(2/5): libuv-1.10.2-1.el7.x86_64.rpm | 109 kB 00:00:01
(3/5): nodejs-6.11.1-1.el7.x86_64.rpm | 4.5 MB 00:00:01
(4/5): npm-3.10.10-1.6.11.1.1.el7.x86_64.rpm | 2.5 MB 00:00:00
(5/5): http-parser-2.7.1-1.el7.x86_64.rpm | 27 kB 00:00:04
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 2.8 MB/s | 14 MB 00:00:05
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : http-parser-2.7.1-1.el7.x86_64 1/5
Installing : 1:libuv-1.10.2-1.el7.x86_64 2/5
Installing : libicu-50.1.2-15.el7.x86_64 3/5
Installing : 1:npm-3.10.10-1.6.11.1.1.el7.x86_64 4/5
Installing : 1:nodejs-6.11.1-1.el7.x86_64 5/5
Verifying : libicu-50.1.2-15.el7.x86_64 1/5
Verifying : 1:libuv-1.10.2-1.el7.x86_64 2/5
Verifying : http-parser-2.7.1-1.el7.x86_64 3/5
Verifying : 1:nodejs-6.11.1-1.el7.x86_64 4/5
Verifying : 1:npm-3.10.10-1.6.11.1.1.el7.x86_64 5/5

Installed:
nodejs.x86_64 1:6.11.1-1.el7

Dependency Installed:
http-parser.x86_64 0:2.7.1-1.el7 libicu.x86_64 0:50.1.2-15.el7 libuv.x86_64 1:1.10.2-1.el7 npm.x86_64 1:3.10.10-1.6.11.1.1.el7

Complete!

发表评论

%d 博主赞过: