GParted - Cannot open display [duplicate]

Solution 1:

Your problem seems related to the wayland, run:

xhost +local:

it lets local users to connect to the display, then run gparted:

gparted-pkexec

it should solve the problem.

source