diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2ee34b7e508404db694b7b1bf15e9ca12dcee32d..7d198c486f9dce847a419bb5e41bb65e9d09d0ab 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,4 +1,4 @@
-image: docker.io/labrobotica/labrobotica
+image: docker.io/labrobotica/labrobotica:latest
 
 variables:
   GIT_SUBMODULE_STRATEGY: recursive
@@ -11,7 +11,9 @@ stages:
 build-package:
   stage: build
   script:
-    - apt update
+    - apt update || apt -y install ca-certificates && apt update
+#  Uncomment to install dependencies
+#    - apt -y install iri-<package_name>-dev
     - apt -y install iri-iriutils-dev iri-comm-dev
     - mkdir -pv build
     - cd build
@@ -31,7 +33,7 @@ update_repo:
   script:
     - cd build
     - "scp -i /root/.ssh/iriLabKeyNopwd -r *segway-rmp-200*.deb irilabo@labrepo.iri.upc.edu:packages/"
-    - "ssh irilabo@labrepo.iri.upc.edu -i /root/.ssh/iriLabKeyNopwd -tt /home/irilabo/repo_scripts/update_repo.sh segway-rmp-200"
+    - "ssh irilabo@labrepo.iri.upc.edu -i /root/.ssh/iriLabKeyNopwd -tt /home/irilabo/repo_scripts/update_repo.sh segway-rmp-200 $(lsb_release -cs)"
   only:
     - tags
     
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 19340f165b68ce27eba5429366cd8b8afa2ffb4f..266143443ab7358e78eb1304ca85a03ffa56cc5b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -83,7 +83,7 @@ IF (UNIX)
     SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "labrobotica - labrobotica@iri.upc.edu")
 
   # Uncomment to add the necessary mantainer scripts
-  #   SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_SOURCE_DIR}/scripts/debian/preinst;${CMAKE_SOURCE_DIR}/scripts/debian/postinst;${CMAKE_SOURCE_DIR}/scripts/debian/prerm;${CMAKE_SOURCE_DIR}/scripts/debian/postrm")
+  SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_SOURCE_DIR}/scripts/debian/postinst;${CMAKE_SOURCE_DIR}/scripts/debian/prerm")
 
   # Uncomment to add dependencies comma separated
   # SET(CPACK_DEBIAN_PACKAGE_DEPENDS "iri-<package_name>-dev (>= 1.0~${DISTRIB})")
@@ -95,4 +95,4 @@ IF (UNIX)
       COMMENT "packaging only implemented in unix"
       TARGET  uninstall
     )
-  ENDIF(UNIX)
\ No newline at end of file
+  ENDIF(UNIX)
diff --git a/scripts/debian/postinst b/scripts/debian/postinst
new file mode 100755
index 0000000000000000000000000000000000000000..9ea20f767f10c5a3c14371e7cec7eab427230cf2
--- /dev/null
+++ b/scripts/debian/postinst
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+set -e
+
+case "$1" in
+  configure)
+    echo "   Trying to add library to ldconfig..."
+    /usr/share/iri/add_lib_to_ld_config.sh -l segway_rmp_200 -p && echo "   Done." || echo "   /usr/share/iri/add_lib_to_ld_config.sh doesn't exists. Download it from iriutils and execute it."
+    
+  ;;
+  abort-upgrade)
+
+  ;;
+  abort-remove)
+
+  ;;
+  abort-deconfigure)
+
+  ;;
+esac   
+
+exit 0
diff --git a/scripts/debian/prerm b/scripts/debian/prerm
new file mode 100644
index 0000000000000000000000000000000000000000..097e260d2cd5cde72353443dbd86c1ec1a1ea4f8
--- /dev/null
+++ b/scripts/debian/prerm
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+set -e
+
+case "$1" in
+  remove)
+    echo "   Trying to remove library from ldconfig..."
+    /usr/share/iri/remove_lib_from_ld_config.sh -l segway_rmp_200 -p && echo "   Done." || echo "   /usr/share/iri/remove_lib_from_ld_config.sh doesn't exists. Download it from iriutils and execute it."
+
+  ;;
+  upgrade)
+
+  ;;
+  deconfigure)
+
+  ;;
+  failed-upgrade)
+
+  ;;
+esac    
+
+exit 0