The old MacBook Pros have a defective AMD Radeon GPU. Mine was from 2011. The solution for Apple was to replace the entire motherboard and I had it replaced 2 times for free. The replaced motherboards had the same defective components, and it was always a matter a time before a new failure happened.
Now my MacBook Pro 2011 is not supported anymore by Apple, so no more hardware fixes and software updates. Fortunately, I have found a solution. You need to bypass the GPU and disable it, by removing a resistor in the motherboard.
I have followed the article at the link below to solve the problem.
Some more detailed information on how to disable the GPU is here. I had to change one command line.
Instead of this line
`printf "x07x00x00x00x01x00x00x00" > /sys/firmware/efi/efivars/gpu-power-prefs-fa4ce28d-b62f-4c99-9cc3-6815686e30f9`
I used this line
printf "\x07\x00\x00\x00\x01\x00\x00\x00" > /sys/firmware/efi/efivars/gpu-power-prefs-fa4ce28d-b62f-4c99-9cc3-6815686e30f9
And I have happily installed Ubuntu