Partition Type: FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF appeared when tried to remove Linux(UBUNTU 18.04) from dual boot from Mac

Solution 1:

  1. Remove the second and the third partition:

    gpt remove -i 3 /dev/disk0
    gpt remove -i 2 /dev/disk0
    
  2. Add the (former) second partiton with the proper size and partition type:

    gpt add -i 2 -b 409640 -s 461916744 -t apfs /dev/disk0
    
  3. Check disk0 and the resulting synthesized APFS container scheme with diskutil:

    diskutil list #get the deviceID of the APFS container scheme
    diskutil verifyDisk disk0
    diskutil verifyVolume diskX #diskX: deviceID of the APFS container scheme
    

Assuming you want to resize the APFS container to the full size of the disk (500 GB) you have to enter:

diskutil apfs resizeContainer disk0s2 0