I see your worries if you haven't tested that before. I'm from the Windows world and rather new to Linux
so I was surprised how "simple" the Linux
world is in this respect.
Linux seems to be made for straight forward compiling.
Follow all instructions on my link to Opencpn.org above. Copy/Past all, sometimes very long, commands to avoid typos.
(To paste it in the command window type: Shift+insert instead of Ctrl+V, or right mouse button)
But I could serve you a ready OpenCPN......deb package if you not like to give it a try. But you can't destroy anything. Whatever you do in this system set up, e.g. nothing else yet installed, can be undone by hold the shift key during next reboot and reinitialize the system. As simple as that! I've tried that shift key a couple of times.