+# Checks if there is is a version indication and if it is for "master"
+if [[ -n "${OSM_VERSION}" && "${OSM_VERSION}" = "master" ]]
+then
+ sudo apt-get remove -y python3-osmclient
+ sudo apt-get install python3-pip libcurl4-openssl-dev libssl-dev
+
+ # Upgrade pip and install dependencies (python-magic, osm-im)
+ # Next instructions install the dependencies at system level with sudo -H
+ sudo -H python3 -m pip install -U pip
+ sudo -H python3 -m pip install python-magic
+ sudo -H python3 -m pip install git+https://osm.etsi.org/gerrit/osm/IM --upgrade
+
+ # Clone the osmclient repo and install OSM client from the git repo.
+ git clone https://osm.etsi.org/gerrit/osm/osmclient
+ curl -Lo osmclient/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg
+ chmod u+x osmclient/.git/hooks/commit-msg
+ # Install osmclient using pip3 with the --user and -e options
+ python3 -m pip install --user -e osmclient
+fi
+