Cannot uninstall Sonarr

I have been having issues with Sonarr not launching the GUI, so I’ve decided to wipe the installation and start again.

However upon running the dietpi-software uninstaller, I get the following error

Purging configuration files for sonarr (3.0.10) ...^M
│ rm: cannot remove '/mnt/dietpi_userdata/sonarr/sonarr.db-shm': Is a
│ directory^M
│ dpkg: error processing package sonarr (--purge):^M
│  installed sonarr package post-removal script subprocess returned error exit
│ status 1^M
│ Errors were encountered while processing:^M
│  sonarr^M
│ E: Sub-process /usr/bin/dpkg returned an error code (1)

I cannot figure out how to completely wipe sonarr from the device and do a fresh install. I deleted all the files I could from “/mnt/Media/dietpi_userdata/sonarr” however it will not let me delete ‘sonarr.db-wal’ file and ‘sonarr.db-shm’ directory, even with rm -rf.
Dietpi-software still thinks sonarr is installed so I cannot run a fresh install until it’s completely removed.

Thx

Did you mount the card on a windows system and removed the files there? The ^M indicating this (it’s the Linux representation for the Windows carriage return. But I wonder why they appear in the script output.
Do you have a backup of your system before you made any changes?

can you reboot your system and try

rm -Rf /mnt/dietpi_userdata/sonarr/

post the whole log afterwards if removing is an issue still.

Could this be related to the dietpi_userdata being located on an external hdd that is running samba?
The Dietpi userdata is located at /mtn/Media/dietpi-userdata

No. Did you already tried to reboot and to remove the folder again?

I get this error

rm: cannot remove '/mnt/dietpi_userdata/sonarr/sonarr.db-shm': Is a directory

You need -r flag to remove folders with rm:
rm -r /mnt/dietpi_userdata/sonarr/sonarr.db-shm

I get the following when trying that command

rm: cannot remove '/mnt/Media/dietpi_userdata/sonarr/sonarr.db-shm/': No such file or directory

It’s like the folder is there, but also isn’t at the same time…
I’ve tried all the rm commands including rm -rf etc, never had luck removing these files…

Can you share following

ls -la /mnt/Media/dietpi_userdata/sonarr/

Sure, see below

total 36
drwx------ 1    993 dietpi  4096 Dec 27 16:48 .
drwxr-xr-x 1 dietpi dietpi  4096 Nov 27 12:55 ..
drw------- 1    993 dietpi     0 Dec 27 16:49 sonarr.db-shm
-rw-rw-r-- 1    993 dietpi 24907 Oct 11 16:33 sonarr.db-wal

I just checked on a demo system and sonarr.db-shm should not be a directory at all. Usually, it’s a file.

root@DietPiOPi5:/mnt/dietpi_userdata/sonarr# ls -la
total 388
drwxr-xr-x 2 sonarr dietpi   4096 Dec 30 19:23 .
drwxrwxr-x 7 dietpi dietpi   4096 Dec 30 19:22 ..
-rw-rw-r-- 1 sonarr dietpi    349 Dec 30 19:23 config.xml
lrwxrwxrwx 1 sonarr dietpi     15 Dec 30 19:23 logs -> /var/log/sonarr
lrwxrwxrwx 1 sonarr dietpi     23 Dec 30 19:23 logs.db -> /var/log/sonarr/logs.db
lrwxrwxrwx 1 sonarr dietpi     27 Dec 30 19:23 logs.db-shm -> /var/log/sonarr/logs.db-shm
lrwxrwxrwx 1 sonarr dietpi     27 Dec 30 19:23 logs.db-wal -> /var/log/sonarr/logs.db-wal
-rw-r--r-- 1 sonarr dietpi 348160 Dec 30 19:23 sonarr.db
-rw-r--r-- 1 sonarr dietpi  32768 Dec 30 19:23 sonarr.db-shm
-rw-r--r-- 1 sonarr dietpi      0 Dec 30 19:23 sonarr.db-wal
-rw-rw-r-- 1 sonarr dietpi      4 Dec 30 19:23 sonarr.pid
-rw-r--r-- 1 sonarr dietpi      0 Dec 30 19:22 update_required
root@DietPiOPi5:/mnt/dietpi_userdata/sonar#

Maybe something got corrupted with sonarr.db-shm :thinking:

For testing, we could move the current directory /mnt/dietpi_userdata/sonarr to a temporary place :smiley:

mv /mnt/dietpi_userdata/sonarr /mnt/dietpi_userdata/old.sonarr.old

Can you check if this was sucessfull

ls -la /mnt/dietpi_userdata/

That fixed it!
After moving the directory to old.sonarr.old, I was able to uninstall sonarr via dietpi-software and reinstall it.

All working now, thx

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.