Quick way to add more SWAP space on your server
To check the swap space used you can use “free -m“.
If for some reason you have a server with too little SWAP then there is a quick way to create a swap file and then use it for additional swap space on the server.
dd if=/dev/zero of=/opt/swapfile bs=1024 count=2048000
mkswap /opt/swapfile
swapon /opt/swapfile
swapon -s
And then we need to add the following to the /etc/fstab.
/opt/swapfile swap swap defaults 0 0
How to install or add a package in FreeBSD
To install a Port: (ImageMagick as an example)
cd /usr/ports/graphics/ImageMagick/ && make install clean
If you do not have a source of local packages (such as a FreeBSD CD-ROM set) then it will probably be easier to use the -r option to pkg_add(1). This will cause the utility to automatically determine the correct object format and release and then fetch and install the package from an FTP site.
The example above would download the correct package and add it without any further user intervention.
pkg_info(1) is a utility that lists and describes the various packages installed.
To remove a previously installed software package, use the pkg_delete(1) utility.