Update FreeBSD Using Proxy Server (csup / portsnap proxy update)

Question: How do I upgrade my FreeBSD server and ports tree using our proxy server, which requires username and password based authentication?

Answer: You have various choice under FreeBSD.

Use http_proxy shell variable

Linux / UNIX has environment variable called http_proxy. It allows you to connect text based session / application via the proxy server (bash compatible shell export syntax):
export http_proxy='http://user:password@server.ip.address:port/'
export http_proxy='http://vivek:myPassword@'

Now, you can run portsnap ports update utility or csup command easily:
# portsnap fetch update
# csup /path/to/supfile

prtunnel tunnels

If above method failed use prtunnel to set tunnels. It is a TCP connection through to a remote server using an HTTP or SOCKS5 proxy. It is useful if you are behind a proxy and want to use a program that doesn’t have native proxy support.

Install prtunnel tunnel proxy software

First, get access via proxy, enter:
# export http_proxy='http://user:password@'
Type the following command to install :
# cd /usr/ports/net/prtunnel
# make install clean

How do I use prtunnel?

Type the command as follows:
# prtunnel --password-prompt -t http -H -P 3128 -D 5999 cvsup1.FreeBSD.org 5999
It will prompt for proxy username and password. If you do not wish, prompt try as follows:
# prtunnel -u 'username' -p 'myPassword' -t http -H -P 3128 -D 5999 cvsup1.FreeBSD.org 5999
Once connected, open supfile:
# vi /path/to/supfile
And set default host to *default host=
*default host=localhost
*default host=
Save and close the file. After starting prtunnel like this, you could then point supfile to, and prtunnel will attempt to connect you to cvsup1.FreeBSD.org via the HTTP proxy server on a system named “” with given username and password. Now run csup, enter:
# csup /path/to/supfile

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 1 comment so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
1 comment… add one
  • Olaf Mar 24, 2010 @ 12:22

    I do not think that csup honors these proxy variables. :-(

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum