官网下载 64位ubuntu
推荐使用方法二
[root@gaojingbo ~]wget http://d1.music.126.net/dmusic/netease-cloud-music_1.1.0_amd64_ubuntu.deb
方法一:alien将此转化为rpm包
[root@localhost ~]# alien -r netease-cloud-music_1.1.0_amd64_ubuntu.deb
netease-cloud-music-1.1.0-2.x86_64.rpm generated
[root@localhost ~]#
[root@localhost ~]# yum -y install netease-cloud-music-1.1.0-2.x86_64.rpm
Error: Package: netease-cloud-music-1.1.0-2.x86_64 (/netease-cloud-music-1.1.0-2.x86_64)
Requires: libQt5Gamepad.so.5(Qt_5_PRIVATE_API)(64bit)
Error: Package: netease-cloud-music-1.1.0-2.x86_64 (/netease-cloud-music-1.1.0-2.x86_64)
Requires: libvlc.so.5()(64bit)
Error: Package: netease-cloud-music-1.1.0-2.x86_64 (/netease-cloud-music-1.1.0-2.x86_64)
Requires: libQt5Gamepad.so.5()(64bit)
Error: Package: netease-cloud-music-1.1.0-2.x86_64 (/netease-cloud-music-1.1.0-2.x86_64)
Requires: libqcef.so.1()(64bit)
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
可以到https://centos.pkgs.org/7/centos-x86_64/gstreamer-plugins-bad-free-0.10.23-20.el7.x86_64.rpm.html这个网站搜索libQt5Gamepad.so.5()(64bit),注意搜索的所有的运行库都是64位的从而解决各种依赖
方法二:[root@gaojingbo ~]ar -vx netease-cloud-music_1.0.0-2_amd64_ubuntu14.04.deb
[root@gaojingbo ~]ls
control.tar.gz data.tar.xz debian-binary
[root@gaojingbo ~]tar -xf data.tar.xz
[root@gaojingbo ~]tar -xf data.tar
将3个文件以及解压后的统一移动到/usr/下管理
[root@gaojingbo ~]cp data.tar /usr/local/src
........
.......
[root@gaojingbo src]# ls
control.tar.gz data.tar.xz gcc-6.1.0 nginx-1.14.0
data.tar debian-binary gcc-6.1.0.tar.bz2 usr
[root@gaojingbo src]# ll -d /usr/local/src/usr/bin/netease-cloud-music
-r--r--r-x 1 martin martin 14222664 Nov 17 2017 /usr/local/src/usr/bin/netease-cloud-musi
错误一:
[root@gaojingbo src]# /usr/local/src/usr/bin/netease-cloud-music
/usr/local/src/usr/bin/netease-cloud-music: error while loading shared libQt5Widgets.so.5: cannot open shared object file: No such file or directory
其中发现有像libQt5Widgets.so.5这样依赖not found的运行库,可以到https://centos.pkgs.org/7/centos-x86_64/gstreamer-plugins-bad-free-0.10.23-20.el7.x86_64.rpm.html这个网站搜索libQt5Widgets.so.5,注意搜索的所有的运行库都是64位的
安装
[root@gaojingbo src]# yum install qt5-qtbase-gui
运行
[root@gaojingbo src]# /usr/local/src/usr/bin/netease-cloud-music
但是在播放歌曲时发现网络设置错误,此时还是无法音乐,这是由于没有安装解码器导致的。
安装streamers解码器
[root@gaojingbo src]#yum -y install gstreamer-ffmpeg
[root@gaojingbo src]#yum -y install gstreamer-plugins-ugly
[root@gaojingbo src]#yum -y install gstreamer-plugins-bad
[root@gaojingbo src]#yum -y install mplayer-gui
[root@gaojingbo src]#yum -y install gstreamer1-libav
等等
..................
错误二:
[root@gaojingbo src]# /usr/local/src/usr/bin/netease-cloud-music
/usr/local/src/usr/bin/netease-cloud-music: error while loading shared libraries: libvlc.so.5: cannot open shared object file: No such file or directory
配置epel源
[root@gaojingbo src]#yum -y install epel-release
配置nux-dextop源
[root@gaojingbo src]# rpm -Uh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
warning: /var/tmp/rpm-tmp.7SEgNu: Header V4 RSA/SHA1 Signature, key ID 85c6cd8a: NOKEY
################################# [100%]
Updating / installing...
################################# [100%]
安装vlc播放器
[root@gaojingbo src]# yum -y install vlc
xvidcore.x86_640:1.3.2-5.el7.nux
zvbi.x86_640:0.2.35-1.el7
Complete!
升级gcc 先卸载已安装好的低版本gcc [http://ftp.gnu.org/gnu/gcc/]
[root@gaojingbo src]wget http://ftp.gnu.org/gnu/gcc/gcc-6.1.0/gcc-6.1.0.tar.bz2
[root@gaojingbo src]tar -xf gcc-6.1.0.tar.bz2
[root@gaojingbo src]cd gcc-6.1.0
[root@gaojingbo gcc-6.1.0]./contrib/download_prerequisites 这个神奇的脚本文件会帮我们下载、配置、安装依赖库,可以节约我们大量的时间和精力
[root@gaojingbo gcc-6.1.0]mkdir gcc-build-6.1.0
[root@gaojingbo gcc-build-6.1.0]cd gcc-build-6.1.0
[root@gaojingbo gcc-build-6.1.0]../configure -enable-checking=release -enable-languages=c,c++ -disable-multilib
[root@gaojingbo gcc-build-6.1.0]make -j4 或者 make
[root@gaojingbo gcc-build-6.1.0]make install
[root@gaojingbo gcc-build-6.1.0]ls /usr/local/bin |grep gcc
重启后
[root@gaojingbo ~]# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-pc-linux-gnu/6.1.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure -enable-checking=release -enable-languages=c,c++ -disable-multilib
Thread model: posix
gcc version 6.1.0 (GCC)
升级gcc,生成的动态库没有替换老版本gcc的动态库
检查动态库
[root@gaojingbo ~]# strings /usr/lib64/libs
Display all 150 possibilities? (y or n)
[root@gaojingbo ~]# strings /usr/lib64/libstdc++.so.6|grep GLIBC
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
..........
查找编译gcc时生成的最新动态库
[root@gaojingbo ~]# find / -name "libstdc++.so*"
/usr/local/src/gcc-6.1.0/gcc-build-6.1.0/stage1-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.22
.........
[root@gaojingbo ~]# cd /usr/lib64
将上面的最新动态库libstdc++.so.6.0.22复制到/usr/lib64目录下
[root@gaojingbo lib64]# cp /usr/local/src/gcc-6.1.0/gcc-build-6.1.0/stage1-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.22 ./
cp: overwrite ‘./libstdc++.so.6.0.22’? y
[root@gaojingbo ~]# cd /usr/lib64
删除原来软连接
[root@gaojingbo lib64]# rm -rf libstdc++.so.6
将默认库的软连接指向最新动态库
[root@gaojingbo lib64]# ln -s libstdc++.so.6.0.22 libstdc++.so.6
运行以下命令检查动态库
[root@gaojingbo lib64]# strings /usr/lib64/libstdc++.so.6 | grep GLIBC
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21
可以看到 输出有"GLIBCXX_3.4.21" 了
运行后
[root@gaojingbo src]# /usr/local/src/usr/bin/netease-cloud-music
08-11, 13:43:37 [Error ] [ 0] Media changed
08-11, 13:43:37 [Error ] [ 0] Player opening
08-11, 13:45:00 [Error ] [ 0] void netease::AudioPlayer::handleMediaStatusChanged(netease::VlcMediaPlayer::MediaStatus) Invalid Media: "190249_7_-bitrate-192-q8rzT4"
也可以参考此文档
http://blog.sina.com.cn/s/blog_c02dc1fa0102xkb0.html
“`