diff --git a/helpers/make-update-manager b/helpers/make-update-manager
index 734acbd6d24812cebdb38ad91e1413df020aac30..71561717999872f75632fc2a041f5d22debd640e 100644
--- a/helpers/make-update-manager
+++ b/helpers/make-update-manager
@@ -18,7 +18,7 @@
 #    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 #
 
-VERSION=11
+VERSION=12
 
 . ./config
 
@@ -65,6 +65,10 @@ sed '/%s base/ s/name.*/name = "Trisquel base"/' -i ./UpdateManager/Core/UpdateL
 sed 's_https://changelogs.ubuntu.com/changelogs/pool/_https://packages.trisquel.org/changelogs/pool/_' -i UpdateManager/Core/MyCache.py
 sed '/len(changelog) == 0/,/"later."/d' -i UpdateManager/Core/MyCache.py
 
+#Make sure apt_pkg is enabled for prevent-autoconnection.patch to work.
+[ -z "$(grep 'import apt_pkg' UpdateManager/UpdateManager.py)" ] && \
+sed -i '/import distro_info/i import apt_pkg' UpdateManager/UpdateManager.py
+
 changelog "Compiled for Trisquel"
 
 compile