diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py
index 523acf4250..5c2e6ebd46 100644
--- a/scripts/lib/devtool/upgrade.py
+++ b/scripts/lib/devtool/upgrade.py
@@ -276,7 +276,9 @@ def _extract_new_source(newpv, srctree, no_patch, srcrev, srcbranch, branch, kee
             if item in ['.git', 'oe-local-files']:
                 continue
             itempath = os.path.join(srctree, item)
-            if os.path.isdir(itempath):
+            if os.path.islink(itempath):
+                os.remove(itempath)
+            elif os.path.isdir(itempath):
                 shutil.rmtree(itempath)
             else:
                 os.remove(itempath)
