Skip to content

Instantly share code, notes, and snippets.

@puppywang
Created August 20, 2018 03:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save puppywang/7e357ee38ec466653140c1b4a9f2c1e6 to your computer and use it in GitHub Desktop.
Save puppywang/7e357ee38ec466653140c1b4a9f2c1e6 to your computer and use it in GitHub Desktop.
Complete remove gitlab new version and install old version
#! /bin/sh
#This worked for me in Ubuntu 16 and let me install an older version of gitlab: https://askubuntu.com/questions/824696/is-it-fine-to-remove-the-opt-gitlab-directory-manually-after-removing-the-gitl 213
#Remove services
sudo gitlab-ctl uninstall
#Clean any data generated by usage of the package
sudo gitlab-ctl cleanse
#You may also want to remove any accounts you configured. To do so
sudo gitlab-ctl remove-accounts
#Then remove the package using
#sudo dpkg -P gitlab-ce
yum remove gitlab-ce -y
#Furthermore, gitlab-ce uses these directories (as described here 368)
# /opt/gitlab holds application code for GitLab and its dependencies.
rm -rf /opt/gitlab
# /var/opt/gitlab holds application data and configuration files that gitlab-ctl reconfigure writes to.
rm -rf /var/opt/gitlab
# /etc/gitlab holds configuration files for omnibus-gitlab. These are the only files that you should ever have to edit manually.
rm -rf /etc/gitlab
# /var/log/gitlab contains all log data generated by components of omnibus-gitlab.
rm -rf /var/log/gitlab
#So, First remove the package recommended way (Even if you need to reinstall it). You can then remove those data using rm safely.
#Information found from omnibus-gitlab README page 368
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment