History provides enough examples of failed missions due to software failure. If the mission system is still physically intact (ISS best example but very close to Earth making the examole maybe less challengung), do they provide "update and reboot" nowadays? How is this done, are there regular updates as well? To narrow the scope of the question: what are examples more on that (specs), if they exist? Doubt there is an "apt get" our there?
Nearly all, if not all, modern spacecraft are designed to accept software updates. Updates are done often to enhance capability and to work around failures of hardware.
As to how its done, after extensive testing on the ground either a patch or a complete new copy of the flight software is uploaded to the spacecraft. The upload is carefully verified. Then the patch is applied or the vehicle reboots to the new image. There is always a safeguard in place, where for example either the previous image or a golden image is kept on board, which is automatically rebooted to in the event of a fatal software error in the new or patched load.