diff --git a/bin/bitbake-setup b/bin/bitbake-setup
index 92ed563c2..35d9730ae 100755
--- a/bin/bitbake-setup
+++ b/bin/bitbake-setup
@@ -27,6 +27,7 @@ bindir = os.path.abspath(os.path.dirname(__file__))
 sys.path[0:0] = [os.path.join(os.path.dirname(bindir), 'lib')]
 
 import bb.msg  # noqa: E402
+import bb.fetch  # noqa: E402
 import bb.process  # noqa: E402
 from bb import __version__ as libbb_version # noqa: E402
 
@@ -108,8 +109,8 @@ def init_bb_cache(top_dir, settings, args):
     return d
 
 def save_bb_cache():
-    bb.fetch2.fetcher_parse_save()
-    bb.fetch2.fetcher_parse_done()
+    bb.fetch.fetcher_parse_save()
+    bb.fetch.fetcher_parse_done()
 
 def get_config_name(config):
     suffix = '.conf.json'
@@ -192,7 +193,7 @@ def checkout_layers(layers, confdir, layerdir, d, rebase_conflicts_strategy='abo
             repodir_path = os.path.join(layerdir, repodir)
             try:
                 do_fetch(fetcher, layerdir)
-            except (bb.fetch2.LocalModificationsError, bb.fetch2.RebaseError) as e:
+            except (bb.fetch.LocalModificationsError, bb.fetch.RebaseError) as e:
                 if rebase_conflicts_strategy != 'backup':
                     e.msg += ("\nUse 'bitbake-setup update --rebase-conflicts-strategy=backup'"
                               " to automatically back up the directory and re-clone from upstream,"
@@ -893,7 +894,7 @@ def get_diff(file1, file2):
 
 def are_layers_changed(layers, layerdir, d):
     def _is_git_remote_changed(r_remote, repodir):
-        from bb.fetch2.git import git_hash_re
+        from bb.fetch.git import git_hash_re
 
         rev = r_remote['rev']
         branch = r_remote.get('branch', None)
@@ -1108,11 +1109,11 @@ def install_buildtools(top_dir, settings, args, d):
     fetcher = bb.fetch.Fetch([src_uri], d)
     try:
         fetcher.download()
-    except bb.fetch2.ChecksumError as e:
+    except bb.fetch.ChecksumError as e:
         logger.error("Checksum mismatch for buildtools installer. "
                      "Verify the URL and downloaded file.\n%s" % str(e))
         sys.exit(1)
-    except bb.fetch2.FetchError as e:
+    except bb.fetch.FetchError as e:
         logger.error("Failed to download buildtools installer: %s" % str(e))
         sys.exit(1)
 
diff --git a/bin/bitbake-worker b/bin/bitbake-worker
index a9946f067..d011b2af4 100755
--- a/bin/bitbake-worker
+++ b/bin/bitbake-worker
@@ -11,7 +11,7 @@ import warnings
 warnings.simplefilter("default")
 warnings.filterwarnings("ignore", category=DeprecationWarning, message=".*use.of.fork.*may.lead.to.deadlocks.in.the.child.*")
 sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib'))
-from bb import fetch2
+from bb import fetch
 import logging
 import bb
 import select
diff --git a/conf/bitbake.conf b/conf/bitbake.conf
index f5a5a333a..a8cd5c079 100644
--- a/conf/bitbake.conf
+++ b/conf/bitbake.conf
@@ -43,4 +43,4 @@ T = "${WORKDIR}/temp"
 TARGET_ARCH = "${BUILD_ARCH}"
 TMPDIR = "${TOPDIR}/tmp"
 WORKDIR = "${TMPDIR}/work/${PF}"
-GITPKGV = "${@bb.fetch2.get_srcrev(d, 'gitpkgv_revision')}"
+GITPKGV = "${@bb.fetch.get_srcrev(d, 'gitpkgv_revision')}"
diff --git a/lib/bb/command.py b/lib/bb/command.py
index 9c421aa9a..068d95c16 100644
--- a/lib/bb/command.py
+++ b/lib/bb/command.py
@@ -22,6 +22,7 @@ from collections import OrderedDict, defaultdict
 
 import io
 import bb.event
+import bb.fetch
 import bb.cooker
 import bb.remotedata
 import bb.parse
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index 00a6bac55..8a422e506 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -18,6 +18,7 @@ from io import StringIO, UnsupportedOperation
 from contextlib import closing
 from collections import defaultdict, namedtuple
 import bb, bb.command
+import bb.fetch
 from bb import utils, data, parse, event, cache, providers, taskdata, runqueue, build
 import queue
 import signal
@@ -1600,8 +1601,8 @@ You can also remove the BB_HASHSERVE_UPSTREAM setting, but this may result in si
 
         dump = {}
         # Horrible but for now we need to avoid any sideeffects of autorev being called
-        saved = bb.fetch2.get_autorev
-        bb.fetch2.get_autorev = dummy_autorev
+        saved = bb.fetch.get_autorev
+        bb.fetch.get_autorev = dummy_autorev
         for k in self.data.keys():
             try:
                 expand = True
@@ -1621,7 +1622,7 @@ You can also remove the BB_HASHSERVE_UPSTREAM setting, but this may result in si
                             dump[k][d] = None
             except Exception as e:
                 print(e)
-        bb.fetch2.get_autorev = saved
+        bb.fetch.get_autorev = saved
         return dump
 
 
diff --git a/lib/bb/cookerdata.py b/lib/bb/cookerdata.py
index d307bff0a..d65e3c974 100644
--- a/lib/bb/cookerdata.py
+++ b/lib/bb/cookerdata.py
@@ -22,7 +22,7 @@ import bb.codeparser
 import bb.data
 import bb.data_smart
 import bb.event
-import bb.fetch2
+import bb.fetch
 import bb.parse
 import bb.utils
 
diff --git a/lib/bb/siggen.py b/lib/bb/siggen.py
index a2ef38e17..76c82c684 100644
--- a/lib/bb/siggen.py
+++ b/lib/bb/siggen.py
@@ -11,6 +11,7 @@ import re
 import tempfile
 import pickle
 import bb.data
+import bb.fetch
 import difflib
 from bb._vendor import simplediff
 import json
@@ -362,7 +363,7 @@ class SignatureGeneratorBasic(SignatureGenerator):
             if self.checksum_cache:
                 checksums = self.checksum_cache.get_checksums(dataCaches[mc].file_checksums[mcfn][task], recipename, self.localdirsexclude)
             else:
-                checksums = bb.fetch2.get_file_checksums(dataCaches[mc].file_checksums[mcfn][task], recipename, self.localdirsexclude)
+                checksums = bb.fetch.get_file_checksums(dataCaches[mc].file_checksums[mcfn][task], recipename, self.localdirsexclude)
             for (f,cs) in checksums:
                 self.file_checksum_values[tid].append((f,cs))
 
@@ -413,8 +414,8 @@ class SignatureGeneratorBasic(SignatureGenerator):
             self.checksum_cache.save_extras()
             self.checksum_cache.save_merge()
         else:
-            bb.fetch2.fetcher_parse_save()
-            bb.fetch2.fetcher_parse_done()
+            bb.fetch.fetcher_parse_save()
+            bb.fetch.fetcher_parse_done()
 
     def save_unitaskhashes(self):
         self.unihash_cache.save(self.unitaskhashes)
diff --git a/lib/bb/tests/fetch.py b/lib/bb/tests/fetch.py
index a1e4b45f8..58aff7f67 100644
--- a/lib/bb/tests/fetch.py
+++ b/lib/bb/tests/fetch.py
@@ -1,5 +1,5 @@
 #
-# BitBake Tests for the Fetcher (fetch2/)
+# BitBake Tests for the Fetcher (fetch/)
 #
 # Copyright (C) 2012 Richard Purdie
 #
@@ -21,7 +21,7 @@ import subprocess
 import json
 import tarfile
 import threading
-from bb.fetch2 import URI
+from bb.fetch import URI
 import bb
 import bb.utils
 from bb.tests.support.httpserver import HTTPService
@@ -520,28 +520,28 @@ class MirrorUriTest(FetcherTest):
         for k, v in self.replaceuris.items():
             ud = bb.fetch.FetchData(k[0], self.d)
             ud.setup_localpath(self.d)
-            mirrors = bb.fetch2.mirror_from_string("%s %s" % (k[1], k[2]))
-            newuris, uds = bb.fetch2.build_mirroruris(ud, mirrors, self.d)
+            mirrors = bb.fetch.mirror_from_string("%s %s" % (k[1], k[2]))
+            newuris, uds = bb.fetch.build_mirroruris(ud, mirrors, self.d)
             self.assertEqual([v] if v else [], newuris)
 
     def test_urilist1(self):
         fetcher = bb.fetch.FetchData("http://downloads.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz", self.d)
-        mirrors = bb.fetch2.mirror_from_string(self.mirrorvar)
-        uris, uds = bb.fetch2.build_mirroruris(fetcher, mirrors, self.d)
+        mirrors = bb.fetch.mirror_from_string(self.mirrorvar)
+        uris, uds = bb.fetch.build_mirroruris(fetcher, mirrors, self.d)
         self.assertEqual(uris, ['file:///somepath/downloads/bitbake-1.0.tar.gz', 'file:///someotherpath/downloads/bitbake-1.0.tar.gz'])
 
     def test_urilist2(self):
         # Catch https:// -> files:// bug
         fetcher = bb.fetch.FetchData("https://downloads.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz", self.d)
-        mirrors = bb.fetch2.mirror_from_string(self.mirrorvar)
-        uris, uds = bb.fetch2.build_mirroruris(fetcher, mirrors, self.d)
+        mirrors = bb.fetch.mirror_from_string(self.mirrorvar)
+        uris, uds = bb.fetch.build_mirroruris(fetcher, mirrors, self.d)
         self.assertEqual(uris, ['file:///someotherpath/downloads/bitbake-1.0.tar.gz'])
 
     def test_urilistsvn(self):
         # Catch svn:// -> svn:// bug
         fetcher = bb.fetch.FetchData("svn://svn.server1.com/isource/svnroot/reponame/tags/tagname;module=path_in_tagnamefolder;protocol=https;rev=2", self.d)
-        mirrors = bb.fetch2.mirror_from_string(self.mirrorvar)
-        uris, uds = bb.fetch2.build_mirroruris(fetcher, mirrors, self.d)
+        mirrors = bb.fetch.mirror_from_string(self.mirrorvar)
+        uris, uds = bb.fetch.build_mirroruris(fetcher, mirrors, self.d)
         self.assertEqual(uris, ['svn://svn.server2.com/isource/svnroot/reponame/tags/tagname;module=path_in_tagnamefolder;protocol=https;rev=2'])
 
     def test_mirror_of_mirror(self):
@@ -549,8 +549,8 @@ class MirrorUriTest(FetcherTest):
         mirrorvar = self.mirrorvar + " http://.*/.* http://otherdownloads.yoctoproject.org/downloads/"
         mirrorvar = mirrorvar + " http://otherdownloads.yoctoproject.org/.* http://downloads2.yoctoproject.org/downloads/"
         fetcher = bb.fetch.FetchData("http://downloads.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz", self.d)
-        mirrors = bb.fetch2.mirror_from_string(mirrorvar)
-        uris, uds = bb.fetch2.build_mirroruris(fetcher, mirrors, self.d)
+        mirrors = bb.fetch.mirror_from_string(mirrorvar)
+        uris, uds = bb.fetch.build_mirroruris(fetcher, mirrors, self.d)
         self.assertEqual(uris, ['file:///somepath/downloads/bitbake-1.0.tar.gz',
                                 'file:///someotherpath/downloads/bitbake-1.0.tar.gz',
                                 'http://otherdownloads.yoctoproject.org/downloads/bitbake-1.0.tar.gz',
@@ -561,8 +561,8 @@ class MirrorUriTest(FetcherTest):
 
     def test_recursive(self):
         fetcher = bb.fetch.FetchData("https://downloads.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz", self.d)
-        mirrors = bb.fetch2.mirror_from_string(self.recmirrorvar)
-        uris, uds = bb.fetch2.build_mirroruris(fetcher, mirrors, self.d)
+        mirrors = bb.fetch.mirror_from_string(self.recmirrorvar)
+        uris, uds = bb.fetch.build_mirroruris(fetcher, mirrors, self.d)
         self.assertEqual(uris, ['http://aaaa/A/A/A/bitbake/bitbake-1.0.tar.gz',
                                 'https://bbbb/B/B/B/bitbake/bitbake-1.0.tar.gz',
                                 'http://aaaa/A/A/A/B/B/bitbake/bitbake-1.0.tar.gz'])
@@ -798,7 +798,7 @@ class FetcherLocalTest(FetcherTest):
         self.assertEqual(tree, [r'backslash\x2dsystemd-unit.device'])
 
     def test_local_wildcard(self):
-        with self.assertRaises(bb.fetch2.ParameterError):
+        with self.assertRaises(bb.fetch.ParameterError):
             tree = self.fetchUnpack(['file://a', 'file://dir/*'])
 
     def test_local_dir(self):
@@ -827,7 +827,7 @@ class FetcherLocalTest(FetcherTest):
         tree = self.fetchUnpack(['file://a;subdir=%s' % os.path.join(self.unpackdir, 'bar')])
 
         # Unpacking to an absolute path outside of the root should fail
-        with self.assertRaises(bb.fetch2.UnpackError):
+        with self.assertRaises(bb.fetch.UnpackError):
             self.fetchUnpack(['file://a;subdir=/bin/sh'])
 
     def test_local_striplevel(self):
@@ -854,20 +854,20 @@ class FetcherLocalTest(FetcherTest):
 
     def test_local_deb_rejects_unknown_data_member_suffix(self):
         package = self.make_ar_package("archive.deb", data_member="data.tar.foo")
-        with self.assertRaises(bb.fetch2.UnpackError) as context:
+        with self.assertRaises(bb.fetch.UnpackError) as context:
             self.fetchUnpack(['file://%s' % package])
 
         self.assertIn("does not contain supported data.tar* file", str(context.exception))
 
     def test_local_deb_rejects_unsafe_data_member(self):
         package = self.make_ar_package("archive.deb", data_member="data.tar.xz;id")
-        with self.assertRaises(bb.fetch2.UnpackError) as context:
+        with self.assertRaises(bb.fetch.UnpackError) as context:
             self.fetchUnpack(['file://%s' % package])
 
         self.assertIn("does not contain supported data.tar* file", str(context.exception))
 
     def assertInvalidStriplevel(self, value):
-        with self.assertRaises(bb.fetch2.UnpackError) as context:
+        with self.assertRaises(bb.fetch.UnpackError) as context:
             self.fetchUnpack(['file://archive.tar;subdir=bar;striplevel=%s' % value])
         self.assertIn("Invalid striplevel parameter", str(context.exception))
 
@@ -931,7 +931,7 @@ class FetcherNoNetworkTest(FetcherTest):
         self.assertFalse(os.path.exists(os.path.join(self.dldir, "test-file.tar.gz")))
         self.assertFalse(os.path.exists(os.path.join(self.dldir, "test-file.tar.gz.done")))
         fetcher = bb.fetch.Fetch(["http://invalid.yoctoproject.org/test-file.tar.gz"], self.d)
-        with self.assertRaises(bb.fetch2.NetworkAccess):
+        with self.assertRaises(bb.fetch.NetworkAccess):
             fetcher.download()
 
     def test_valid_missing_donestamp(self):
@@ -961,7 +961,7 @@ class FetcherNoNetworkTest(FetcherTest):
         self.assertTrue(os.path.exists(os.path.join(self.dldir, "test-file.tar.gz")))
         self.assertFalse(os.path.exists(os.path.join(self.dldir, "test-file.tar.gz.done")))
         fetcher = bb.fetch.Fetch(["http://invalid.yoctoproject.org/test-file.tar.gz"], self.d)
-        with self.assertRaises(bb.fetch2.NetworkAccess):
+        with self.assertRaises(bb.fetch.NetworkAccess):
             fetcher.download()
         # the existing file should not exist or should have be moved to "bad-checksum"
         self.assertFalse(os.path.exists(os.path.join(self.dldir, "test-file.tar.gz")))
@@ -972,7 +972,7 @@ class FetcherNoNetworkTest(FetcherTest):
         # ssh fetch does not support checksums
         fetcher = bb.fetch.Fetch(["ssh://invalid@invalid.yoctoproject.org/test-file.tar.gz"], self.d)
         # attempts to download with missing donestamp
-        with self.assertRaises(bb.fetch2.NetworkAccess):
+        with self.assertRaises(bb.fetch.NetworkAccess):
             fetcher.download()
 
     def test_nochecksums_missing_donestamp(self):
@@ -985,7 +985,7 @@ class FetcherNoNetworkTest(FetcherTest):
         # ssh fetch does not support checksums
         fetcher = bb.fetch.Fetch(["ssh://invalid@invalid.yoctoproject.org/test-file.tar.gz"], self.d)
         # attempts to download with missing donestamp
-        with self.assertRaises(bb.fetch2.NetworkAccess):
+        with self.assertRaises(bb.fetch.NetworkAccess):
             fetcher.download()
 
     def test_nochecksums_has_donestamp(self):
@@ -1014,7 +1014,7 @@ class FetcherNoNetworkTest(FetcherTest):
         self.assertTrue(os.path.exists(os.path.join(self.dldir, "test-file.tar.gz.done")))
         # ssh fetch does not support checksums
         fetcher = bb.fetch.Fetch(["ssh://invalid@invalid.yoctoproject.org/test-file.tar.gz"], self.d)
-        with self.assertRaises(bb.fetch2.NetworkAccess):
+        with self.assertRaises(bb.fetch.NetworkAccess):
             fetcher.download()
         # both files should still exist
         self.assertFalse(os.path.exists(os.path.join(self.dldir, "test-file.tar.gz")))
@@ -1315,7 +1315,7 @@ class FetcherNetworkTest(FetcherTest):
         self.d.setVar("SRCREV", "14e1138441bbbb584160cb1c0a0426ec1bac35f1")
         with Timeout(60):
             fetcher = bb.fetch.Fetch([self.recipe_url], self.d)
-            with self.assertRaises(bb.fetch2.FetchError):
+            with self.assertRaises(bb.fetch.FetchError):
                 fetcher.download()
 
 class SVNTest(FetcherTest):
@@ -1601,7 +1601,7 @@ class FetchLatestVersionTest(FetcherTest):
                 self.d.setVar("PN", k[0])
                 self.d.setVar("SRCREV", k[2])
                 self.d.setVar("UPSTREAM_CHECK_GITTAGREGEX", k[3])
-                ud = bb.fetch2.FetchData(k[1], self.d)
+                ud = bb.fetch.FetchData(k[1], self.d)
                 pupver= ud.method.latest_versionstring(ud, self.d)
                 verstring = pupver[0]
                 self.assertTrue(verstring, msg="Could not find upstream version for %s" % k[0])
@@ -1628,7 +1628,7 @@ class FetchLatestVersionTest(FetcherTest):
                         self.d.setVar("UPSTREAM_CHECK_REGEX", data.check_regex)
 
                     url = "http://127.0.0.1:%s/%s" % (port, data.path)
-                    ud = bb.fetch2.FetchData(url, self.d)
+                    ud = bb.fetch.FetchData(url, self.d)
                     pupver = ud.method.latest_versionstring(ud, self.d)
                     verstring = pupver[0]
                     self.assertTrue(verstring, msg="Could not find upstream version for %s" % data.pn)
@@ -1642,7 +1642,7 @@ class FetchLatestVersionTest(FetcherTest):
         for k, v in self.test_crate_uris.items():
             with self.subTest(pn=k[0]):
                 self.d.setVar("PN", k[0])
-                ud = bb.fetch2.FetchData(k[1], self.d)
+                ud = bb.fetch.FetchData(k[1], self.d)
                 pupver = ud.method.latest_versionstring(ud, self.d)
                 verstring = pupver[0]
                 self.assertTrue(verstring, msg="Could not find upstream version for %s" % k[0])
@@ -1657,7 +1657,7 @@ class FetchLatestVersionTest(FetcherTest):
                 self.d.setVar("SRCREV", k[2])
                 self.d.setVar("UPSTREAM_CHECK_GITTAGREGEX", k[3])
                 filter_regex = k[4]
-                ud = bb.fetch2.FetchData(k[1], self.d)
+                ud = bb.fetch.FetchData(k[1], self.d)
                 pupver= ud.method.latest_versionstring(ud, self.d, filter_regex=filter_regex)
                 verstring = pupver[0]
                 self.assertTrue(verstring, msg="Could not find upstream version for %s" % k[0])
@@ -1680,7 +1680,7 @@ class FetchLatestVersionTest(FetcherTest):
                 if k[4]:
                     self.d.setVar("UPSTREAM_CHECK_REGEX", k[4])
                 filter_regex = k[5]
-                ud = bb.fetch2.FetchData(url, self.d)
+                ud = bb.fetch.FetchData(url, self.d)
                 pupver= ud.method.latest_versionstring(ud, self.d, filter_regex=filter_regex)
                 verstring = pupver[0]
                 self.assertTrue(verstring, msg="Could not find upstream version for %s" % k[0])
@@ -1696,7 +1696,7 @@ class FetchLatestVersionTest(FetcherTest):
         for k, v in self.test_crate_stable_uris.items():
             with self.subTest(pn=k[0]):
                 self.d.setVar("PN", k[0])
-                ud = bb.fetch2.FetchData(k[1], self.d)
+                ud = bb.fetch.FetchData(k[1], self.d)
                 filter_regex = k[2]
                 pupver = ud.method.latest_versionstring(ud, self.d, filter_regex=filter_regex)
                 verstring = pupver[0]
@@ -1750,13 +1750,13 @@ class FetchCheckStatusTest(FetcherTest):
         return server
 
     def _checkstatus(self, url):
-        fetch = bb.fetch2.Fetch([url], self.d)
+        fetch = bb.fetch.Fetch([url], self.d)
         ud = fetch.ud[url]
         return ud.method.checkstatus(fetch, ud, self.d)
 
     @skipIfNoNetwork()
     def test_wget_checkstatus(self):
-        fetch = bb.fetch2.Fetch(self.test_wget_uris, self.d)
+        fetch = bb.fetch.Fetch(self.test_wget_uris, self.d)
         for u in self.test_wget_uris:
             with self.subTest(url=u):
                 ud = fetch.ud[u]
@@ -1766,10 +1766,10 @@ class FetchCheckStatusTest(FetcherTest):
 
     @skipIfNoNetwork()
     def test_wget_checkstatus_connection_cache(self):
-        from bb.fetch2 import FetchConnectionCache
+        from bb.fetch import FetchConnectionCache
 
         connection_cache = FetchConnectionCache()
-        fetch = bb.fetch2.Fetch(self.test_wget_uris, self.d,
+        fetch = bb.fetch.Fetch(self.test_wget_uris, self.d,
                     connection_cache = connection_cache)
 
         for u in self.test_wget_uris:
@@ -1785,7 +1785,7 @@ class FetchCheckStatusTest(FetcherTest):
     def test_wget_checkstatus_https_connection_cache(self):
         import ssl
         from socketserver import ThreadingMixIn
-        from bb.fetch2 import FetchConnectionCache
+        from bb.fetch import FetchConnectionCache
 
         class HTTPSRequestHandler(http.server.BaseHTTPRequestHandler):
             protocol_version = "HTTP/1.1"
@@ -1832,7 +1832,7 @@ class FetchCheckStatusTest(FetcherTest):
         try:
             url = "https://127.0.0.1:%s/test" % server.server_port
             self.d.setVar("BB_CHECK_SSL_CERTS", "0")
-            fetch = bb.fetch2.Fetch([url], self.d,
+            fetch = bb.fetch.Fetch([url], self.d,
                                     connection_cache=connection_cache)
             ud = fetch.ud[url]
             self.assertTrue(ud.method.checkstatus(fetch, ud, self.d))
@@ -1918,7 +1918,7 @@ class GitShallowTest(FetcherTest):
         uri = 'git://%s;protocol=file;subdir=${S};branch=master' % self.srcdir
         self.d.setVar('SRC_URI', uri)
         self.d.setVar('SRCREV', '${AUTOREV}')
-        self.d.setVar('AUTOREV', '${@bb.fetch2.get_autorev(d)}')
+        self.d.setVar('AUTOREV', '${@bb.fetch.get_autorev(d)}')
 
         self.d.setVar('BB_GIT_SHALLOW', '1')
         self.d.setVar('BB_GENERATE_MIRROR_TARBALLS', '0')
@@ -1963,7 +1963,7 @@ class GitShallowTest(FetcherTest):
             uri = d.expand(uri)
             uris = [uri]
 
-        fetcher = bb.fetch2.Fetch(uris, d)
+        fetcher = bb.fetch.Fetch(uris, d)
         fetcher.download()
         ud = fetcher.ud[uri]
         return fetcher, ud
@@ -2294,7 +2294,7 @@ class GitShallowTest(FetcherTest):
         self.add_empty_file('b')
 
         self.d.setVar('BB_GIT_SHALLOW_DEPTH', '-12')
-        with self.assertRaises(bb.fetch2.FetchError):
+        with self.assertRaises(bb.fetch.FetchError):
             self.fetch()
 
     def test_shallow_invalid_depth_default(self):
@@ -2302,7 +2302,7 @@ class GitShallowTest(FetcherTest):
         self.add_empty_file('b')
 
         self.d.setVar('BB_GIT_SHALLOW_DEPTH_default', '-12')
-        with self.assertRaises(bb.fetch2.FetchError):
+        with self.assertRaises(bb.fetch.FetchError):
             self.fetch()
 
     def test_shallow_extra_refs(self):
@@ -2367,7 +2367,7 @@ class GitShallowTest(FetcherTest):
         self.add_empty_file('b')
 
         self.d.setVar('BB_GIT_SHALLOW_EXTRA_REFS', 'refs/heads/foo')
-        with self.assertRaises(bb.fetch2.FetchError):
+        with self.assertRaises(bb.fetch.FetchError):
             self.fetch()
 
     def test_shallow_missing_extra_refs_wildcard(self):
@@ -2406,7 +2406,7 @@ class GitShallowTest(FetcherTest):
         self.d.setVar('BB_GIT_SHALLOW_DEPTH', '0')
         self.d.setVar('BB_GIT_SHALLOW_REVS', 'v0.0')
 
-        with self.assertRaises(bb.fetch2.FetchError):
+        with self.assertRaises(bb.fetch.FetchError):
             self.fetch()
 
     def test_shallow_fetch_missing_revs(self):
@@ -2417,7 +2417,7 @@ class GitShallowTest(FetcherTest):
         self.d.setVar('BB_GIT_SHALLOW_DEPTH', '0')
         self.d.setVar('BB_GIT_SHALLOW_REVS', 'v0.0')
 
-        with self.assertRaises(bb.fetch2.FetchError), self.assertLogs("BitBake.Fetcher", level="ERROR") as cm:
+        with self.assertRaises(bb.fetch.FetchError), self.assertLogs("BitBake.Fetcher", level="ERROR") as cm:
             self.fetch_shallow()
         self.assertIn("fatal: no commits selected for shallow requests", cm.output[0])
 
@@ -2428,7 +2428,7 @@ class GitShallowTest(FetcherTest):
         self.d.setVar('BB_GIT_SHALLOW_DEPTH', '0')
         self.d.setVar('BB_GIT_SHALLOW_REVS', 'v0.0')
 
-        with self.assertRaises(bb.fetch2.FetchError), self.assertLogs("BitBake.Fetcher", level="ERROR") as cm:
+        with self.assertRaises(bb.fetch.FetchError), self.assertLogs("BitBake.Fetcher", level="ERROR") as cm:
             self.fetch_shallow()
         self.assertIn("Unable to find revision v0.0 even from upstream", cm.output[0])
 
@@ -2485,7 +2485,7 @@ class GitShallowTest(FetcherTest):
         bb.utils.remove(self.gitdir, recurse=True)
         bb.utils.remove(self.dldir, recurse=True)
 
-        with self.assertRaises(bb.fetch2.UnpackError) as context:
+        with self.assertRaises(bb.fetch.UnpackError) as context:
             fetcher.unpack(self.d.getVar('WORKDIR'))
 
         self.assertIn("No up to date source found", context.exception.msg)
@@ -2534,7 +2534,7 @@ class GitLfsTest(FetcherTest):
         self.d.delVar('MIRRORS')
 
         self.d.setVar('SRCREV', '${AUTOREV}')
-        self.d.setVar('AUTOREV', '${@bb.fetch2.get_autorev(d)}')
+        self.d.setVar('AUTOREV', '${@bb.fetch.get_autorev(d)}')
         self.d.setVar("__BBSRCREV_SEEN", "1")
 
         bb.utils.mkdirhier(self.srcdir)
@@ -2559,7 +2559,7 @@ class GitLfsTest(FetcherTest):
         uri = uris[0]
         d = self.d
 
-        fetcher = bb.fetch2.Fetch(uris, d)
+        fetcher = bb.fetch.Fetch(uris, d)
         if download:
             fetcher.download()
         ud = fetcher.ud[uri]
@@ -2758,7 +2758,7 @@ class GitLfsTest(FetcherTest):
 
         fetcher.download()
         # If git-lfs cannot be found, the unpack should throw an error
-        with self.assertRaises(bb.fetch2.FetchError):
+        with self.assertRaises(bb.fetch.FetchError):
             with unittest.mock.patch("shutil.which", return_value=None):
                 shutil.rmtree(self.gitdir, ignore_errors=True)
                 fetcher.unpack(self.d.getVar('WORKDIR'))
@@ -2772,7 +2772,7 @@ class GitLfsTest(FetcherTest):
 
         # If git-lfs cannot be found, the download should throw an error
         with unittest.mock.patch("shutil.which", return_value=None):
-            with self.assertRaises(bb.fetch2.FetchError):
+            with self.assertRaises(bb.fetch.FetchError):
                 fetcher.download()
 
     def test_lfs_disabled_not_installed(self):
@@ -2862,7 +2862,7 @@ class FetchLocallyMissingTagFromRemote(FetcherTest):
         self.git(['commit', '-m', 'dummymsg', 'dummyfile'], self.srcdir)
 
     def _fetch_and_unpack(self, uri_to_fetch):
-        fetcher = bb.fetch2.Fetch([uri_to_fetch], self.d)
+        fetcher = bb.fetch.Fetch([uri_to_fetch], self.d)
         fetcher.download()
         fetcher.unpack(self.d.getVar('WORKDIR'))
 
@@ -2896,7 +2896,7 @@ class CrateTest(FetcherTest):
         uris = self.d.getVar('SRC_URI').split()
         d = self.d
 
-        fetcher = bb.fetch2.Fetch(uris, self.d)
+        fetcher = bb.fetch.Fetch(uris, self.d)
         ud = fetcher.ud[fetcher.urls[0]]
 
         self.assertIn("name", ud.parm)
@@ -2922,7 +2922,7 @@ class CrateTest(FetcherTest):
         uris = self.d.getVar('SRC_URI').split()
         d = self.d
 
-        fetcher = bb.fetch2.Fetch(uris, self.d)
+        fetcher = bb.fetch.Fetch(uris, self.d)
         ud = fetcher.ud[fetcher.urls[0]]
 
         self.assertIn("name", ud.parm)
@@ -2945,7 +2945,7 @@ class CrateTest(FetcherTest):
         uris = self.d.getVar('SRC_URI').split()
         d = self.d
 
-        fetcher = bb.fetch2.Fetch(uris, self.d)
+        fetcher = bb.fetch.Fetch(uris, self.d)
         ud = fetcher.ud[fetcher.urls[0]]
 
         self.assertIn("name", ud.parm)
@@ -2969,7 +2969,7 @@ class CrateTest(FetcherTest):
         uris = self.d.getVar('SRC_URI').split()
         d = self.d
 
-        fetcher = bb.fetch2.Fetch(uris, self.d)
+        fetcher = bb.fetch.Fetch(uris, self.d)
         ud = fetcher.ud[fetcher.urls[0]]
 
         self.assertIn("name", ud.parm)
@@ -3000,8 +3000,8 @@ class CrateTest(FetcherTest):
 
         uris = self.d.getVar('SRC_URI').split()
 
-        fetcher = bb.fetch2.Fetch(uris, self.d)
-        with self.assertRaisesRegex(bb.fetch2.FetchError, "Fetcher failure for URL"):
+        fetcher = bb.fetch.Fetch(uris, self.d)
+        with self.assertRaisesRegex(bb.fetch.FetchError, "Fetcher failure for URL"):
             fetcher.download()
 
 class NPMTest(FetcherTest):
@@ -3151,7 +3151,7 @@ class NPMTest(FetcherTest):
                 '83f1263230afc588123958b73e36bb241f63eaf08119aac5aa2a870bc4de9223']
         self.d.setVar('BB_NO_NETWORK', '1')
         fetcher = bb.fetch.Fetch(urls, self.d)
-        with self.assertRaises(bb.fetch2.NetworkAccess):
+        with self.assertRaises(bb.fetch.NetworkAccess):
             fetcher.download()
 
     @skipIfNoNpm()
@@ -3186,7 +3186,7 @@ class NPMTest(FetcherTest):
     @skipIfNoNpm()
     def test_npm_version_latest_rejected(self):
         url = ['npm://registry.npmjs.org;package=@savoirfairelinux/node-server-example;version=latest']
-        with self.assertRaises(bb.fetch2.ParameterError):
+        with self.assertRaises(bb.fetch.ParameterError):
             bb.fetch.Fetch(url, self.d)
 
     @skipIfNoNpm()
@@ -3196,7 +3196,7 @@ class NPMTest(FetcherTest):
                 ';sha512sum=f2dd7d88cb9a129fbb97eb87a8b5103bab24f783420fd7587f8000a355a12bf7'
                 '83f1263230afc588123958b73e36bb241f63eaf08119aac5aa2a870bc4de9223']
         fetcher = bb.fetch.Fetch(urls, self.d)
-        with self.assertRaises(bb.fetch2.FetchError):
+        with self.assertRaises(bb.fetch.FetchError):
             fetcher.download()
 
     @skipIfNoNpm()
@@ -3206,14 +3206,14 @@ class NPMTest(FetcherTest):
                 ';sha512sum=f2dd7d88cb9a129fbb97eb87a8b5103bab24f783420fd7587f8000a355a12bf7'
                 '83f1263230afc588123958b73e36bb241f63eaf08119aac5aa2a870bc4de9223']
         fetcher = bb.fetch.Fetch(urls, self.d)
-        with self.assertRaises(bb.fetch2.FetchError):
+        with self.assertRaises(bb.fetch.FetchError):
             fetcher.download()
 
     @skipIfNoNpm()
     @skipIfNoNetwork()
     def test_npm_version_invalid(self):
         urls = ['npm://registry.npmjs.org;package=@savoirfairelinux/node-server-example;version=invalid']
-        with self.assertRaises(bb.fetch2.ParameterError):
+        with self.assertRaises(bb.fetch.ParameterError):
             fetcher = bb.fetch.Fetch(urls, self.d)
 
     @skipIfNoNpm()
@@ -3221,7 +3221,7 @@ class NPMTest(FetcherTest):
     def test_npm_recipe_checksum(self):
         """A sha512sum param in SRC_URI is forwarded to the proxy and verified."""
         import subprocess
-        from bb.fetch2.npm import npm_integrity
+        from bb.fetch.npm import npm_integrity
         result = subprocess.run(
             ['npm', 'view', '--json', '@savoirfairelinux/node-server-example@1.0.0'],
             capture_output=True, text=True)
@@ -3249,7 +3249,7 @@ class NPMTest(FetcherTest):
         urls = ['npm://registry.npmjs.org;package=@savoirfairelinux/node-server-example'
                 ';version=1.0.0;sha512sum=deadbeef00']
         fetcher = bb.fetch.Fetch(urls, self.d)
-        with self.assertRaises(bb.fetch2.FetchError):
+        with self.assertRaises(bb.fetch.FetchError):
             fetcher.download()
 
     @skipIfNoNpm()
@@ -3267,28 +3267,28 @@ class NPMTest(FetcherTest):
                 self.d.delVar('BB_STRICT_CHECKSUM')
             else:
                 self.d.setVar('BB_STRICT_CHECKSUM', strict)
-            with self.assertRaises(bb.fetch2.MissingParameterError):
+            with self.assertRaises(bb.fetch.MissingParameterError):
                 bb.fetch.Fetch(urls, self.d)
 
     @skipIfNoNpm()
     @skipIfNoNetwork()
     def test_npm_registry_none(self):
         urls = ['npm://;package=@savoirfairelinux/node-server-example;version=1.0.0']
-        with self.assertRaises(bb.fetch2.MalformedUrl):
+        with self.assertRaises(bb.fetch.MalformedUrl):
             fetcher = bb.fetch.Fetch(urls, self.d)
 
     @skipIfNoNpm()
     @skipIfNoNetwork()
     def test_npm_package_none(self):
         urls = ['npm://registry.npmjs.org;version=1.0.0']
-        with self.assertRaises(bb.fetch2.MissingParameterError):
+        with self.assertRaises(bb.fetch.MissingParameterError):
             fetcher = bb.fetch.Fetch(urls, self.d)
 
     @skipIfNoNpm()
     @skipIfNoNetwork()
     def test_npm_version_none(self):
         urls = ['npm://registry.npmjs.org;package=@savoirfairelinux/node-server-example']
-        with self.assertRaises(bb.fetch2.MissingParameterError):
+        with self.assertRaises(bb.fetch.MissingParameterError):
             fetcher = bb.fetch.Fetch(urls, self.d)
 
     def create_shrinkwrap_file(self, data):
@@ -3405,7 +3405,7 @@ class NPMTest(FetcherTest):
         })
         self.d.setVar('BB_NO_NETWORK', '1')
         fetcher = bb.fetch.Fetch(['npmsw://' + swfile], self.d)
-        with self.assertRaises(bb.fetch2.NetworkAccess):
+        with self.assertRaises(bb.fetch.NetworkAccess):
             fetcher.download()
 
     @skipIfNoNpm()
@@ -3466,7 +3466,7 @@ class NPMTest(FetcherTest):
             }
         })
         fetcher = bb.fetch.Fetch(['npmsw://' + swfile], self.d)
-        with self.assertRaises(bb.fetch2.FetchError):
+        with self.assertRaises(bb.fetch.FetchError):
             fetcher.download()
         # Fetch correctly to get a tarball
         swfile = self.create_shrinkwrap_file({
@@ -3634,7 +3634,7 @@ class GitTagVerificationTests(FetcherTest):
     def test_tag_rev_match4(self):
         # Test a url with SRCREV and rev= mismatching errors
         self.d.setVar('SRCREV', 'bade540fc31a1c26839efd2c7785a751ce24ebfb')
-        with self.assertRaises(bb.fetch2.FetchError):
+        with self.assertRaises(bb.fetch.FetchError):
             fetcher = bb.fetch.Fetch(["git://git.openembedded.org/bitbake;branch=2.12;protocol=https;rev=5b4e20377eea8d428edf1aeb2187c18f82ca6757;tag=2.12.0"], self.d)
 
     @skipIfNoNetwork()
@@ -3652,7 +3652,7 @@ class GitTagVerificationTests(FetcherTest):
         self.d.setVar('BB_GIT_SHALLOW', '1')
         fetcher = bb.fetch.Fetch(["git://git.openembedded.org/bitbake;branch=2.12;protocol=https;rev=5b4e20377eea8d428edf1aeb2187c18f82ca6757;tag=2.8.0"], self.d)
         fetcher.download()
-        with self.assertRaises(bb.fetch2.FetchError):
+        with self.assertRaises(bb.fetch.FetchError):
             fetcher.unpack(self.unpackdir)
 
     @skipIfNoNetwork()
@@ -3661,7 +3661,7 @@ class GitTagVerificationTests(FetcherTest):
         self.d.setVar('SRCREV', '5b4e20377eea8d428edf1aeb2187c18f82ca6757')
         fetcher = bb.fetch.Fetch(["git://git.openembedded.org/bitbake;branch=2.12;protocol=https;rev=5b4e20377eea8d428edf1aeb2187c18f82ca6757;tag=2.8.0"], self.d)
         fetcher.download()
-        with self.assertRaises(bb.fetch2.FetchError):
+        with self.assertRaises(bb.fetch.FetchError):
             fetcher.unpack(self.unpackdir)
 
 
@@ -3730,7 +3730,7 @@ class FetchPremirroronlyLocalTest(FetcherTest):
         self.make_git_repo()
         self.d.setVar("SRCREV", "0"*40)
         fetcher = bb.fetch.Fetch([self.recipe_url], self.d)
-        with self.assertRaises(bb.fetch2.NetworkAccess):
+        with self.assertRaises(bb.fetch.NetworkAccess):
             fetcher.download()
 
     def test_mirror_commit_exists(self):
@@ -3743,7 +3743,7 @@ class FetchPremirroronlyLocalTest(FetcherTest):
     def test_mirror_tarball_nonexistent(self):
         self.d.setVar("SRCREV", "0"*40)
         fetcher = bb.fetch.Fetch([self.recipe_url], self.d)
-        with self.assertRaises(bb.fetch2.NetworkAccess):
+        with self.assertRaises(bb.fetch.NetworkAccess):
             fetcher.download()
 
 
@@ -3784,7 +3784,7 @@ class FetchPremirroronlyNetworkTest(FetcherTest):
         ## Upstream commit not in the mirror
         self.d.setVar("SRCREV", "49d65d53c2bf558ae6e9185af0f3af7b79d255ec")
         fetcher = bb.fetch.Fetch([self.recipe_url], self.d)
-        with self.assertRaises(bb.fetch2.NetworkAccess):
+        with self.assertRaises(bb.fetch.NetworkAccess):
             fetcher.download()
 
 class FetchPremirroronlyMercurialTest(FetcherTest):
@@ -3849,7 +3849,7 @@ class FetchPremirroronlyBrokenTarball(FetcherTest):
     def test_mirror_broken_download(self):
         self.d.setVar("SRCREV", "0"*40)
         fetcher = bb.fetch.Fetch([self.recipe_url], self.d)
-        with self.assertRaises(bb.fetch2.FetchError), self.assertLogs() as logs:
+        with self.assertRaises(bb.fetch.FetchError), self.assertLogs() as logs:
             fetcher.download()
         output = "".join(logs.output)
         self.assertFalse(" not a git repository (or any parent up to mount point /)" in output)
@@ -3861,7 +3861,7 @@ class GoModTest(FetcherTest):
         urls = ['gomod://github.com/Azure/azure-sdk-for-go/sdk/storage/azblob;version=v1.0.0;'
                 'sha256sum=9bb69aea32f1d59711701f9562d66432c9c0374205e5009d1d1a62f03fb4fdad']
 
-        fetcher = bb.fetch2.Fetch(urls, self.d)
+        fetcher = bb.fetch.Fetch(urls, self.d)
         ud = fetcher.ud[urls[0]]
         self.assertEqual(ud.url, 'https://proxy.golang.org/github.com/%21azure/azure-sdk-for-go/sdk/storage/azblob/%40v/v1.0.0.zip')
         self.assertEqual(ud.parm['downloadfilename'], 'github.com.Azure.azure-sdk-for-go.sdk.storage.azblob@v1.0.0.zip')
@@ -3880,7 +3880,7 @@ class GoModTest(FetcherTest):
         urls = ['gomod://github.com/Azure/azure-sdk-for-go/sdk/storage/azblob;version=v1.0.0;mod=1;'
                 'sha256sum=7873b8544842329b4f385a3aa6cf82cc2bc8defb41a04fa5291c35fd5900e873']
 
-        fetcher = bb.fetch2.Fetch(urls, self.d)
+        fetcher = bb.fetch.Fetch(urls, self.d)
         ud = fetcher.ud[urls[0]]
         self.assertEqual(ud.url, 'https://proxy.golang.org/github.com/%21azure/azure-sdk-for-go/sdk/storage/azblob/%40v/v1.0.0.mod')
         self.assertEqual(ud.parm['downloadfilename'], 'github.com.Azure.azure-sdk-for-go.sdk.storage.azblob@v1.0.0.mod')
@@ -3896,7 +3896,7 @@ class GoModTest(FetcherTest):
         urls = ['gomod://gopkg.in/ini.v1;version=v1.67.0']
         self.d.setVarFlag('SRC_URI', 'gopkg.in/ini.v1@v1.67.0.sha256sum', 'bd845dfc762a87a56e5a32a07770dc83e86976db7705d7f89c5dbafdc60b06c6')
 
-        fetcher = bb.fetch2.Fetch(urls, self.d)
+        fetcher = bb.fetch.Fetch(urls, self.d)
         ud = fetcher.ud[urls[0]]
         self.assertEqual(ud.url, 'https://proxy.golang.org/gopkg.in/ini.v1/%40v/v1.67.0.zip')
         self.assertEqual(ud.parm['downloadfilename'], 'gopkg.in.ini.v1@v1.67.0.zip')
@@ -3915,7 +3915,7 @@ class GoModTest(FetcherTest):
         urls = ['gomod://gopkg.in/ini.v1;version=v1.67.0;'
                 'sha256sum=bd845dfc762a87a56e5a32a07770dc83e86976db7705d7f89c5dbafdc60b06c6']
 
-        fetcher = bb.fetch2.Fetch(urls, self.d)
+        fetcher = bb.fetch.Fetch(urls, self.d)
         ud = fetcher.ud[urls[0]]
         self.assertEqual(ud.url, 'https://proxy.golang.org/gopkg.in/ini.v1/%40v/v1.67.0.zip')
         self.assertEqual(ud.parm['downloadfilename'], 'gopkg.in.ini.v1@v1.67.0.zip')
@@ -3934,7 +3934,7 @@ class GoModTest(FetcherTest):
         urls = ['gomod://go.opencensus.io;version=v0.24.0;'
                 'sha256sum=203a767d7f8e7c1ebe5588220ad168d1e15b14ae70a636de7ca9a4a88a7e0d0c']
 
-        fetcher = bb.fetch2.Fetch(urls, self.d)
+        fetcher = bb.fetch.Fetch(urls, self.d)
         ud = fetcher.ud[urls[0]]
         self.assertEqual(ud.url, 'https://proxy.golang.org/go.opencensus.io/%40v/v0.24.0.zip')
         self.assertEqual(ud.parm['downloadfilename'], 'go.opencensus.io@v0.24.0.zip')
@@ -3956,7 +3956,7 @@ class GoModGitTest(FetcherTest):
                 'repo=go.googlesource.com/net;'
                 'srcrev=694cff8668bac64e0864b552bffc280cd27f21b1']
 
-        fetcher = bb.fetch2.Fetch(urls, self.d)
+        fetcher = bb.fetch.Fetch(urls, self.d)
         ud = fetcher.ud[urls[0]]
         self.assertEqual(ud.host, 'go.googlesource.com')
         self.assertEqual(ud.path, '/net')
@@ -3981,7 +3981,7 @@ class GoModGitTest(FetcherTest):
                 'repo=github.com/Azure/azure-sdk-for-go;subdir=sdk/storage/azblob;'
                 'srcrev=ec928e0ed34db682b3f783d3739d1c538142e0c3']
 
-        fetcher = bb.fetch2.Fetch(urls, self.d)
+        fetcher = bb.fetch.Fetch(urls, self.d)
         ud = fetcher.ud[urls[0]]
         self.assertEqual(ud.host, 'github.com')
         self.assertEqual(ud.path, '/Azure/azure-sdk-for-go')
@@ -4006,7 +4006,7 @@ class GoModGitTest(FetcherTest):
         urls = ['gomodgit://gopkg.in/ini.v1;version=v1.67.0']
         self.d.setVar('SRCREV_gopkg.in/ini.v1@v1.67.0', 'b2f570e5b5b844226bbefe6fb521d891f529a951')
 
-        fetcher = bb.fetch2.Fetch(urls, self.d)
+        fetcher = bb.fetch.Fetch(urls, self.d)
         ud = fetcher.ud[urls[0]]
         self.assertEqual(ud.host, 'gopkg.in')
         self.assertEqual(ud.path, '/ini.v1')
@@ -4028,7 +4028,7 @@ class GoModGitTest(FetcherTest):
         urls = ['gomodgit://gopkg.in/ini.v1;version=v1.67.0;'
                 'srcrev=b2f570e5b5b844226bbefe6fb521d891f529a951']
 
-        fetcher = bb.fetch2.Fetch(urls, self.d)
+        fetcher = bb.fetch.Fetch(urls, self.d)
         ud = fetcher.ud[urls[0]]
         self.assertEqual(ud.host, 'gopkg.in')
         self.assertEqual(ud.path, '/ini.v1')
@@ -4051,7 +4051,7 @@ class GoModGitTest(FetcherTest):
                 'repo=github.com/census-instrumentation/opencensus-go;'
                 'srcrev=b1a01ee95db0e690d91d7193d037447816fae4c5']
 
-        fetcher = bb.fetch2.Fetch(urls, self.d)
+        fetcher = bb.fetch.Fetch(urls, self.d)
         ud = fetcher.ud[urls[0]]
         self.assertEqual(ud.host, 'github.com')
         self.assertEqual(ud.path, '/census-instrumentation/opencensus-go')
@@ -4153,7 +4153,7 @@ class GitUnpackUpdateTest(FetcherTest):
         4. Verify testfile.txt now contains 'updated content'.
         """
         # First fetch at initial revision
-        fetcher = bb.fetch2.Fetch([self.d.getVar('SRC_URI')], self.d)
+        fetcher = bb.fetch.Fetch([self.d.getVar('SRC_URI')], self.d)
         fetcher.download()
         fetcher.unpack(self.unpackdir)
 
@@ -4165,7 +4165,7 @@ class GitUnpackUpdateTest(FetcherTest):
 
         # Update to new revision
         self.d.setVar('SRCREV', self.updated_rev)
-        fetcher = bb.fetch2.Fetch([self.d.getVar('SRC_URI')], self.d)
+        fetcher = bb.fetch.Fetch([self.d.getVar('SRC_URI')], self.d)
         fetcher.download()
 
         # Use unpack_update
@@ -4187,7 +4187,7 @@ class GitUnpackUpdateTest(FetcherTest):
         and its URL must be 'file://<ud.clonedir>'.
         """
         # First fetch
-        fetcher = bb.fetch2.Fetch([self.d.getVar('SRC_URI')], self.d)
+        fetcher = bb.fetch.Fetch([self.d.getVar('SRC_URI')], self.d)
         fetcher.download()
 
         uri = self.d.getVar('SRC_URI')
@@ -4225,7 +4225,7 @@ class GitUnpackUpdateTest(FetcherTest):
         so this test covers those scenarios implicitly.
         """
         # Step 1 - fetch + unpack at initial_rev
-        fetcher = bb.fetch2.Fetch([self.d.getVar('SRC_URI')], self.d)
+        fetcher = bb.fetch.Fetch([self.d.getVar('SRC_URI')], self.d)
         fetcher.download()
         fetcher.unpack(self.unpackdir)
 
@@ -4248,7 +4248,7 @@ class GitUnpackUpdateTest(FetcherTest):
         # Step 3 - advance SRCREV and download; clonedir must now contain
         # updated_rev so that unpack_update can fetch it without network access.
         self.d.setVar('SRCREV', self.updated_rev)
-        fetcher = bb.fetch2.Fetch([self.d.getVar('SRC_URI')], self.d)
+        fetcher = bb.fetch.Fetch([self.d.getVar('SRC_URI')], self.d)
         fetcher.download()
 
         ud = fetcher.ud[uri]
@@ -4281,7 +4281,7 @@ class GitUnpackUpdateTest(FetcherTest):
         the working tree unchanged. No rebase should be attempted because the
         checkout already points at ud.revision.
         """
-        fetcher = bb.fetch2.Fetch([self.d.getVar('SRC_URI')], self.d)
+        fetcher = bb.fetch.Fetch([self.d.getVar('SRC_URI')], self.d)
         fetcher.download()
         fetcher.unpack(self.unpackdir)
 
@@ -4308,7 +4308,7 @@ class GitUnpackUpdateTest(FetcherTest):
         untracked files untouched, so both the upstream update and the untracked
         file must be present after the call.
         """
-        fetcher = bb.fetch2.Fetch([self.d.getVar('SRC_URI')], self.d)
+        fetcher = bb.fetch.Fetch([self.d.getVar('SRC_URI')], self.d)
         fetcher.download()
         fetcher.unpack(self.unpackdir)
 
@@ -4321,7 +4321,7 @@ class GitUnpackUpdateTest(FetcherTest):
 
         # Update to new upstream revision
         self.d.setVar('SRCREV', self.updated_rev)
-        fetcher = bb.fetch2.Fetch([self.d.getVar('SRC_URI')], self.d)
+        fetcher = bb.fetch.Fetch([self.d.getVar('SRC_URI')], self.d)
         fetcher.download()
 
         uri = self.d.getVar('SRC_URI')
@@ -4346,7 +4346,7 @@ class GitUnpackUpdateTest(FetcherTest):
         dirty index. The caller (bitbake-setup) is expected to catch the
         resulting LocalModificationsError and fall back to backup + re-fetch.
         """
-        fetcher = bb.fetch2.Fetch([self.d.getVar('SRC_URI')], self.d)
+        fetcher = bb.fetch.Fetch([self.d.getVar('SRC_URI')], self.d)
         fetcher.download()
         fetcher.unpack(self.unpackdir)
 
@@ -4360,7 +4360,7 @@ class GitUnpackUpdateTest(FetcherTest):
 
         # Update to new upstream revision
         self.d.setVar('SRCREV', self.updated_rev)
-        fetcher = bb.fetch2.Fetch([self.d.getVar('SRC_URI')], self.d)
+        fetcher = bb.fetch.Fetch([self.d.getVar('SRC_URI')], self.d)
         fetcher.download()
 
         uri = self.d.getVar('SRC_URI')
@@ -4368,7 +4368,7 @@ class GitUnpackUpdateTest(FetcherTest):
         git_fetcher = ud.method
 
         # Should fail - git rebase refuses to run with a dirty index
-        with self.assertRaises(bb.fetch2.LocalModificationsError):
+        with self.assertRaises(bb.fetch.LocalModificationsError):
             git_fetcher.unpack_update(ud, self.unpackdir, self.d)
 
     def test_unpack_update_with_modified_tracked_file(self):
@@ -4379,7 +4379,7 @@ class GitUnpackUpdateTest(FetcherTest):
         the caller can fall back to backup + re-fetch rather than silently discarding
         work in progress.
         """
-        fetcher = bb.fetch2.Fetch([self.d.getVar('SRC_URI')], self.d)
+        fetcher = bb.fetch.Fetch([self.d.getVar('SRC_URI')], self.d)
         fetcher.download()
         fetcher.unpack(self.unpackdir)
 
@@ -4391,7 +4391,7 @@ class GitUnpackUpdateTest(FetcherTest):
 
         # Update to new upstream revision
         self.d.setVar('SRCREV', self.updated_rev)
-        fetcher = bb.fetch2.Fetch([self.d.getVar('SRC_URI')], self.d)
+        fetcher = bb.fetch.Fetch([self.d.getVar('SRC_URI')], self.d)
         fetcher.download()
 
         uri = self.d.getVar('SRC_URI')
@@ -4400,7 +4400,7 @@ class GitUnpackUpdateTest(FetcherTest):
 
         # Should fail - unstaged modification to tracked file is detected by
         # 'git status --untracked-files=no --porcelain'
-        with self.assertRaises(bb.fetch2.LocalModificationsError):
+        with self.assertRaises(bb.fetch.LocalModificationsError):
             git_fetcher.unpack_update(ud, self.unpackdir, self.d)
 
     def test_unpack_update_conflict_raises_rebase_error(self):
@@ -4412,7 +4412,7 @@ class GitUnpackUpdateTest(FetcherTest):
         to a backup + re-fetch.
         """
         # Fetch and unpack at the initial revision
-        fetcher = bb.fetch2.Fetch([self.d.getVar('SRC_URI')], self.d)
+        fetcher = bb.fetch.Fetch([self.d.getVar('SRC_URI')], self.d)
         fetcher.download()
         fetcher.unpack(self.unpackdir)
 
@@ -4433,7 +4433,7 @@ class GitUnpackUpdateTest(FetcherTest):
 
         # Update SRCREV to the new upstream commit
         self.d.setVar('SRCREV', conflict_rev)
-        fetcher = bb.fetch2.Fetch([self.d.getVar('SRC_URI')], self.d)
+        fetcher = bb.fetch.Fetch([self.d.getVar('SRC_URI')], self.d)
         fetcher.download()
 
         uri = self.d.getVar('SRC_URI')
@@ -4442,7 +4442,7 @@ class GitUnpackUpdateTest(FetcherTest):
 
         # unpack_update must fail and clean up (rebase --abort) rather than
         # leaving the repo in a mid-rebase state
-        with self.assertRaises(bb.fetch2.RebaseError):
+        with self.assertRaises(bb.fetch.RebaseError):
             git_fetcher.unpack_update(ud, self.unpackdir, self.d)
 
         # Verify the repo is not left in a conflicted / mid-rebase state
@@ -4475,7 +4475,7 @@ class GitUnpackUpdateTest(FetcherTest):
             local file is untouched.
             """
             # Fresh fetch + unpack at the current SRCREV
-            fetcher = bb.fetch2.Fetch([self.d.getVar('SRC_URI')], self.d)
+            fetcher = bb.fetch.Fetch([self.d.getVar('SRC_URI')], self.d)
             fetcher.download()
             fetcher.unpack(self.unpackdir)
 
@@ -4497,7 +4497,7 @@ class GitUnpackUpdateTest(FetcherTest):
                 f.write('local untracked content\n')
 
             self.d.setVar('SRCREV', new_rev)
-            fetcher = bb.fetch2.Fetch([self.d.getVar('SRC_URI')], self.d)
+            fetcher = bb.fetch.Fetch([self.d.getVar('SRC_URI')], self.d)
             fetcher.download()
 
             uri = self.d.getVar('SRC_URI')
@@ -4505,7 +4505,7 @@ class GitUnpackUpdateTest(FetcherTest):
             git_fetcher = ud.method
 
             # git rebase refuses because the untracked file would be overwritten
-            with self.assertRaises(bb.fetch2.RebaseError):
+            with self.assertRaises(bb.fetch.RebaseError):
                 git_fetcher.unpack_update(ud, self.unpackdir, self.d)
 
             # Repo must not be left in a mid-rebase state
@@ -4543,7 +4543,7 @@ class GitUnpackUpdateTest(FetcherTest):
         self.d.setVar('BB_GENERATE_SHALLOW_TARBALLS', '1')
 
         # First fetch at initial revision
-        fetcher = bb.fetch2.Fetch([self.d.getVar('SRC_URI')], self.d)
+        fetcher = bb.fetch.Fetch([self.d.getVar('SRC_URI')], self.d)
         fetcher.download()
 
         # Remove clonedir to force use of shallow tarball
@@ -4555,7 +4555,7 @@ class GitUnpackUpdateTest(FetcherTest):
 
         # Update to new revision
         self.d.setVar('SRCREV', self.updated_rev)
-        fetcher = bb.fetch2.Fetch([self.d.getVar('SRC_URI')], self.d)
+        fetcher = bb.fetch.Fetch([self.d.getVar('SRC_URI')], self.d)
         fetcher.download()
 
         # unpack_update should fail for shallow clones
@@ -4563,7 +4563,7 @@ class GitUnpackUpdateTest(FetcherTest):
         ud = fetcher.ud[uri]
         git_fetcher = ud.method
 
-        with self.assertRaises(bb.fetch2.UnpackError) as context:
+        with self.assertRaises(bb.fetch.UnpackError) as context:
             git_fetcher.unpack_update(ud, self.unpackdir, self.d)
 
         self.assertIn("shallow clone", str(context.exception).lower())
@@ -4576,7 +4576,7 @@ class GitUnpackUpdateTest(FetcherTest):
         update_mode will fail with a FetchError which must be re-raised as
         UnpackError so the caller can fall back to a full re-fetch.
         """
-        fetcher = bb.fetch2.Fetch([self.d.getVar('SRC_URI')], self.d)
+        fetcher = bb.fetch.Fetch([self.d.getVar('SRC_URI')], self.d)
         fetcher.download()
         fetcher.unpack(self.unpackdir)
 
@@ -4584,7 +4584,7 @@ class GitUnpackUpdateTest(FetcherTest):
 
         # Advance SRCREV to trigger update_mode
         self.d.setVar('SRCREV', self.updated_rev)
-        fetcher = bb.fetch2.Fetch([self.d.getVar('SRC_URI')], self.d)
+        fetcher = bb.fetch.Fetch([self.d.getVar('SRC_URI')], self.d)
         fetcher.download()
 
         uri = self.d.getVar('SRC_URI')
@@ -4597,7 +4597,7 @@ class GitUnpackUpdateTest(FetcherTest):
                  cwd=unpack_path)
 
         git_fetcher = ud.method
-        with self.assertRaises(bb.fetch2.UnpackError):
+        with self.assertRaises(bb.fetch.UnpackError):
             git_fetcher.unpack_update(ud, self.unpackdir, self.d)
 
     def test_fetch_unpack_update_toplevel_api(self):
@@ -4609,7 +4609,7 @@ class GitUnpackUpdateTest(FetcherTest):
         fetch again, then call fetcher.unpack_update(root) and confirm the content
         is updated.
         """
-        fetcher = bb.fetch2.Fetch([self.d.getVar('SRC_URI')], self.d)
+        fetcher = bb.fetch.Fetch([self.d.getVar('SRC_URI')], self.d)
         fetcher.download()
         fetcher.unpack(self.unpackdir)
 
@@ -4618,7 +4618,7 @@ class GitUnpackUpdateTest(FetcherTest):
             self.assertEqual(f.read(), 'initial content\n')
 
         self.d.setVar('SRCREV', self.updated_rev)
-        fetcher = bb.fetch2.Fetch([self.d.getVar('SRC_URI')], self.d)
+        fetcher = bb.fetch.Fetch([self.d.getVar('SRC_URI')], self.d)
         fetcher.download()
 
         # Use the public Fetch.unpack_update() rather than the method directly
diff --git a/lib/bb/tinfoil.py b/lib/bb/tinfoil.py
index 42385c879..9b9925e51 100644
--- a/lib/bb/tinfoil.py
+++ b/lib/bb/tinfoil.py
@@ -25,7 +25,7 @@ import bb.utils
 import bb.command
 import bb.remotedata
 from bb.main import setup_bitbake, BitBakeConfigParameters
-import bb.fetch2
+import bb.fetch
 
 def wait_for(f):
     """
diff --git a/lib/bb/utils.py b/lib/bb/utils.py
index 37edd4353..22e3f13f9 100644
--- a/lib/bb/utils.py
+++ b/lib/bb/utils.py
@@ -2107,7 +2107,7 @@ def landlock_restrict_network():
 
 
 def export_proxies(d):
-    from bb.fetch2 import get_fetcher_environment
+    from bb.fetch import get_fetcher_environment
     """ export common proxies variables from datastore to environment """
     newenv = get_fetcher_environment(d)
     for v in newenv:
