一、安装aria2

 [root@192-168-7-77 ~]# wget https://github.com/aria2/aria2/releases/download/release-1.33.1/aria2-1.33.1.tar.bz2
[root@--- ~]# yum -y install bzip2
[root@--- ~]# bzip2 -d aria2-1.33..tar.bz2
[root@--- ~]# tar xf aria2-1.33..tar
[root@--- ~]# cd aria2-1.33./
[root@--- ~/aria2-1.33.]# ./configure --prefix=/usr/local/aria2
[root@--- ~/aria2-1.33.]# make && make install
[root@--- ~]# tail - /etc/profile
export PATH=$PATH:/usr/local/aria2/bin
[root@--- ~]# source /etc/profile

二、解决报错问题

[root@--- ~/]# tar -jxv -f aria2-1.33..tar.bz2
tar (child): bzip2: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status
tar: Error is not recoverable: exiting now
# gcc-c++版本过底,需要gcc >= 4.8. [root@--- ~//aria2-1.33.]# ./configure --prefix=/usr/local/aria2
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.20... yes
checking whether g++ supports C++ features by default... no
checking whether g++ supports C++ features with -std=c++ ... no
checking whether g++ supports C++ features with -std=c++ -stdlib=libc++... no
checking whether g++ supports C++ features with -std=c++0x ... yes
checking whether the c++ compiler supports nullptr... configure: error: in `/usr/local/src/aria2-1.33.':
configure: error: C++ compiler does not understand nullptr, perhaps C++ compiler is too old. Try again with new one (gcc >= 4.8. or clang >= 3.4)
See `config.log' for more details
[root@192-168-7-77 aria2-1.33.]# rpm -qa | grep gcc-c++
gcc-c++-4.4.-.el6.x86_64 # 需要将gcc升级到4.8.2
[root@--- ~]# cd /usr/local/src/
[root@--- src]# wget http://ftp.gnu.org/gnu/gcc/gcc-4.8.2/gcc-4.8
[root@--- src]# tar xf gcc-4.8..tar.bz2
[root@--- src]# cd gcc-4.8./ # 运行自带脚本,完成下载、配置、安装依赖库,可以节约我们大量的时间和精力
[root@--- gcc-4.8.]# ./contrib/download_prerequisites # 建立一个目录供编译出的文件存放
[root@--- gcc-4.8.]# mkdir gcc-build-4.8.
[root@--- gcc-4.8.]# cd gcc-build-4.8. # 生成makefile文件
[root@--- gcc-build-4.8.]# ../configure -enable-checking=release -enable-languages=c,c++ -disable-multilib
# 编译(很耗时,-j4对多核处理器的优化)
[root@--- gcc-build-4.8.]# make -j4
[root@--- gcc-build-4.8.]# make install # 验证是否成功,如果还是显示原来的版本,则需要重启系统
[root@--- ~]# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.8./lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure -enable-checking=release -enable-languages=c,c++ -disable-multilib
Thread model: posix
gcc version 4.8. (GCC)

三、配置aria2

05-11 23:01