I had issues installing PACS ever since upgrading to DSM 7, which broke the PACS package upgradability. The lack of PACS support for Synology left the issue unresolved for years. The Docker deprecation just added to the queue of problems I needed to resolve, but I hadn't had time to investigate further until now. Since I couldn't find much help online, I decided to document my solution here.
Step 1: Enable SSH Access
To troubleshoot effectively, you need SSH access to your Synology NAS:
Open the Control Panel in DSM.
Navigate to Terminal & SNMP.
Check Enable SSH service (port 22) and apply changes.
Step 2: Connect via SSH
Using a Windows command prompt (or terminal on Linux/Mac), connect to your NAS:
ssh <your-NAS-IP>
Enter your root password when prompted.
Step 3: Attempt Uninstallation
Run the following command to uninstall PACS:
sudo synopkg uninstall PACS
If the uninstall fails, you might see an error message like:
{"action":"prepare","error":{"code":314,"description":"failed to run preuninst script"},"stage":"prepare","success":false}
This means there’s a script issue blocking the uninstallation.
Step 4: Locate the Uninstall Scripts
Navigate to the package scripts directory:
cd /var/packages/PACS/scripts
If you encounter missing environment variables, define them manually. For example, set DCM4CHEE_SHARE_LINK:
export DCM4CHEE_SHARE_LINK=/volume1/pacs
Verify the variable is set correctly:
echo $DCM4CHEE_SHARE_LINK
This should return:
/volume1/pacs
Step 5: Fix Missing Config Files
Check if the config folder exists inside /var/packages/PACS/etc:
ls -al /var/packages/PACS/etc/
If the config folder is missing, create it from backup_config:
cp /var/packages/PACS/etc/backup_config /var/packages/PACS/etc/config
chmod 644 /var/packages/PACS/etc/config
Verify the permissions:
ls -al /var/packages/PACS/etc/
Expected output:
drwxr-xr-x 1 root root 38 Feb 17 15:28 .
drwxr-xr-x 1 root root 1226 Jan 20 11:13 ..
-rw-r--r-- 1 root root 203 Jun 24 2022 backup_config
-rw-r--r-- 1 root root 203 Feb 17 15:28 config
Step 6: Retry Uninstallation
Once the config issue is resolved, run the uninstall command again:
sudo synopkg uninstall PACS
If successful, you should see:
{"action":"prepare","error":{"code":0},"stage":"prepare","success":true}
Step 7: Close SSH and Disable SSH Access
Exit the SSH session:
exit
Then, disable SSH in DSM for security purposes:
Open Control Panel in DSM.
Navigate to Terminal & SNMP.
Uncheck Enable SSH service.
This should successfully uninstall PACS, allowing you to proceed with a fresh installation if needed. If you have any additional issues, feel free to comment below!