Install freebsd dependencies correctly and ensure /opt exists