Ports: Offline Upgrades & Installs

[img_assist|fid=55|thumb=1|alt=Daemon]

Sometime back there was a discussion at the BSD-INDIA mailing list on offline port upgrades and installs. Here's my take on that issue -

> It is normal to upgrade or install the ports when online. However, when
> one doesn't have an Internet connection and has to depend on offline
> downloaded files, how do we apply the upgrades or installs?

If you want to build from source without an internet connection, you must get the tar balls prior to the installation and put it in the distfiles directory (usually, /usr/ports/distfiles). Alternatively, you can set the "CD_MOUNTPTS" environment variable to a list of CDROM mount points to look for the distfiles. I haven't tried the latter method, you might want to check out (/usr/ports/Mk/bsd.port.mk). If you want to install from pre-compiled packages, all you need to do is,

$ pkg_add -v package.tbz

Check out pkg_add(1). Set PKG_PATH environment variable to the list of direcotries where the packages are located. Sometimes portupgrade(1), portinstall(1) can be more useful. They are extensively documented in the man pages.

If the idea is to save your time spent online, what you can do is go to the ports directory and do a recursive fetch, which will fetch all the distfiles for that port and its dependencies recursively, without building.

$ cd /usr/ports/cat/port && make fetch-recursive

Then, you may disconnect and build. You can also fetch packages recursively, see portinstall(1).