# How can I set aria2 for download ports



## MHA152 (Aug 13, 2013)

Hello 

I want to use Aria 2 instead of fetch. I use these two lines in /etc/make.conf but it gives me some errors:

```
FETCH_BINARY=/usr/local/bin/aria2c
FETCH_ARGS="-c -s16 -x16 -k1M"
```

Should I use some more arguments?


----------



## cpm@ (Aug 16, 2013)

Add these lines to your /etc/make.conf

```
FETCH_CMD=aria2c
FETCH_BEFORE_ARGS=-s4 -k1M --continue=true
DISABLE_SIZE=yes
```

Note that using the above options are enough to suit your needs. Other alternatives to download ports simultaneously with multiple connections are ftp/axel and ftp/wget.


----------



## MHA152 (Aug 16, 2013)

Thank you. What does the third line do?


----------



## cpm@ (Aug 16, 2013)

MHA152 said:
			
		

> What does the third line do?



According to /usr/ports/Mk/bsd.port.mk

```
# DISABLE_SIZE  - Do not check the size of a distfile even if the SIZE field
#                 has been specified in distinfo.  This is useful
#                 when using an alternate FETCH_CMD.
```

In other words, defining the DISABLE_SIZE macro in the /etc/make.conf will disable the *-S* argument to FETCH_CMD. See the fetch(1) manpage for details.


----------



## MHA152 (Aug 16, 2013)

Thanks for helping me to solve*.*


----------



## MHA152 (Aug 16, 2013)

I try to upgrade my installed ports but there is a problem with do-fetch, I think I need some more arguments?


----------



## cpm@ (Aug 16, 2013)

Please, be more explicit. Can you show the error declared or some related output?


----------



## MHA152 (Aug 17, 2013)

OK the error is this:

```
=> Attempting to fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/xorg/lib/libX11-1.6.1.tar.bz2
Exception: [AbstractOptionHandler.cc:69] errorCode=28 We encountered a problem while processing the option '--continue'.
  -> [OptionHandlerImpl.cc:96] errorCode=1 continue must be either 'true' or 'false'.
Usage:
 -c, --continue[=true|false]  Continue downloading a partially downloaded
                              file. Use this option to resume a download
                              started by a web browser or another program
                              which downloads files sequentially from the
                              beginning. Currently this option is only
                              applicable to http(s)/ftp downloads.

                              Possible Values: true, false
                              Default: false
                              Tags: #basic, #http, #ftp
=> Couldn't fetch it - please try to retrieve this
=> port manually into /usr/ports/distfiles//xorg/lib and try again.
*** [do-fetch] Error code 1

Stop in /usr/ports/x11/libX11.

===>>> make failed for x11/libX11
===>>> Aborting update

===>>> Update for x11/libX11 failed
===>>> Aborting update

===>>> Killing background jobs
Terminated
```


----------



## wblock@ (Aug 17, 2013)

Remove 
	
	



```
FETCH_ARGS="-c -s16 -x16 -k1M"
```
 from make.conf, or at least remove the -c option.


----------



## MHA152 (Aug 19, 2013)

I changed 
	
	



```
FETCH_BEFORE_ARGS
```
 to 
	
	



```
FETCH_ARGS
```
 and now ports work correctly*.*

Thanks*.*


----------

