Commit 8ba8e664 authored by Philippe Gauron's avatar Philippe Gauron
Browse files

Merge branch 'desinstallation' into 'master'

Script de désinstallation

See merge request CCThomX/installation!35
parents 75e2cded 7425246a
......@@ -3,77 +3,142 @@
# stop at first error
set -e
## test desinstallation
sudo apt install --assume-yes kdiff3 debconf-utils
## Remove software in reverse order of installation
## préparation test desinstallation
apt install --assume-yes debconf-utils
### Preparation of uninstallation tools ###
DEBIAN_FRONTEND=noninteractive
REPO_DIR=$(pwd)/$(dirname "$0")
echo "REPO_DIR=${REPO_DIR}"
## Removing of ARCHIVING installation packages
sudo apt purge --assume-yes unzip
sudo rm -rf /opt/ArchivingRoot
sudo rm -rf /etc/tangorc
if [ -h /etc/bashrc ]
# supprimer "${SUDO_USER}" de /etc/cron.allow'
if [ -e /etc/cron.allow ]
then
sudo rm -f /etc/bash.bashrc
sed -i -e "/${SUDO_USER}/d" /etc/cron.allow
fi
sudo rm -rf /var/archivage
# supprimer "0 2 * * * ${REPO_DIR}/archive1/delete_unmodified_since.sh > ${ARCHIVING_DIR}/hdbtdb_delete_data_and_diary_files.log" du fichier "/var/spool/cron/crontabs/${USERNAME}"
if [ -e "/var/spool/cron/crontabs/${SUDO_USER}" ]
then
sed -i -e "/hdbtdb/d" "/var/spool/cron/crontabs/${SUDO_USER}"
fi
service cron restart
# remove symbolic link from /etc/bashrc to /etc/bash.bashrc if exists
if [ -L /etc/bashrc ]
then
rm -f /etc/bash.bashrc
fi
# remove tangorc configuration file
rm -f /etc/tangorc
# remove ArchivingRoot files
rm -rf /opt/ArchivingRoot
apt purge --assume-yes unzip
service mysql restart
## Removing of CLIENT installation packages
# libraries for LabView GUIs
apt-get remove --assume-yes libx32gcc-6-dev libgl1-mesa-dev:i386 libxinerama1:i386 ntpdate ntp rdesktop
# Basler Pylon
rm -rf /opt/pylon*
## Removing of TANGO_DB installation packages
# configure dbconfig-common to delete Database and revoke rights
echo 'tango-db tango-db/dbconfig-remove boolean true' | debconf-set-selections
echo 'tango-db tango-db/purge boolean true' | debconf-set-selections
apt purge --assume-yes tango-db
## yat & yat4tango libraries
sudo apt purge --assume-yes subversion pkg-config cmake
sudo rm -f /var/www/phpmyadmin
## libtango-java
sudo apt purge --assume-yes libtango-java
## Removing of TANGO installation packages
## Hggit
sudo pip uninstall -y dulwich
###### TODO : uninstall hg-git
# removing manual installation of libtango-java
apt purge --assume-yes libtango-java
# deleting manual installation yat & yat4tango
rm -rf /usr/lib/{yat,yat4tango}
rm /usr/lib/libyat.so /usr/lib/libyat.so.* /usr/lib/libyat4tango.so /usr/lib/libyat4tango.so.*
apt purge --assume-yes subversion pkg-config cmake
# Remove Hg-git
sed -i -e "/# Hg-Git plugin for Mercurial/d" /etc/mercurial/hgrc
sed -i -e "/hgext.bookmarks =/d" /etc/mercurial/hgrc
sed -i -e "/hggit =/d" /etc/mercurial/hgrc
pip uninstall -y hg-git dulwich
## GUI packages
sudo pip uninstall -y fandango taurus PyYAML QtPy
sudo apt purge --assume-yes python-qt4 qt4-designer pyqt4-dev-tools
sudo apt purge --assume-yes python-pytango python-qtpy python-qwt5-qt4 python-guiqwt python-pymca5 python-ply spyder python-lxml
pip uninstall -y fandango taurus PyYAML QtPy
apt purge --assume-yes python-qt4 qt4-designer pyqt4-dev-tools python-pytango python-qtpy python-qwt5-qt4 python-guiqwt python-pymca5 python-ply spyder python-lxml
## Development packages
sudo apt purge --assume-yes python-dev gcc g++ make xemacs21 man
### tango packages
#### TODO
#### dbconfig-common doit supprimer la base de données et révoquer les déconfigurer tango-db
echo 'dbconfig-common dbconfig-common/dbconfig-remove boolean true' | sudo debconf-set-selections
#### dbconfig-common doit supprimer la base de données et révoquer les droits
#### défaire la configuration de la base de données de tango-db avec dbconfig-common
#### supprimer la base de données pour tango-db
sudo apt purge --assume-yes tango-common tango-starter tango-test python-pytango libtango-doc libtango-dev liblog4j1.2-java
### Oracle 8
echo PURGE | sudo debconf-communicate oracle-java8-set-default
sudo apt purge --assume-yes oracle-java8-installer oracle-java8-set-default #libxrender1 libxtst6
## Removing of TANGODB installation packages
sudo apt purge --assume-yes tango-db
apt purge --assume-yes gcc g++ make xemacs21 man
## TANGO packages
apt purge --assume-yes tango-common tango-starter tango-test libtango-doc libtango-dev liblog4j1.2-java
# supprimer "source /etc/tangorc" de /etc/bash.bashrc'
sed -i -e "/tangorc/d" /etc/bash.bashrc
# supprimer export TANGO_HOST" de /etc/bash.bashrc'
sed -i -e "/TANGO_HOST/d" /etc/bash.bashrc
### Installation of Oracle Java
## Définit les binaires java vers openjdk
update-alternatives --remove java /opt/java/jdk1.8.0_212/bin/java
#update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1
update-alternatives --remove javac /opt/java/jdk1.8.0_212/bin/javac
#update-alternatives --install /usr/bin/java javac /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/javac 1
## Supprime installation java de /opt
rm -rf /opt/java/
## Removing DATABASE installation packages
#echo 'phpmyadmin phpmyadmin/reconfigure-webserver multiselect apache2' | sudo debconf-set-selections
echo PURGE | sudo debconf-communicate phpmyadmin
sudo service mysql stop
sudo apt purge --assume-yes phpmyadmin
echo PURGE | sudo debconf-communicate mariadb-client
echo PURGE | sudo debconf-communicate mariadb-server
sudo apt purge --assume-yes mariadb-client mariadb-server expect
sudo apt purge --assume-yes "mysql*"
sudo rm -rf /etc/mysql/ y
## Removing VIRTUALBOX installation packages
sudo apt purge --assume-yes modules-assistant build-essential
# PHPMyadmin
# remove symbolic link from /var/www/phpmyadmin to /usr/share/phpmyadmin/ if exists
if [ -L /etc/bashrc ]
then
rm -f /etc/bash.bashrc
fi
# remove phpmyadmin
echo 'phpmyadmin phpmyadmin/dbconfig-remove boolean true' | debconf-set-selections
echo 'phpmyadmin phpmyadmin/purge boolean true' | debconf-set-selections
apt purge --assume-yes phpmyadmin
# MariaDB
service mysql stop
echo PURGE | debconf-communicate mariadb-client
echo PURGE | debconf-communicate mariadb-server
apt purge --assume-yes expect mariadb-client mariadb-server
rm -rf /etc/mysql/
rm -f /var/www/phpmyadmin
## Removing common tools for all installations
sudo apt purge --assume-yes host mercurial python-pip
apt purge --assume-yes host mercurial python-pip
## Removing installation tools ###
sudo apt purge --assume-yes debconf dirmngr
apt purge --assume-yes debconf-utils dirmngr
#sudo apt-get update
#sudo apt-get clean
sudo apt-get autoremove --assume-yes
#sudo apt-get upgrade --assume-yes
#sudo apt-get update
apt-get clean
apt-get autoremove --assume-yes
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment