To flash an RPKG file on the Nokia 5800, you can use tools like:

Ensure you have backed up all your data. Flashing a ROM will erase all data on the device.

Two tools dominated the Symbian flashing scene:

nokia 5800 rom rpkg