diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py
index 73aaca0..a7b41ce 100644
--- a/bitbake/lib/bb/command.py
+++ b/bitbake/lib/bb/command.py
@@ -160,6 +160,13 @@ class CommandsSync:
         value = params[1]
         command.cooker.configuration.data.setVar(varname, value)

+    def delVariable(self, command, params):
+        """
+        Delete the variable in configuration.data
+        """
+        varname = params[0]
+        command.cooker.configuration.data.delVar(varname)
+
     def initCooker(self, command, params):
         """
         Init the cooker to initial state with nothing parsed
diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
index 8909e01..d236a72 100644
--- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
@@ -265,7 +265,9 @@ class HobHandler(gobject.GObject):
         self.server.runCommand(["setVariable", "IMAGE_FSTYPES",
image_fstypes])

     def set_distro(self, distro):
-        if distro != "defaultsetup":
+        if distro == "defaultsetup":
+            self.server.runCommand(["delVariable", "DISTRO"])
+        else:
             self.server.runCommand(["setVariable", "DISTRO", distro])

