[Solved]how to clean dietpi from useless software

Hi girls and guys,
I more or less just finished creating my own cloud with a raspberry pi zero w, dietpi as OS, and Owncloud to manage the cloud.
Since I made a lot of tests before finding the right configuration I installed a lot of software.
This is what I have installed since now:

│    [ ] 5    ALSA: Advanced Linux Sound Architecture
│    [ ] 6    X.Org X Server: aka X11 - X Window System implementation
│    [ ] 9    Node.js: JavaScript runtime environment
│    [ ] 16   Build-Essential: GNU C/C++ compiler, development libraries and hea
│    [ ] 17   Git: Clone and manage Git repositories locally
│    [ ] 47   ownCloud: File sync, sharing and collaboration platform
│    [ ] 69   Python 3 RPi.GPIO: Control Raspberry Pi GPIO channels in Python 3
│    [ ] 77   Grafana: platform for analytics and monitoring
│    [ ] 84   Lighttpd: Extremely lightweight webserver
│    [ ] 87   SQLite: Persistent single-file database system
│    [ ] 88   MariaDB: Persistent cached file-per-table database server
│    [ ] 89   PHP: Hypertext Preprocessor for dynamic web content
│    [ ] 91   Redis: Volatile in-memory non-SQL database server
│    [ ] 93   Pi-hole: block adverts for any device on your network
│    [ ] 96   Samba Server: Feature-rich SMB/CIFS server
│    [ ] 103  DietPi-RAMlog: Makes /var/log a RAM disk, preserves file structure
│    [ ] 104  Dropbear: Lightweight SSH server

Can someone tell me which software is useless for my purposes? I know some of them are necessary, but I’m afraid to delete something wrong.
I have just to use Owncloud and, in case of necessity, the ssh console.
Thanks again in advance for any support

well do you really just need OwnCloud? because you have quite some other software installed that have completely different purposes like PiHole, Grafana and Samba.

For the moment I need only owncloud, even if, as posted in another topic, pihole is necessary to reach the server in and outside of the own network.
But the rest are just some tests made in unsuspected times :wink:.
Which software is useless then?

do a backup first before removing thinks. I guess following might not be needed

│    [ ] 5    ALSA: Advanced Linux Sound Architecture
│    [ ] 6    X.Org X Server: aka X11 - X Window System implementation
│    [ ] 9    Node.js: JavaScript runtime environment
│    [ ] 16   Build-Essential: GNU C/C++ compiler, development libraries and hea
│    [ ] 77   Grafana: platform for analytics and monitoring
│    [ ] 96   Samba Server: Feature-rich SMB/CIFS server

ok, now I have to learn something new:
How do I do a backup? :slight_smile:
Do I need some external drive, or can I use the drive installed in the owncloud? Even if I guess using it I’m not able to access the data if something happens. Isn’t it?

personally I would use a separat usb pen stick to backup the system. If i’m not mistaken this will exclude your owncloud data directory by default. But this is not an issue as we just need to backup the system as we remove software. Theoretically you could try to backup on your ownlcoud drive. Just run dietpi-backup and adjust location on your needs.

The backup is done but something happens…
Now Owncloud is not working anymore.
How is it possible?
p.s. looking at the installed software, Owncloud is still there

Did you already removed something or was just the backup done. What is the status of all services

dietpi-services sratus

I just made the backup.
This is the status:

root@DietPi:~# dietpi-services status

 DietPi-Services
─────────────────────────────────────────────────────
 Mode: status 

[ INFO ] DietPi-Services | nmbd                  inactive (dead)
[ INFO ] DietPi-Services | smbd                  inactive (dead)
[ INFO ] DietPi-Services | redis-server          inactive (dead)
[ INFO ] DietPi-Services | mariadb               inactive (dead)
[ INFO ] DietPi-Services | php7.4-fpm            inactive (dead)
[FAILED] DietPi-Services | ● lighttpd.service - Lighttpd Daemon
     Loaded: loaded (/lib/systemd/system/lighttpd.service; disabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Mon 2021-12-20 17:49:50 CET; 2h 54min ago
    Process: 24960 ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf (code=exited, status=1/FAILURE)
   Main PID: 24960 (code=exited, status=1/FAILURE)
        CPU: 2min 18.573s

Dec 20 17:49:50 DietPi systemd[1]: Stopping Lighttpd Daemon...
Dec 20 17:49:50 DietPi systemd[1]: lighttpd.service: Main process exited, code=exited, status=1/FAILURE
Dec 20 17:49:50 DietPi systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Dec 20 17:49:50 DietPi systemd[1]: Stopped Lighttpd Daemon.
Dec 20 17:49:50 DietPi systemd[1]: lighttpd.service: Consumed 2min 18.573s CPU time.
Warning: journal has been rotated since unit was started, output may be incomplete.
[ INFO ] DietPi-Services | grafana-server        inactive (dead)
[ INFO ] DietPi-Services | cron                  inactive (dead)
[  OK  ] DietPi-Services | dropbear              active (running) since Sun 2021-12-12 18:17:11 CET; 1 weeks 1 days ago
[  OK  ] DietPi-Services | pihole-FTL            active (running) since Mon 2021-12-13 15:56:19 CET; 1 weeks 0 days ago
[  OK  ] DietPi-Services | openvpn               active (exited) since Sun 2021-12-12 18:17:14 CET; 1 weeks 1 days ago
[  OK  ] DietPi-Services | unbound               active (running) since Sun 2021-12-12 18:17:15 CET; 1 weeks 1 days ago
[ INFO ] DietPi-Services | dietpi-vpn            inactive (dead)
[ INFO ] DietPi-Services | dietpi-cloudshell     inactive (dead)
[  OK  ] DietPi-Services | dietpi-ramlog         active (exited) since Sun 2021-12-12 18:17:11 CET; 1 weeks 1 days ago
[  OK  ] DietPi-Services | dietpi-preboot        active (exited) since Sun 2021-12-12 18:17:13 CET; 1 weeks 1 days ago
[  OK  ] DietPi-Services | dietpi-postboot       active (exited) since Sun 2021-12-12 18:17:14 CET; 1 weeks 1 days ago
[ INFO ] DietPi-Services | dietpi-wifi-monitor   inactive (dead)
root@DietPi:~#

hmm your web server is failing. Can you try following

systemctl restart lighttpd.service
journalctl -u lighttpd.service
cat /var/log/lighttpd/error.log

This is the output after restarting the services:

root@DietPi:~# journalctl -u lighttpd.service
-- Journal begins at Mon 2021-12-20 09:39:38 CET, ends at Tue 2021-12-21 17:53:37 CET. --
Dec 20 17:49:50 DietPi systemd[1]: Stopping Lighttpd Daemon...
Dec 20 17:49:50 DietPi systemd[1]: lighttpd.service: Main process exited, code=exited, status=1/FAILURE
Dec 20 17:49:50 DietPi systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Dec 20 17:49:50 DietPi systemd[1]: Stopped Lighttpd Daemon.
Dec 20 17:49:50 DietPi systemd[1]: lighttpd.service: Consumed 2min 18.573s CPU time.
Dec 21 17:53:33 DietPi systemd[1]: Starting Lighttpd Daemon...
Dec 21 17:53:37 DietPi systemd[1]: Started Lighttpd Daemon.

And this is for the third command:

root@DietPi:~# cat /var/log/lighttpd/error.log
2021-12-20 16:23:52: connections.c.750) invalid request-line -> sending Status 400
2021-12-20 16:49:50: server.c.1976) server stopped by UID = 0 PID = 1
2021-12-21 17:53:37: server.c.1513) server started (lighttpd/1.4.59)
2021-12-21 17:54:29: gw_backend.c.238) establishing connection failed: socket: unix:/run/php/php7.4-fpm.sock: No such file or directory
2021-12-21 17:54:29: gw_backend.c.970) all handlers for /owncloud/status.php? on .php are down.
2021-12-21 17:54:31: gw_backend.c.315) gw-server re-enabled: unix:/run/php/php7.4-fpm.sock  0 /run/php/php7.4-fpm.sock

hmm the web server seems to be started but somehow PHP looks down. Can you try to reinstall

dietpi-software reinstall 47 84 88 89 93

Done, and now everything is working again properly. :slight_smile:
Should I try to back up again before removing the above-listed software?

Yes try to backup again.

The backup has been done and also I tried to clean up the system from the dietpi-software.
Unfortunately, when cleaning up it shows me this kind of error:

 - Command: userdel grafana                                                                                          │ 
                                          │  - Exit code: 8                                                                                                      │ 
                                          │  - DietPi version: v7.9.3 (MichaIng/master) | HW_MODEL: 1 | HW_ARCH: 1 | DISTRO: 6                                   │ 
                                          │  - Image creator: DietPi Core Team                                                                                   │ 
                                          │  - Pre-image: from scratch                                                                                           │ 
                                          │  - Error log:                                                                                                        │ 
                                          │ userdel: user grafana is currently used by process 311                                                               │ 
                                          │                                                                                                                      │ 
                                          │                         Retry          : Re-run the last command that failed                                         │ 
                                          │                         DietPi-Config  : Edit network, APT/NTP mirror settings etc                                   │ 
                                          │                         Open subshell  : Open a subshell to investigate or solve the issue                           │ 
                                          │                         Send report    : Uploads bugreport containing system info to DietPi                          │ 
                                          │                                        ●─ Devs only ──────────────────────────────────────●                          │ 
                                          │                         Change command : Adjust and rerun the command

With a big blue background…
I think the problem is Grafana, but I don’t know how to remove it, since it is in progress.

user seems to be blocked and can’t be removed. Just kill the process and repeat

kill 311

Great Job,
now I cleaned up the Pi.
Thanks again for the support.