diff --git a/CMakeLists.txt b/CMakeLists.txt
index 84baf9d1396f62c8e7b77b1a6c4ee5ed04e7ca52..225761cc277f4467c6bc3ea308434d36491e85bc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -102,7 +102,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}/package_scripts/preinst;${CMAKE_SOURCE_DIR}/package_scripts/postinst;${CMAKE_SOURCE_DIR}/package_scripts/prerm;${CMAKE_SOURCE_DIR}/package_scripts/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})")
diff --git a/scripts/add_lib_to_ld_config.sh b/scripts/add_lib_to_ld_config.sh
new file mode 100755
index 0000000000000000000000000000000000000000..280b3949e6c77589358f5cc6991720d22f2f3e94
--- /dev/null
+++ b/scripts/add_lib_to_ld_config.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+set -e
+
+FILE="/etc/ld.so.conf.d/iri.conf"
+LIB=
+LOCAL="local/"
+
+usage() {
+  echo "Usage: $0 -l <library> [-p]"
+  echo " -l  specify library name"
+  echo " -p  specify if installed from package. Optional."
+  exit 1
+  }
+
+while getopts ":hl:p" arg; do
+  case $arg in
+    l) LIB=$OPTARG;;
+    p) LOCAL="";;
+    h) usage;;
+    *) usage;;
+  esac
+done
+
+if [ -z "$LIB" ]
+then
+  echo "Error: no library specified"
+  usage
+fi
+
+sudo touch $FILE
+LINE="/usr/${LOCAL}lib/iri/${LIB}"
+echo "Adding ${LINE} to ${FILE}..."
+grep -qF -- "$LINE" "$FILE" || echo "$LINE" | sudo tee -a "$FILE" > /dev/null
+
+sudo ldconfig
+
+echo "Done."
diff --git a/scripts/debian/postinst b/scripts/debian/postinst
new file mode 100755
index 0000000000000000000000000000000000000000..bc45b96f765aecd8c13d81d8d1e89ae52c71cb0b
--- /dev/null
+++ b/scripts/debian/postinst
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+set -e
+
+case "$1" in
+  configure)
+
+    echo "  Adding iri-scripts-path.sh to /etc/profile.d..."
+    FILE="/etc/profile.d/iri-scripts-path.sh"
+    sudo echo "# Expand PATH to include the directory where IRI scripts go." > $FILE
+    sudo echo "iri_script_path=\"/usr/local/share/iri:/usr/share/iri\"" >> $FILE
+    sudo echo "if [ -n \"\${PATH##*\${iri_script_path}}\" -a -n \"\${PATH##*\${iri_script_path}:*}\" ]; then" >> $FILE
+    sudo echo "    export PATH=\$PATH:\${iri_script_path}" >> $FILE
+    sudo echo "fi" >> $FILE
+    echo "  Done. It's necessary a log out for changes to take effect."
+
+    echo "   Trying to add library to ldconfig..."
+    /usr/share/iri/add_lib_to_ld_config.sh -l iriutils -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..e1d5ab76092ee339636085b04a85e196c50a6738
--- /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 iriutils -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
diff --git a/scripts/remove_lib_from_ld_config.sh b/scripts/remove_lib_from_ld_config.sh
new file mode 100755
index 0000000000000000000000000000000000000000..23a30cd98133f3b5a18e08ca4e6caf08854d6804
--- /dev/null
+++ b/scripts/remove_lib_from_ld_config.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+set -e
+
+FILE="/etc/ld.so.conf.d/iri.conf"
+LIB=
+LOCAL="local\/"
+
+usage() {
+  echo "Usage: $0 -l <library> [-p]"
+  echo " -l  specify library name"
+  echo " -p  specify if installed from package. Optional."
+  exit 1
+  }
+
+while getopts ":hl:p" arg; do
+  case $arg in
+    l) LIB=$OPTARG;;
+    p) LOCAL="";;
+    h) usage;;
+    *) usage;;
+  esac
+done
+
+if [ -z "$LIB" ]
+then
+  echo "Error: no library specified"
+  usage
+fi
+
+sudo touch $FILE
+echo "Removing /usr/${LOCAL}lib/iri/${LIB} from ${FILE}..."
+LINE="\/usr\/${LOCAL}lib\/iri\/${LIB}"
+sudo sed -i "/$LINE/d" $FILE
+
+
+sudo ldconfig
+
+echo "Done."
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 014393509d850680e52fee6a6f109eb8924e1e1e..9dbcf76d87a86f697fdf29aa8662f77998b75705 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -28,4 +28,10 @@ INSTALL(FILES ${headers} DESTINATION include/iri/${PROJECT_NAME})
 
 INSTALL(FILES ../Findiriutils.cmake DESTINATION ${CMAKE_ROOT}/Modules/)
 
+INSTALL(FILES  ../scripts/add_lib_to_ld_config.sh 
+               ../scripts/remove_lib_from_ld_config.sh 
+               DESTINATION share/iri
+               PERMISSIONS OWNER_EXECUTE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_READ WORLD_EXECUTE)
+
+
 ADD_SUBDIRECTORY(examples)