diff --git a/centos/Dockerfile b/centos/Dockerfile
index bbc8a5b74f75607bd5f5834d99aa74e435ce8b4f..cbf4ff125ec36814c4d7ef066c8489f223f1e0b3 100644
--- a/centos/Dockerfile
+++ b/centos/Dockerfile
@@ -353,21 +353,6 @@ RUN version=1.6.0 && \
     rm /opt/mxnet-1.6.0-manual-cuda-arch-flags.patch && \
     ninja -C build
 
-# pybind11
-ARG pybind11_VERSION=2.13.5
-RUN source /etc/profile && \
-    cd /tmp && \
-    curl -sSL -o pybind11-${pybind11_VERSION}.tar.gz https://github.com/pybind/pybind11/archive/v${pybind11_VERSION}.tar.gz && \
-    tar -xf pybind11-${pybind11_VERSION}.tar.gz && \
-    cd pybind11-${pybind11_VERSION} && \
-    cmake -S. -B build -G Ninja \
-        -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local \
-        -DPYBIND11_TEST=off \
-        && \
-    ninja -C build install && \
-    cd .. && \
-    rm -rf pybind11-${pybind11_VERSION}*
-
 # pylon (Basler cameras)
 ARG pylon_VERSION=5.2.0.13457
 RUN cd /tmp && \
@@ -380,6 +365,14 @@ RUN cd /tmp && \
     rm -rf pylon-${pylon_VERSION}*
 ADD bash/pylon.sh /etc/profile.d/pylon.sh
 
+# Remove non-vault yum repos
+RUN rm /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-SCLo-scl.repo /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo
+ADD patches/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo
+
+RUN yum makecache
+
+RUN yum install -y gmp-devel
+
 # CGAL
 ARG CGAL_VERSION=5.2
 RUN yum install -y \
@@ -468,6 +461,21 @@ RUN version=3.8.19 && \
     rm -rf Python-${version}* && \
     ldconfig
 
+# pybind11
+ARG pybind11_VERSION=2.13.5
+RUN source /etc/profile && \
+    cd /tmp && \
+    curl -sSL -o pybind11-${pybind11_VERSION}.tar.gz https://github.com/pybind/pybind11/archive/v${pybind11_VERSION}.tar.gz && \
+    tar -xf pybind11-${pybind11_VERSION}.tar.gz && \
+    cd pybind11-${pybind11_VERSION} && \
+    cmake -S. -B build -G Ninja \
+        -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local \
+        -DPYBIND11_TEST=off \
+        && \
+    ninja -C build install && \
+    cd .. && \
+    rm -rf pybind11-${pybind11_VERSION}*
+
 # Python 3.9
 RUN version=3.9.19 && \
     source /etc/profile && \
diff --git a/centos/patches/CentOS-Base.repo b/centos/patches/CentOS-Base.repo
new file mode 100644
index 0000000000000000000000000000000000000000..88c81beb2cb36865545643c4342a6b25e5b3e884
--- /dev/null
+++ b/centos/patches/CentOS-Base.repo
@@ -0,0 +1,27 @@
+[base]
+name=CentOS-$releasever - Base
+baseurl=https://vault.centos.org/7.9.2009/os/$basearch/
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
+enabled=1
+
+[updates]
+name=CentOS-$releasever - Updates
+baseurl=https://vault.centos.org/7.9.2009/updates/$basearch/
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
+enabled=1
+
+[extras]
+name=CentOS-$releasever - Extras
+baseurl=https://vault.centos.org/7.9.2009/extras/$basearch/
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
+enabled=1
+
+[centosplus]
+name=CentOS-$releasever - CentOSPlus
+baseurl=https://vault.centos.org/7.9.2009/centosplus/$basearch/
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
+enabled=0