Fix incorrect path of the resource.cfg file which causes apt upgrade issues.
Make sure the nagios package is installed before copying any config file.