Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to achieve FreeBSD ports acceleration

Shulou Source: shulou.com Published: 2022-05-31 13:43:57 09月21日 Update

How to achieve FreeBSD ports acceleration, I believe that many inexperienced people do not know what to do, so this paper summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

Because ports is downloaded with a single thread by default, no matter how good your network is, the speed is so slow that you can't take advantage of your high bandwidth at all. So we need to use wget or axel software to provide multithreaded downloads.

Since I was transferred by a linux user, I am familiar with wget. Today, we just use wget to speed up the download.

First, install wget

Freebsd does not have wget installed by default, so we need to install it ourselves, as follows.

[root@fb / etc] # whereis wget\\ find the location of wget

Wget:/usr/ports/ftp/wget

[root@fb / etc] # cd / usr/ports/ftp/wget

[root@fb / usr/ports/ftp/wget] # make install clean\\ compile and install wget. As it is a tool, we do not need to add any parameters. The default is fine.

After the installation is complete, look for it with whereis wget

[root@fb / usr/ports/ftp/wget] # whereis wget

Wget: / usr/local/bin/wget / usr/local/man/man1/wget.1.gz / usr/ports/ftp/wget

You will find that there is already an execution file for wget. At this point the wget installation is complete

Second, let ports call wget download tool.

Modify / etc/make.conf with a text editor that you are familiar with, and the content is as follows

[root@fb / usr/ports/ftp/wget] # cat / etc/make.conf

# added by use.perl 2009-12-08 05:34:56

PERL_VERSION=5.8.9

FETCH_CMD=wget-c-t 1

DISABLE_SIZE=yes

The wget-c parameter means that the breakpoint resume function is turned on, and-t is the number of retries to connect.

If you want wget to traverse the proxy server, you need to add the following two lines

FETCH_ENV=http_proxy= http://proxy.isadba.com:3128\\ http proxy

FETCH_ENV=ftp_proxy= http://proxy.isadba.com:3128\\ ftp proxy

\\ proxy.isadba.com is the proxy server 3128 is the port

With axel downloads, because axel is a tool that supports multithreaded downloads, the download speed is better than wget.

First, install axel

[root@fb ~] # whereis axel

Axel: / usr/ports/ftp/axel

[root@fb ~] # cd / usr/ports/ftp/axel/

[root@fb / usr/ports/ftp/axel] # make install clean

II. Modify / etc/make.conf

FETCH_CMD=axel-n 10

If you want axel to traverse the proxy server, you need to add the following two lines

FETCH_ENV=http_proxy= http://proxy.isadba.com:3128\\ http proxy

FETCH_ENV=ftp_proxy= http://proxy.isadba.com:3128\\ ftp proxy

After completing the above work, you can try to install the software using ports, which should be much faster.

After reading the above, have you mastered how to achieve FreeBSD ports acceleration? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Tags: Agents content tools servers threads speed services parameters methods more software problems penetration necessity helplessness download tools advantages locations functions Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info MySQL OPPO Reno Shulou Technology vpn