Install aria2 1.34.0 or 1.35.0 on CentOS 7

Spread the love

I have created a rpm with latest source of aria2. This rpm is built for centos 7. You can download the latest rpm from link below:

Version: 1.35

Version: 1.34

gpgcheck have to be turned off because rpm is not signed. Run following command to install aria2 :

Install the rpm using:

yum --nogpgcheck localinstall aria2-1.35.0-0.x86_64.rpm
yum --nogpgcheck localinstall aria2-1.34.0-0.x86_64.rpm

How I did that? Means, how I created the RPM file. Well, It took me 5 to 6 hours as I didn’t know how to create a rpm. But You can do it within an hour. If you are a user and just want to use aria2 then don’t go further and if you want to know more then keep reading.

First we need to setup the development environment. So run following commands in fresh installation of centOS:

yum -y install epel-release

yum -y update

yum groupinstall "Development Tools" "Server Platform Development" "Additional Development" "Compatibility libraries"

yum -y install nettle-devel libssh2-devel c-ares-devel libxml2-devel zlib-devel sqlite-devel pkgconfig

yum -y install rpm-build rpmdevtools

After that we need to have directories where our spec file and source will be stored. Spec file contains the instructions for rpmbuild tool. To create directories run following command:


The directories will be created inside /root/rpmbuild directory

Download the source (tar.gz) from github in /root/rpmbuild/SOURCES e.g.:

Navigate to /root/rpmbuild/SPECS directory and create a spec file with following content:

Name: aria2
Version: 1.34.0
Release: 0
Summary: aria2 is a lightweight multi-protocol & multi-source command-line download utility
Group: Applications/Multimedia
License: GPL
Vendor: Aria2
Prefix: %{_prefix}
Packager: Your Name
BuildRoot: %{_tmppath}/%{name}-root
aria2 is a lightweight multi-protocol & multi-source command-line download utility. It supports HTTP/HTTPS, FTP, SFTP, BitTorrent and Metalink. aria2 can be manipulated via built-in JSON-RPC and XML-RPC interfaces.

%setup -q -n %{name}-%{version}
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{_prefix} --mandir=%{_mandir} --sysconfdir=/etc


[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/%{name}
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
%config(noreplace) /usr/bin/aria2c

As you may have guessed, there is metadata about installation in spec file. It is a very simple spec file. This file can be further edited for more complex installation. Now run the following command to start building the rpm

rpmbuild -ba yourfile.spec

Change the yourfile.spec with the name of your spec file name

If everything goes as expected, then your rpm will be in /root/rpmbuild/RPMS/x86_64 directory.

There may be error like:

/var/tmp/rpm-tmp.ZykaOR: line 30: $'make\r': command not found

This is because of line endings mix up of windows and Linux. So the solution is to copy the file contents in vi editor or “cat >> yourfile.spec” (to close and save press “ctrl+d” two time)