How To fix Can't update or upgrade Homebrew - homebrew

How To fix Can't update or upgrade Homebrew
I can no longer run either brew upgrade or brew update: both abort with
Error: homebrew-core is a shallow clone. To `brew update` first run:
git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" fetch --unshallow
and if I follow this suggestion and run git ... --unshallow
and if I follow this suggestion and run git ... --unshallow and then try brew update or brew upgrade I still get the same error message.
If I then try the command again (maybe I didn't do it right the first time?) I get
fatal: --unshallow on a complete repository does not make sens`e
How do I get past this error message to run brew upgrade or brew update without errors?
HOMEBREW_VERSION: 2.6.0-82-gde1afcb
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: de1afcbfc58fb3cd5779bd8fbb6b9995700dda4c
Last commit: 30 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: a7c63b0f7f7ae416a2f961b263155281759ac3a7
Core tap last commit: 29 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.FwPJPzeLfq/org.macosforge.xquartz:0
HOMEBREW_EDITOR: /usr/local/bin/bbedit
HOMEBREW_MAKE_JOBS: 4
HOMEBREW_NO_ANALYTICS: set
HOMEBREW_NO_EMOJI: set
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: quad-core 64-bit haswell
Clang: 12.0 build 1200
Git: 2.29.2 => /usr/local/bin/git
Curl: 7.64.1 => /usr/bin/curl
Java: 1.8.0_172
macOS: 10.15.7-x86_64
CLT: 12.0.32.27
Xcode: 12.2
XQuartz: 2.7.11 => /opt/X11
Please Help me i was tired Thanks!

Basically if you see the following error then run what is suggesting you, but could take some time maybe between 5 and 10 minutes depending on how fast is your system:
Error:
homebrew-core is a shallow clone.
homebrew-cask is a shallow clone.
To `brew update`, first run:
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
I hope that answered your question to you or someone else, good luck.

Related

Homebrew installation failed

I was trying to install Homebrew today on my freshly setup Linux ubuntu. I installed curl and git as usual but when trying to install Homebrew, I got this in my Terminal:
david#david-ThinkPad-T460p:~$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
==> Checking for `sudo` access (which may request your password)...
==> This script will install:
/home/linuxbrew/.linuxbrew/bin/brew
/home/linuxbrew/.linuxbrew/share/doc/homebrew
/home/linuxbrew/.linuxbrew/share/man/man1/brew.1
/home/linuxbrew/.linuxbrew/share/zsh/site-functions/_brew
/home/linuxbrew/.linuxbrew/etc/bash_completion.d/brew
/home/linuxbrew/.linuxbrew/Homebrew
==> HOMEBREW_BREW_GIT_REMOTE is set to a non-default URL:
... will be used as the Homebrew/brew Git remote.
==> HOMEBREW_CORE_GIT_REMOTE is set to a non-default URL:
... will be used as the Homebrew/homebrew-core Git remote.
Press RETURN/ENTER to continue or any other key to abort:
==> /usr/bin/sudo /bin/chown -R david:david /home/linuxbrew/.linuxbrew/Homebrew
==> Downloading and installing Homebrew...
fatal: '...' does not appear to be a git repository
fatal: Konnte nicht vom Remote-Repository lesen.
Bitte stellen Sie sicher, dass die korrekten Zugriffsberechtigungen bestehen
und das Repository existiert.
Failed during: git fetch --force origin
Can anybody help me with that, as I'm pretty new to the subject and working with Linux at all?
Run
unset HOMEBREW_BREW_GIT_REMOTE HOMEBREW_CORE_GIT_REMOTE
Then run the installer again

Htop immediately closes on Apple Silicon (MacBook Air M1)

I installed the Homebrew (non rosetta), then installed the htop. Installation process finished successfully, but htop doesn't work. It just get killed on start.
~ brew config
HOMEBREW_VERSION: 2.7.5-138-g2c83ea7
ORIGIN: https://github.com/Homebrew/brew
HEAD: 2c83ea7339df5ae4d63b0eeb810f638f6d2cc7ca
Last commit: 11 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 677abf931b7846c5ae391cdcaf7e78b5b22286d5
Core tap last commit: 2 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: octa-core 64-bit arm_firestorm_icestorm
Clang: 12.0 build 1200
Git: 2.30.0 => /opt/homebrew/bin/git
Curl: 7.64.1 => /usr/bin/curl
Java: 11.0.9.1
macOS: 11.1-arm64
CLT: N/A
Xcode: 12.3
Rosetta 2: false
Trying to run htop:
~: htop
[1] 98691 killed htop
~:
I would appreciate any help.

Can't update or upgrade Homebrew

I can no longer run either brew upgrade or brew update: both abort with
Error: homebrew-core is a shallow clone. To `brew update` first run:
git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" fetch --unshallow
and if I follow this suggestion and run git ... --unshallow and then try brew update or brew upgrade I still get the same error message.
If I then try the command again (maybe I didn't do it right the first time?) I get
fatal: --unshallow on a complete repository does not make sense
How do I get past this error message to run brew upgrade or brew update without errors?
HOMEBREW_VERSION: 2.6.0-82-gde1afcb
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: de1afcbfc58fb3cd5779bd8fbb6b9995700dda4c
Last commit: 30 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: a7c63b0f7f7ae416a2f961b263155281759ac3a7
Core tap last commit: 29 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.FwPJPzeLfq/org.macosforge.xquartz:0
HOMEBREW_EDITOR: /usr/local/bin/bbedit
HOMEBREW_MAKE_JOBS: 4
HOMEBREW_NO_ANALYTICS: set
HOMEBREW_NO_EMOJI: set
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: quad-core 64-bit haswell
Clang: 12.0 build 1200
Git: 2.29.2 => /usr/local/bin/git
Curl: 7.64.1 => /usr/bin/curl
Java: 1.8.0_172
macOS: 10.15.7-x86_64
CLT: 12.0.32.27
Xcode: 12.2
XQuartz: 2.7.11 => /opt/X11
It's asking you to unshallow both homebrew-core and homebrew-cask with:
git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" fetch --unshallow
git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask" fetch --unshallow
Nothing worked with me until I did:
cd /usr/local/Homebrew/Library/Taps/homebrew/
rm -rf homebrew-core
git clone https://github.com/Homebrew/homebrew-core.git
note: as of Feb 2023 Taps are now here:
/opt/homebrew/Library/Taps/homebrew
Seems that is has been a change in the Homebrew policy and there is not going to be a shallow clone any more.
The correct answer is unshallow, as requested —see Eric3 answer— or install it again, which is going to produce a unshallow / regular copy of the repo.
This worked for me.
git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" fetch --unshallow
git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask" fetch --unshallow
remote: Enumerating objects: 561296, done.
remote: Counting objects: 100% (561255/561255), done.
remote: Compressing objects: 100% (200847/200847), done.
remote: Total 552295 (delta 355423), reused 545449 (delta 348597), pack-reused 0
Receiving objects: 100% (552295/552295), 214.42 MiB | 2.60 MiB/s, done.
Resolving deltas: 100% (355423/355423), completed with 4915 local objects.
From https://github.com/Homebrew/homebrew-core
09e19b5c825..003302f81db master -> origin/master
remote: Enumerating objects: 180904, done.
remote: Counting objects: 100% (166460/166460), done.
remote: Compressing objects: 100% (47394/47394), done.
remote: Total 155334 (delta 116608), reused 146431 (delta 107784), pack-reused 0
Receiving objects: 100% (155334/155334), 73.84 MiB | 4.87 MiB/s, done.
Resolving deltas: 100% (116608/116608), completed with 6054 local objects.
From https://github.com/Homebrew/homebrew-cask

troubleshooting to upgrade Homebrew

any suggestion to resolve that trouble?
brew upgrade
==> Upgrading 1 outdated package:
patchelf 0.10 -> 0.11
==> Upgrading patchelf 0.10 -> 0.11
==> Downloading http://timelessname.com/elfbin/helloworld.tar.gz
Already downloaded: /home/felipe/.cache/Homebrew/downloads/e8943dd8577098994c9cc5eb1dc934bb5e93f97834dd65be5ea969e1d144deec--helloworld.tar.gz
==> Downloading https://github.com/NixOS/patchelf/archive/0.11.tar.gz
Already downloaded: /home/felipe/.cache/Homebrew/downloads/bbcd82d38c35bbbe19f8fc9c11c1a6a9294473a0c235cd5d295718d3108dd349--patchelf-0.11.tar.gz
==> ./configure --prefix=/home/linuxbrew/.linuxbrew/Cellar/patchelf/0.11 CXXFLAGS=-static-libgcc -static-libstdc++
Last 15 lines from /home/felipe/.cache/Homebrew/Logs/patchelf/01.configure:
2020-08-29 21:18:19 -0400
./configure
--prefix=/home/linuxbrew/.linuxbrew/Cellar/patchelf/0.11
CXXFLAGS=-static-libgcc -static-libstdc++
--disable-debug
--disable-dependency-tracking
--disable-silent-rules
READ THIS: https://docs.brew.sh/Troubleshooting
These open issues may also help:
patchelf 0.12 https://github.com/Homebrew/linuxbrew-core/pull/21032
i'm trying to upgrade a brew but it's happening something wrong.
can you help me to fix it?
brew config
HOMEBREW_VERSION: 2.4.14
ORIGIN: https://github.com/Homebrew/brew
HEAD: fa39db0192c3641ed18abf93371c31e3a220348f
Last commit: 2 days ago
Core tap ORIGIN: https://github.com/Homebrew/linuxbrew-core
Core tap HEAD: a394692bb5092789dd8cf49561bf52cf61a1d228
Core tap last commit: 17 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: :1
HOMEBREW_MAKE_JOBS: 12
CPU: dodeca-core 64-bit skylake
Homebrew Ruby: 2.6.3 => /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/bin/ruby
Clang: N/A
Git: 2.20.1 => /bin/git
Curl: 7.64.0 => /usr/bin/curl
Kernel: Linux 4.19.0-8-amd64 x86_64 GNU/Linux
OS: Debian GNU/Linux 10 (buster) (buster)
Host glibc: 2.28
/usr/bin/gcc: 8.3.0
glibc: N/A
gcc: N/A
xorg: N/A
brew doctor
brew doctor
Your system is ready to brew.

Why do I see Failed to fetch error while dping apt-get update

apt-get update in my jenkins job fails wth Http404 error on pulling docker hub related repositiories
12:38:54 + uname -a
12:38:54 Linux c612ce175fe3 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
12:28:18 W: Failed to fetch https://apt.dockerproject.org/repo/dists/ubuntu-trusty/main/binary-amd64/Packages HttpError404
12:28:18
12:28:18 W: Failed to fetch https://apt.dockerproject.org/repo/dists/ubuntu-trusty/main/binary-i386/Packages HttpError404
12:28:18
I have the same problem on several older Ubuntu test systems. Finally found this notice when searching the URL with the 404 error https://apt.dockerproject.org/
Notice: Shutting down dockerproject.org APT and YUM repos 2020-03-31
Docker will be shutting down the deprecated APT and YUM repositories hosted at "dockerproject.org" and "dockerproject.com" on the 31st of March 2020.
We noticed that this project is referencing one of these repositories, and recommend updating to use the "download.docker.com" repository to prevent disruption.
More info: https://www.docker.com/blog/changes-dockerproject-org-apt-yum-repositories/
My fix was to edit either /etc/apt/sources.list.d/docker.list or /etc/apt/sources.list and comment out the old line and add a new the new line. For my raspberry pi I used [arch=armhf] instead of [arch=amd64], hope this helps.
sudo vi /etc/apt/sources.list.d/docker.list
make this change
# deb https://apt.dockerproject.org/repo ubuntu-trusty main
deb [arch=amd64] https://download.docker.com/linux/ubuntu trusty stable
I faced on same issue.
But I made a following change in docker.list file.
sudo nano /etc/apt/sources.list.d/docker.list
and made a following change.
# deb https://apt.dockerproject.org/repo ubuntu-trusty main
And then,
sudo apt-get update
It did work for me.
Thank you.

Resources