Complete uninstall gitlab-ce from ubuntu 14

Hello,

So I installed gitlab-ce on my Ubuntu server via the instructions to run these commands

curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
sudo apt-get install gitlab-ce
And then I did gitlab-ctl reconfigure

I finally was able to stop enough processes to actually apt-get remove gitlab-ce but there is A TON of residual software (Unicorn Server, Redis, Sidekiq, Postgres, etc…) installed on my system under the /opt/gitlab and /var/opt/gitlab directories that are still there.

What is the correct and FULL way to uninstall everything that was installed with the above install script? I don’t want any of the residual software left on my system.

It took me about 20+ minutes to finally stop all the TONS of crap that was running alongside gitlab, to finaly free up my port 80 and re-run my Apache server which was my production web-server that was offline as a result of my regreatble Gitlab install… Its my fault for installing it alongside my production web-server for 5-10 mission critical sites, but I finally was able to restart my apache server without getting port 80 conflict errors - but I have not ofund a way to remove the residual gitlab-ce software off my system.

I did not want to just start deleting those gitlab folders I mentioned above, and corrupting / orphaning the remaining software that (I would assume) was installed into other locations aside from /opt/gitlab and /var/opt/gitlab.

Any help would be much apreciated - because I have a strong suspicion that all those servers will start back up if I ever do a system restart and cause me the same issues.

Is there another script (a sister script to the one I installed Gitlab with - https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh ) that I can use to uninstall everything that it installed initially.

Thanks

3 Likes

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

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

Furthermore, gitlab-ce uses these directories (as described here)

/opt/gitlab holds application code for GitLab and its dependencies.

/var/opt/gitlab holds application data and configuration files that gitlab-ctl reconfigure writes to.

/etc/gitlab holds configuration files for omnibus-gitlab. These are the only files that you should ever have to edit manually.

/var/log/gitlab contains all log data generated by components of omnibus-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

1 Like

Thank you for your post, I inadvertently installed gitlab on a machine that didn’t have the free disk space for it and it filled the drive to 0 bytes free. After many failed uninstall attempts, this is what finally resolved my issue.

IMHO “gitlab-ctl uninstall” should do as advertised, this almost feels like it needs to be a bug report but just glad it’s over.

Thank GOD. Thank you!

Happy to be rid of this resource hogging POS.

whats wrong with the plain and simple sudo apt remove gitlab-ce ?

You can even use the apt-get purge command instead of remove, and then it would have deleted everything. If anything remains after a purge, then you can just remove the remaining directories, /etc/gitlab, /opt/gitlab, /var/opt/gitlab, and all done.

Even if you did a apt-get remove, you can then do something like this:

aptitude purge ~c

not sure if apt-get purge ~c would work, but it can be tried, but the aptitude one does definitely work, have been using it for at least 5 - 10 years.

Which will then remove any configuration files left behind from packages that were removed from the system.

Gitlab should be installed on it’s own server, and not bundle it on a server with a ton of other services, as you are just asking for problems. Especially with Apache/Nginx if they are already running on port 80/443. If you want to do that on a single server, then you need to ensure that the machine has two IP addresses so that Apache/Nginx for your web server can bind to one IP, and then gitlab configure to bind to the other IP. My configuration is exactly like that. If you just install it on a server without investigating beforehand the requirements or reading the documentation, then you cannot blame Gitlab for it.