Skip to content
This repository has been archived by the owner on Jul 27, 2024. It is now read-only.

Latest commit

 

History

History
120 lines (88 loc) · 2.77 KB

Cleanup.md

File metadata and controls

120 lines (88 loc) · 2.77 KB

How to cleanup (Ubuntu)

Almost all in one place

This removes files from system, drps database. Installed from repositories or compiled software must remove manually.

su - postgres << EOF
psql -c 'DROP DATABASE IF EXISTS librephotos;'
psql -c 'DROP USER IF EXISTS librephotos;'
exit
EOF
systemctl disable librephotos-backend
systemctl disable librephotos-worker.service
systemctl disable librephotos-image-similarity.service
systemctl disable librephotos-thumbnail.service
systemctl disable librephotos-backend
rm -r /etc/systemd/system/librephotos-*
userdel -fr librephotos
rm -r $BASE_DATA/data_models/
rm -r $BASE_DATA/protected_media
rm -r /etc/librephotos/
rm -r /var/log/librephotos
unlink /usr/sbin/librephotos-cli
rm /etc/nginx/sites-enabled/librephotos
rm /etc/nginx/sites-available/librephotos
service nginx reload

Some explanation what to clean up.

Compiled software uninstallation

Go to the source folder, and run

make uninstall

Or dirty way: Delete all releated files in the /usr/local/include, also check in the /usr/local/.... documentation files, etc.

Sometimes Librephotos not starting after installation. If on the systems left some old compiled packages, will result version mismatch, and gunicorn (backend) will not start. Uninstall compiled (local) software and try again.

Cleanup database by droping it and user

su - postgres << EOF
psql -c 'DROP DATABASE IF EXISTS librephotos;'
psql -c 'DROP USER IF EXISTS librephotos;'
exit
EOF

Delete system user and remove HOME

Default home /usr/lib/librephotos. This action removes frontend, backend and all other files in the librephotos home.

userdel -fr librephotos

Disabling systemd services

systemctl disable librephotos-backend
systemctl disable librephotos-worker.service
systemctl disable librephotos-image-similarity.service
systemctl disable librephotos-thumbnail.service
systemctl disable librephotos-backend

And removing service files:

rm -r /etc/systemd/system/librephotos-*

Cleanup folders

logs

rm -r /var/log/librephotos

thumbails, some software like places, clips-embeddings, etc). Photo not touching in the $BASE_DATA/data

rm -r $BASE_DATA/data_models/
rm -r $BASE_DATA/protected_media
rm -r /etc/librephotos/

unlinking

unlink /usr/sbin/librephotos-cli

nginx

virtual host. Only if nginx were before librephotos installation

rm /etc/nginx/sites-enabled/librephotos
rm /etc/nginx/sites-available/librephotos
service nginx reload

if nginx installed by the script

systemctl stop nginx
apt remove --purge nginx

Other software.

If software are only for librephotos, postgresql. All other not recommend - maybe it is used to other purposes.