diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper
index 56da5cdf82c1c651cf0ba66539ca258bcf3c03ec..0f87ce1ad37c5bb2b2d622f3c9525068a05a4455 100755
--- a/cmake_targets/tools/build_helper
+++ b/cmake_targets/tools/build_helper
@@ -369,7 +369,6 @@ check_install_oai_software() {
 	libxml2 \
 	libxml2-dev  \
 	libxslt1-dev \
-	linux-headers-`uname -r` \
 	mscgen  \
 	octave \
 	octave-signal \
@@ -385,6 +384,8 @@ check_install_oai_software() {
 
     $SUDO update-alternatives --set liblapack.so /usr/lib/atlas-base/atlas/liblapack.so
     
+    #Sometimes linux headers are not available in apt-get if kernel is custom or new
+    $SUDO apt-get install linux-headers-`uname -r` || true
     # First we remove gnutls/nettle installation and then install from sources
     $SUDO apt-get remove -y libgnutls-dev nettle-dev nettle-bin
     install_nettle_from_source