Skip to content
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

Brew uninstall fails when upgrading #568

Closed
211217613 opened this issue Dec 13, 2021 · 14 comments
Closed

Brew uninstall fails when upgrading #568

211217613 opened this issue Dec 13, 2021 · 14 comments

Comments

@211217613
Copy link

When updating git-credential-manager-core brew fails stating that the uninstall script is missing.

 brew upgrade git-credential-manager-core                                                    master
==> Upgrading 1 outdated package:
microsoft/git/git-credential-manager-core 2.0.567.18224 -> 2.0.605.12951
==> Upgrading git-credential-manager-core
==> Downloading https://github.com/GitCredentialManager/git-credential-manager/releases/download/v2.0.605/gcmcore-osx-
Already downloaded: ~/Library/Caches/Homebrew/downloads/efd28fb1fc4a96bfbb53fca6b58fe2935793d902e6ed9ee8179f6627a611a8f3--gcmcore-osx-2.0.605.12951.pkg
==> Running uninstall script /usr/local/share/gcm-core/uninstall.sh
==> Purging files for version 2.0.605.12951 of Cask git-credential-manager-core
Error: microsoft/git/git-credential-manager-core: uninstall script /usr/local/share/gcm-core/uninstall.sh does not exist.
@ldennington
Copy link
Contributor

Hello -

It seems your local uninstall.sh script has gone missing. I removed my local copy of uninstall.sh and was able to retrieve it by running the following:

cd /usr/local/share/gcm-core &&
sudo curl \
-H 'Accept: application/vnd.github.v3.raw' \
-O \
-L https://api.github.com/repos/GitCredentialManager/git-credential-manager/contents/src/osx/Installer.Mac/uninstall.sh &&
sudo chmod +x uninstall.sh

After that, I believe brew upgrade git-credential-manager-core should work as expected.

@211217613
Copy link
Author

I think there might be something else going on.

I don't have a /usr/local/share/ directory.
Here's the output for brew info git-credential-manager-core

[~] % brew info git-credential-manager-core
git-credential-manager-core: 2.0.605.12951
https://aka.ms/gcm
/opt/homebrew/Caskroom/git-credential-manager-core/2.0.567.18224 (44.1MB)
From: https://github.com/microsoft/homebrew-git/blob/HEAD/Casks/git-credential-manager-core.rb
==> Name
Git Credential Manager
==> Description
None
==> Artifacts
gcmcore-osx-2.0.605.12951.pkg (Pkg)

@ldennington
Copy link
Contributor

Ah, I see now, your install location is different. Can you run the following and share your output?

ls -lsa /usr/local/bin | grep git-credential-manager-core

@211217613
Copy link
Author

`

Ah, I see now, your install location is different. Can you run the following and share your output?

ls -lsa /usr/local/bin | grep git-credential-manager-core

[~/Downloads] % ls -lsa /usr/local/bin
ls: /usr/local/bin: No such file or directory

Let me give you some more debug data.
brew config

[~/Downloads] % brew config
HOMEBREW_VERSION: 3.3.8
ORIGIN: https://github.com/Homebrew/brew
HEAD: 3f0b412951996a675b8a48037e9a978f0ccd8363
Last commit: 2 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: d5142ed45b63c0471e0f693cbb24b23afd7f2889
Core tap last commit: 2 days ago
Core tap branch: master
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_CORE_GIT_REMOTE: https://github.com/Homebrew/homebrew-core
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.8 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: octa-core 64-bit arm_firestorm_icestorm
Clang: 13.0.0 build 1300
Git: 2.30.1 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.77.0 => /usr/bin/curl
macOS: 12.0.1-arm64
CLT: 13.1.0.0.1.1633545042
Xcode: N/A
Rosetta 2: false

@ldennington
Copy link
Contributor

The default HOMEBREW_PREFIX is /usr/local on non-Apple silicon machines. However, it looks like for Apple Silicon it's been updated to /opt/homebrew. This is something we will need to account for on our end. I've created #574 to track.

Based on the output you shared above, it looks like GCM did at least update to the latest version. However, if you are experiencing issues with this installation, I would recommend running brew uninstall git-credential-manager-core then following the instructions in the README to install the latest package from the releases page. Note that you will likely have to right click on the package in your Downloads directory and select Open with -> Installer to do this as a result of some signing issues we are currently working through.

@ldennington
Copy link
Contributor

Closing in favor of #574.

@surya-prakash-susarla
Copy link

surya-prakash-susarla commented Nov 26, 2022

This happens again on my Mac M2 machine and only started showing up recently, I cannot uninstall it though homebrew because the uninstall script is missing (if it's of any help I installed it using homebrew in the first place). Please let me know if there are any workarounds for this. Thanks!

EDIT: I did get past this by re-installing the cask but I still feel that it shouldn't be the go to option since the original issue has been closed for a while now.

@ericraymond
Copy link

+1

@cjemison
Copy link

cjemison commented Dec 1, 2022

+1 thanks @Surya-06

@AlbanSagouis
Copy link

+1

@jerryrt
Copy link

jerryrt commented Dec 16, 2022

Seems this issue has no active feedback yet, I will give a dirty work-around here for a quick fix. At least it didn't stop me from upgrading my "brew" packages after it.

Just write a simple script and put it on "/opt/homebrew/share/gcm-core/uninstall.sh" (or wherever it complains), make it executable. Mine was:

#!/bin/sh

exit 0

Then the upgrade will happily accept this script and no complains at all.

@surya-prakash-susarla
Copy link

Same thing repeated again now and I had to re-install again. It would be great if the issue can be re-opened and looked at. Thanks!

@ldennington
Copy link
Contributor

We’ve fixed this for new installs going forward. The workaround for those still affected is to uninstall using the following commands:

brew uninstall --cask --force git-credential-manager-core
/usr/local/share/gcm-core/uninstall.sh

Then re-install with the following commands:

brew update
brew install --cask git-credential-manager-core

@mojeeto
Copy link

mojeeto commented Jan 7, 2023

Hello -

It seems your local uninstall.sh script has gone missing. I removed my local copy of uninstall.sh and was able to retrieve it by running the following:

cd /usr/local/share/gcm-core &&
sudo curl \
-H 'Accept: application/vnd.github.v3.raw' \
-O \
-L https://api.github.com/repos/GitCredentialManager/git-credential-manager/contents/src/osx/Installer.Mac/uninstall.sh &&
sudo chmod +x uninstall.sh

After that, I believe brew upgrade git-credential-manager-core should work as expected.

it works for me, THANKS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants