mas: š [BUG] mas uninstall does not work on macOS 11.1
Your Environment
- mas version: 1.7.1
- macOS version: 11.1
mas Install Method
brew install mas(homebrew-core)
Describe the Bug
mas uninstall [id] complains it needs root permissions to uninstall but sudo mas uninstall [id] says the app is not installed.
To Reproduce
Steps to reproduce the behavior:
- Install an app;
mas install [id] - Uninstall the app with
sudo mas uninstall [id]
Expected Behavior
Moves the app to the Trash Bin
Actual Behavior
It will say: Error: not installed
Screenshots, Terminal Output

Additional Context
None
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 23
- Comments: 16
Works with
sudo -sif that helps anyone, but things end up in rootās trash:same issue on:
So mas hasnāt had an uninstall function in 3 years?
Itās a permission issue related to macOSās security sandbox : When you use sudo, the command is ran with root privileges and in the root environment, but doesnāt have access to your user-specific App Store data. This is why the
mascommand is unable to see the installed apps and uninstall them. You can verify this by runningmas list(will show your apps) andsudo mas list(will be empty).To fix this, Iām afraid weāll need something like a Privileged Helper Tool (https://developer.apple.com/library/archive/documentation/Security/Conceptual/SecureCodingGuide/Articles/AccessControl.html#//apple_ref/doc/uid/TP40007244-SW5). A working example of this can be found under āEvenBetterAuthorizationSampleā.
Unfortunately Iām not experienced with Swift, otherwise Iād look into this, but thatās basically whatās going on.
(related?: https://github.com/mas-cli/mas/issues/417)
Same issue here, my
masā version is1.8.2andmacOSis11.4.