Okular does not open PDF in firefox but gimp opens PDF

Okular does not open PDF in firefox but gimp opens PDF ubuntu
##
#
# The file /usr/share/applications/mimeinfo.cache has gimp in PDF
# This is due to the fact gimp.desktop as pdf as supported action
# Remove action PDF from a local-temporary gimp.desktop and copy it to the location
cp /root/gimp.desktop /usr/share/applications/gimp.desktop
chmod 644 /usr/share/applications/gimp.desktop
### You may have to run
# update-desktop-database
# to update the mime-types in the file /usr/share/applications/mimeinfo.cache
## To check
## xdg-mime query default application/pdf
## the above must return okular as default
## If not set it as xdg-mime default okular.desktop application/pdf
####
## local user specific defaults are written to
## ~/.local/share/applications/mimeapps.list


Put the above to /etc/rc.local