Ubuntu harddisk formatting failed

Try this:

sudo apt-get install gdisk

This works because, while the error message the OP cited says a number of things, the key part is:

Failed to execute child process "sgdisk" (No such file or directory)

So, assuming the issue is that sgdisk is not installed, it can be installed via the gdisk package. It worked for me.