简介:axel是linux下一款类似于迅雷的多进程下载工具,可断点继传,非常好用
到官网下载源码安装包
http://axel.sourcearchive.com/,到里面点击自己想要的版本后面的download即可下载,并上传到rhel6 一个目录下,这里是/root目录下,下载的文件名为axel_2.4.orig.tar.gz。
安装axel
进入到axel软件目录下,解压软件压缩包
[root@test ~]# cd /root
[root@test ~]# ls
axel_2.4.orig.tar.gz
[root@test ~]# tar xf axel_2.4.orig.tar.gz
[root@test ~]# ^C
[root@test ~]# ls
axel-2.4 axel_2.4.orig.tar.gz
[root@test ~]# cd axel-2.4/
[root@test axel-2.4]#
在这里面查看帮助文件,或者直接运行 ./configure --help
[root@test axel-2.4]# ./configure --help
Axel configure
Usage: ./configure [OPTIONS]
Option Description Default
--prefix=... Directories to put files in /usr/local 自定义安装目录
--bindir=... $prefix/bin
--etcdir=... $prefix/etc 自定义配置文件位置
--mandir=... $sharedir/man
--locale=... $sharedir/locale
--i18n=0/1 Disable/enable internationalization 1
--debug=0/1 Disable/enable debugging 0
--strip=0/1 Disable/enable binary stripping 1
3.开始编译安装
首先查看编译环境是否安装
yum grouplist |grep "Server Platform Development" && yum group list "Development tools".
可以使用 yum groupinstall "Server Platform Development" "Development tools" 进行安装
[root@test axel-2.4]# ./configure --prefix=/usr/local/axel --etcdir=/etc/axel
The strip option is enabled. This should not be a problem usually, but on some
systems it breaks stuff.
Configuration done:
Internationalization enabled.
Debugging disabled.
Binary stripping enabled.
[root@test axel-2.4]# make
gcc -c axel.c -o axel.o -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Os
gcc -c conf.c -o conf.o -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Os
gcc -c conn.c -o conn.o -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Os
gcc -c ftp.c -o ftp.o -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Os
gcc -c http.c -o http.o -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Os
gcc -c search.c -o search.o -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Os
gcc -c tcp.c -o tcp.o -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Os
tcp.c: In function ‘get_if_ip’:
tcp.c:98: warning: dereferencing pointer ‘x’ does break strict-aliasing rules
tcp.c:97: note: initialized from here
gcc -c text.c -o text.o -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Os
gcc *.o -o axel -lpthread
strip axel
msgfmt -vo nl.mo nl.po
40 translated messages, 6 fuzzy translations, 4 untranslated messages.
msgfmt -vo de.mo de.po
46 translated messages, 4 fuzzy translations.
msgfmt -vo ru.mo ru.po
46 translated messages, 2 fuzzy translations, 2 untranslated messages.
msgfmt -vo zh_CN.mo zh_CN.po
42 translated messages, 6 fuzzy translations, 2 untranslated messages.
[root@test axel-2.4]# make install
mkdir -p /usr/local/axel/bin/
cp axel /usr/local/axel/bin/axel
mkdir -p /etc/axel/
cp axelrc.example /etc/axel/axelrc
mkdir -p /usr/local/axel/share/man/man1/
cp axel.1 /usr/local/axel/share/man/man1/axel.1
mkdir -p /usr/local/axel/share/man/zh_CN/man1/
cp axel_zh_CN.1 /usr/local/axel/share/man/zh_CN/man1/axel.1
Installing locale files...
4.配置命令执行环境PATH,用文本编辑器(vim、gpedit)在/etc/profile.d/目录下创建执行文件,这里为axel.sh,在里面添加内容为:
PATH=/usr/local/axel/bin:$PATH
export PATH
[root@test bin]# vim /etc/profile.d/axel.sh
[root@test bin]# . /etc/profile.d/axel.sh #使环境变量生效
现在就可以执行命令下载东西啦
[root@test ~]# axel -n 10 http://mirrors.163.com/centos/6/isos/x86_64/CentOS-6.7-x86_64-netinstall.iso
Initializing download: http://mirrors.163.com/centos/6/isos/x86_64/CentOS-6.7-x86_64-netinstall.iso
File size: 241172480 bytes
Opening output file CentOS-6.7-x86_64-netinstall.iso
Starting download
[ 0%] .......... .......... .......... .......... .......... [ 199.7KB/s]
[ 0%] .......... .......... .......... .......... .......... [ 333.6KB/s]
[ 0%] .......... .......... .......... .......... .......... [ 428.0KB/s]
[ 0%] .......... .......... .......... .......... .......... [ 444.3KB/s]
[ 0%] .......... .......... .......... .......... .......... [ 494.1KB/s]
[ 0%] .......... .......... .......... .......... .......... [ 566.0KB/s]
[ 0%] .......... .......... .......... .......... .......... [ 604.0KB/s]
[ 0%] .......... .......... .......... .......... .......... [ 667.4KB/s]
[ 0%] .......... .......... .......... .......... .......... [ 725.4KB/s]
[ 0%] .......... .......... .......... .......... .......... [ 780.8KB/s]
[ 0%] .......... .......... .......... .......... .......... [ 826.4KB/s]
[ 0%] .......... .......... .......... .......... .......... [ 868.9KB/s]
[ 0%] .......... .......... .......... .......... .......... [ 895.9KB/s]
转载于:https://blog.51cto.com/feilongbcd/1764069