diff --git a/meta-oe/recipes-shells/zsh/zsh_5.9.2.bb b/meta-oe/recipes-shells/zsh/zsh_5.9.2.bb
index 2b2de3407e..47b9bfc18f 100644
--- a/meta-oe/recipes-shells/zsh/zsh_5.9.2.bb
+++ b/meta-oe/recipes-shells/zsh/zsh_5.9.2.bb
@@ -8,7 +8,7 @@ SECTION = "base/shell"
 LICENSE = "LicenseRef-zsh"
 LIC_FILES_CHKSUM = "file://LICENCE;md5=1a4c4cda3e8096d2fd483ff2f4514fec"
 
-DEPENDS = "ncurses bison-native libcap libpcre2 gdbm groff-native"
+DEPENDS = "ncurses bison-native libcap libpcre2 groff-native"
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/project/${BPN}/${BPN}/${PV}/${BP}.tar.xz"
 SRC_URI[sha256sum] = "36fa734374b44783582cec09bcd67822e2f992c779ec1624ab5596df078d2f81"
@@ -30,7 +30,6 @@ EXTRA_OECONF = " \
     --with-term-lib='ncursesw ncurses' \
     --enable-cap \
     --enable-multibyte \
-    --disable-gdbm \
     --disable-dynamic \
     zsh_cv_shared_environ=yes \
 "
@@ -45,6 +44,7 @@ ALTERNATIVE_LINK_NAME[sh] = "${base_bindir}/sh"
 ALTERNATIVE_TARGET[sh] = "${base_bindir}/${BPN}"
 ALTERNATIVE_PRIORITY = "90"
 
+PACKAGECONFIG[gdbm] = "--enable-gdbm,--disable-gdbm,gdbm"
 # Needed for manpages.bbclass, but they're always installed
 PACKAGECONFIG[manpages] = ""
 
