linux 多线程 下载 aria2

aria2c -x 16 [url]

1 编译安装

升级 gcc

Aria2 1.17.1以上版本要求gcc >= 4.8.3 or clang >= 3.4
以下选择编译升级gcc(需要3个小时左右)
可以选择其他方式升级gcc https://www.vpser.net/manage/centos-6-upgrade-gcc.html

yum -y install openssl openssl-devel
gcc yum 升级

https://www.vpser.net/manage/centos-6-upgrade-gcc.html

gcc源码升级
wget http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-5.2.0/gcc-5.2.0.tar.bz2
tar -xf gcc-5.2.0.tar.bz2
cd gcc-5.2.0
./contrib/download_prerequisites
mkdir gcc-temp
cd gcc-temp
../configure --enable-checking=release --enable-languages=c,c++ --disable-multilib
make -j4
make install
ls /usr/local/bin | grep gcc
/usr/sbin/update-alternatives --install  /usr/bin/gcc gcc /usr/local/bin/x86_64-unknown-linux-gnu-gcc-5.2.0 52
gcc -v
find / -name "libstdc++.so*"
cp /root/gcc-5.2.0/gcc-temp/stage1-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.21 /usr/lib64
cd /usr/lib64
rm -rf libstdc++.so.6
ln -s libstdc++.so.6.0.21 libstdc++.so.6
strings /usr/lib64/libstdc++.so.6 | grep GLIBC
安装clang

安装 epel源 https://www.jianshu.com/p/25fb13dc2589

yum -y install clang
安装Aria2

最新地址下载 https://github.com/aria2/aria2/releases

wget https://github.com/aria2/aria2/releases/download/release-1.35.0/aria2-1.35.0.tar.bz2
tar xf aria2-1.35.0.tar.bz2
cd aria2-1.35.0
./configure
make -j4
make install

yum 安装(版本过低)

yum 安装 rpmforge-release 源
yum -y install http://ftp.tu-chemnitz.de/pub/linux/dag/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
yum -y install aria2

如下报错

06/05 13:49:16 [ERROR] CUID#6 - Download aborted. URI=https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-community-server-8.0.16-2.el6.x86_64.rpm
Exception: [AbstractCommand.cc:304] errorCode=1 URI=https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-community-server-8.0.16-2.el6.x86_64.rpm
  -> [SocketCore.cc:1128] errorCode=1 Certificate verification failed. Cause:  `not signed by known authorities or invalid' `issuer is not known' See --ca-certificate and --check-certificate option.

06/05 13:49:16 [NOTICE] Download GID#b9691ccc08bcb68f not complete: 

Download Results:
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================
b9691c|ERR |       0B/s|https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-community-server-8.0.16-2.el6.x86_64.rpm

Status Legend:
(ERR):error occurred.

aria2 will resume download if the transfer is restarted.
If there are any errors, then see the log file. See '-l' option in help/man page for details.

解决方案

 aria2c -x 10 --check-certificate=false [url]

你可能感兴趣的:(linux 多线程 下载 aria2)