-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Ability to uninstall mas applications. #81
Comments
I am a bit shocked there is no uninstall option! … But I guess the Mac App Store itself does not have an uninstall. |
Apple has never provided a method for uninstalling MAS applications besides the "X" button you can bring up in LaunchPad, or just moving the application to the trash. Because MAS applications are self-contained into a single app bundle, one can make the argument that their removal is trivial compared to applications which come in (often messily-organized) installer packages which run code to place files anywhere on the filesystem. What does add a complication to uninstalling MAS apps, however, is that you must be root to remove them. LaunchPad's removal interface uses some internal Apple magic to not require an admin password, but you'll see a password prompt if you attempt to delete a MAS-installed app from /Applications. |
My current somewhat hacky solution for uninstalling items from a Brewfile involves using the trash_file () {
local item=$1
if [[ -d $item || -f $item ]]; then
echo "Trashing $item"
if test ! $(which trash); then
brew install trash
trash "$item"
brew uninstall trash
else
trash "$item"
fi
fi
}
# Uninstall packages from manifests, named Brewfile
local manifest=Brewfile #local, because this is excerpt from a function
if [[ -f $manifest ]]; then
echo "Checking for manifest packages to remove."
cat "$manifest" | tr -s " " | # squash spaces and pass to loop
{
while read -r line; do
line=${line%,*} # keep up to first comma
line=${line//\'/} # hope package names don't contain single quotes
line=${line//\"/} # hope package names don't contain double quotes
case $line in
'#'* ) ;; # ignore comments
'brew '* ) brew uninstall "${line#brew }" ;;
'cask '* ) brew cask uninstall "${line#cask }" ;;
'mas '* ) trash_file "/Applications/${line#mas }.app" ;;
* ) echo "Unsure how to handle line: $line" ;;
esac
done
}
fi |
++ on this feature, helps a lot when using Brewfile + mas to setup new macs |
This feature is now available in mas 1.5.0. Thanks for the suggestion, @aaranmcguire! |
I'd like the ability to uninstall/remove applications installed via the mac app store, this would be useful to remove the default applications that are installed when purchasing a new mac (Keynote, Pages, etc).
The text was updated successfully, but these errors were encountered: