Uninstallation
Removing an application installed with APM means cleaning up its files, symlinks, desktop entries, and any shared dependencies that are no longer needed.
Removing the application
The installer should delete the application’s version directory from the store:
~/.local/share/apm/apps/helix/25.1.0/
If no other versions of the application remain, the entire application directory (~/.local/share/apm/apps/helix/) can be removed.
Removing symlinks
The installer should remove the symlink in ~/.local/bin/ that points to the uninstalled version. If other versions are still installed, the default symlink should be updated to point to the highest remaining semver version:
~/.local/bin/hx → ~/.local/share/apm/apps/helix/24.7.0/AppRun
If no versions remain, both the default and any versioned symlinks should be removed.
Removing desktop entries and icons
If the application installed a .desktop file or icon, the installer should remove them from ~/.local/share/applications/ and ~/.local/share/icons/.
Garbage collecting the store
Shared dependencies in ~/.local/share/apm/store/ may still be used by other applications. The installer should not delete a file from the store unless no installed application references it. A simple approach is to scan the dependencies.json of every remaining application and remove any store entry whose hash is no longer referenced.