1. Enable Linux compatibility
This can be enabled by loading the Linux kernel module kldload linux and kldload linux64 for 64-bit compatibility. To check if it is really loaded see the output for kldstat.
Add below to vi /etc/rc.conf
linux_enable="YES"
Some linux programs need linprocfs to be mounted on /compat/linux/proc. This can be done by adding below to vi /etc/fstab
linprocfs /compat/linux/proc linprocfs rw 0 0
Some linux programs need linsysfs to be mounted on /compat/linux/sys. This can be done by adding below to vi /etc/fstab
linsysfs /compat/linux/sys linsysfs rw 0 0
Some linux programs need tmpfs to be mounted on /compat/linux/dev/shm. This can be done by adding below to vi /etc/fstab
tmpfs /compat/linux/dev/shm tmpfs rw,mode=1777 0 0
First install rpm4
pkg install rpm4
Then, got to cd /compat/linux and then
rpm2cpio < /path/to/linux.archive.rpm | cpio -id