Occasionally this may be useful.
Acquire a root shell via sudo su - root then copy and paste the lines
below en-masse. It is basically a script.
cd ~/Downloads
curl -L -o firefox.dmg "https://download.mozilla.org/?product=firefox-latest&os=osx&lang=en-US"
hdiutil attach firefox.dmg
rm -rf /Applications/Firefox.app
sleep 2
ditto /Volumes/Firefox/Firefox.app /Applications/Firefox.app
rm -f firefox.dmg
hdiutil detach /Volumes/Firefox