brew install maven 404 error - maven

I did a brew install maven and it resulted in below:
==> Downloading http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-3.0.4-bin.tar.gz
==> Best Mirror http://apache.oss.eznetsols.org/maven/binaries/apache-maven-3.0.4-bin.tar.gz
curl: (22) The requested URL returned error: 404
Error: Download failed: http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-3.0.4-bin.tar.gz
At first I thought it is a mirror problem with my network. But I changed to another network, and it is still the same. And still the same error after 4 days. I wonder if others are affected.
What should I do to install maven with brew?

If you are still getting errors with the url, try brew update and then brew install maven. Fixed the problem for me.

There is something strange with this mirror. You can change this with
brew edit maven
and change the url to
http://www.apache.org/dyn/closer.cgi/maven/maven-3/3.0.4/binaries/apache-maven-3.0.4-bin.tar.gz
e.g.
require 'formula'
class Maven < Formula
homepage 'http://maven.apache.org/'
#url 'http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-3.0.4-bin.tar.gz'
url 'http://www.apache.org/dyn/closer.cgi/maven/maven-3/3.0.4/binaries/apache-maven-3.0.4-bin.tar.gz'
sha1 '0de5dc162bafde3fcb0a6b009cfeea81a042523b'
def install
# Remove windows files
rm_f Dir["bin/*.bat"]
# Fix the permissions on the global settings file.
chmod 0644, Dir["conf/settings.xml"]
prefix.install %w{ NOTICE.txt LICENSE.txt README.txt }
# Install jars in libexec to avoid conflicts
libexec.install Dir['*']
bin.install_symlink Dir["#{libexec}/bin/*"]
end
end

ZenBalance's answer worked for me. I first attempted Emoloney's answer, which caused the following error when I ran brew update:
error: Your local changes to the following files would be overwritten by merge:
Library/Formula/maven.rb
Please, commit your changes or stash them before you can merge.
Aborting Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master
To fix it:
cd /usr/local/Library/Formula
git reset --hard
Then:
brew update
brew install maven

You need to modify the URL using brew edit like Emoloney said,
but most important, don't forget to modify the sha1 code (get it from the same download page of the url). It is important to verify that you downloaded safely the exact file

For me, the following commands did the work:
brew update
brew install maven

update the mirror list of brew first
brew update
and then, try to install again. For this case
brew install maven

Related

How to install Homebrew Portable Ruby when your system version is too old

I'm trying to install Homebrew on macOS. Once the installation finished, when I typed help I got:
Already downloaded: /.../Library/Caches/Homebrew/portable-ruby-2.6.3.mavericks.bottle.tar.gz
Error: Checksum mismatch.
Expected: ab81211a2052ccaa6d050741c433b728d0641523d8742eef23a5b450811e5104
Actual: f80fd4cc877a64b0ac1c105fdc212ca6be08bb034118900f2c2f58edcfe0dafd
Archive: /.../Library/Caches/Homebrew/portable-ruby-2.6.3.mavericks.bottle.tar.gz
To retry an incomplete download, remove the file above.
Error: Failed to install Homebrew Portable Ruby (and your system version is too old)!
I had the same question, and the solution is simple: remove the portable-ruby-2.6.3.mavericks.bottle.tar.gz you downloaded before.
rm /.../Library/Caches/Homebrew/portable-ruby-2.6.3.mavericks.bottle.tar.gz
Try running brew update-reset in your terminal and then run brew upgrade in the same terminal.
"Homebrew install fails with Error: Failed to install Homebrew Portable Ruby" helped me tremendously.
It would fail to install, because our company firewall was blocking certain downloads, like bottle, during the Homebrew update/install, but it was difficult to determine this because I would get the error above.
After removing the file, try
brew upgrade
brew update
on your personal Wifi or your phone's hotspot.
I fixed it.
First, I deleted the brew file that stores in the Library folder when using macOS.
The failure before was due to the connection. When I make sure the connection worked, it worked.
Remove the Homebrew Portable Ruby tar.gz from your Mac using:
rm <the path.tar.gz>
rm -rf <the path.tar.gz>
I've been automating this for years. There is a new something(?) in play during the Homebrew install.
I had the same error as above. I filed an issue report and got a response that fixed my problem:
CI=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
I'm not sure what prefixing with CI=1 does but all my automation issues went away.
To retry an incomplete download, remove the file above, then run:
rm /.../Library/Caches/Homebrew/portableruby-2.6.3.mavericks.bottle.tar.gz
and try again
my problem was:
Already downloaded: ../Library/Caches/Homebrew/portable-ruby-2.6.8_1.el_capitan.bottle.tar.gz
==> Pouring portable-ruby-2.6.8_1.el_capitan.bottle.tar.gz
Error: Failed to install ruby 2.6.8_1!
Error: Failed to install Homebrew Portable Ruby (and your system version is too old)!
Fixed with opening the system app for terminal and installing Rosetta into the prompt. This happened after system update MacOS to 11.6.7
After resolving this brew did brew upgrade finish well.
Hope this helps someone.
Here is how I fixed it:
brew cleanup then brew upgrade

dnf broken: all mirrors were tried

I don't know how to describe my problem because I don't understand why it happen ... When i enter
sudo dnf install (any packet)
It return me this
Tor Project Repo 407 B/s | 264 B 00:00
Error: Failed to download metadata for repo 'Tor': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
Its obvious that Tor is related to that mess but i don't know why.
I tried nothing because I'm afraid to do something wrong. I'm on fedora 30.
(english baguette)
It seems like you have a broken repository. Probably you will find this repository in:
ls /etc/yum.repos.d/
there will probably be a file named tor*.repo. If you remove that file (or edit it to contain enabled=0), then dnf should start working correctly again.
Failed to download metadata for repo ‘bintray–resin-io-redhat’: Cannot download repomd.xml: Cannot download repodata/repomd.xml
I was getting same error for kubernetes.repo. It got resolved by setting enabled=0 in /etc/yum.repos.d/kubernetes.repo. Now I can download other package (example Nginx that I was unable to download).
I tried this command and my problem fixed:
sudo rm -r /var/cache/dnf
This worked for me -
cd /etc/yum.repos.d
rm -rf .
yum upgrade
yum update
Note: redhat.repo will regenerate itself on the next yum run, and in the process some repositories will stay lost, be careful.

Homebrew in OS X 10.9.2: Error: SHA256 mismatch

brew install php55
==> Downloading http://www.php.net/get/php-5.5.11.tar.bz2/from/this/mirror
######################################################################## 100.0%
Error: SHA256 mismatch
Expected: 60e14c255f2a461a7a26639b84a2fc448cc2f91c8dead0e9fd00cd8ba27a2e96
Actual: 0d9438c2557db5809f4232148ca1567516e7ece9bf8726853ceac4a111cb8690
Archive: /Library/Caches/Homebrew/php55-5.5.11
To retry an incomplete download, remove the file above.
I tried
brew cleanup && brew update
but not worked
I had the same problem with MongoDb. I was able to fix it first I changed the permission to admin.
Then I ran
brew cleanup && brew update
After that I ran
brew install mongodb
and it worked like a charm
I also tried brew cleanup and brew update but still got the same issue so i did this
brew edit <application>
and replaced sha256 value with actual value shown in error msg.
and this worked out for me, hope it helps you too.
Error: libvirt: SHA256 mismatch
Expected: ac06a7b7a74cf83e953f50e33455df97fc87880ebdac4f1dca89a62331375b1a
Actual: 3346ebf9df9fc4dd37b4c0a5bf1ce80a577b97a7a48dac3febf22aa857be9a98
File: /Users/mek/Library/Caches/Homebrew/downloads/6287efc2ec4d5147e8389b97caeb20dd0d4acec390b5910b2454a4dd018654c1--libiscsi--1.19.0.big_sur.bottle.tar.gz
To retry an incomplete download, remove the file above.
To resolve above error run below commands:
rm "filename"
brew install "package" -f
I had the same problem with watchman.
brew install watchman
response for :
==> Installing dependencies for watchman: automake, pcre
==> Installing watchman dependency: automake
==> Downloading https://ftp.gnu.org/gnu/automake/automake-1.16.1.tar.xz Already
downloaded:
/Users/piccolo/Library/Caches/Homebrew/automake-1.16.1.tar.xz
==> Downloading https://git.savannah.gnu.org/cgit/automake.git/patch/?id=a348d83
Already downloaded:
/Users/piccolo/Library/Caches/Homebrew/automake--patch-7a57ca2b91f7f3c0b168cf5ffbc8a1b2168f3886bcadcc15412281472dace3ce.git
Error: SHA256 mismatch Expected:
7a57ca2b91f7f3c0b168cf5ffbc8a1b2168f3886bcadcc15412281472dace3ce
Actual:
c048ce853eef073a5dfce34fcf9af786e8525e384e01dbbf4e6066623985d4c7
Archive:
/Users/piccolo/Library/Caches/Homebrew/automake--patch-7a57ca2b91f7f3c0b168cf5ffbc8a1b2168f3886bcadcc15412281472dace3ce.git
To retry an incomplete download, remove the file above.
then I did this:
brew uninstall automake
brew cleanup
brew update
brew install watchman
Then it worked.
Some one face the same issue.
https://github.com/Homebrew/homebrew-php/issues/875
"I checked the downloaded file, and it's the html download page rather than the tarball.
It looks like php now wants the URLs to be in the form of http://www.php.net/get/php-5.4.22.tar.bz2/from/a/mirror instead of http://www.php.net/get/php-5.4.22.tar.bz2/from/this/mirror
EDIT: I'm totally mistaken with this. from/this/mirror is the correct one, but it's borked on php's side."
I got fix, using steps wrote by MoOx:
cd /Library/Caches/Homebrew/downloads/
and delete manually the package and run againbrew upgrade works fine!
Sometimes, you may have a package that have a new SHA (eg: github updated the way it compress tar.gz), so best thing to do is to fix the original formula (you can try locally and also push your change upstream).
This can happen if a corporate security policy intercepts the request to the cask and responds with an Access Blocked page instead. You can tell by seeing the file's URL rewritten and its content being HTML. In that case you have to ask them to relax the policy or you're out of luck.

Problems installing v8 on OS X (seems like an SVN issue of some sort?)

Simple brew install v8 command is giving me the following results.
Warning: Your Xcode (5.0.2) is outdated
Please update to Xcode 5.1.
Xcode can be updated from the App Store.
==> Downloading https://github.com/v8/v8/archive/3.21.17.tar.gz
Already downloaded: /Library/Caches/Homebrew/v8-3.21.17.tar.gz
==> Checking out http://gyp.googlecode.com/svn/trunk
svn: E175002: Unable to connect to a repository at URL 'http://gyp.googlecode.com/svn/trunk'
svn: E175002: OPTIONS of 'http://gyp.googlecode.com/svn/trunk': Could not read status line: connection was closed by server (http://gyp.googlecode.com)
Error: Failed to download resource "v8--gyp"
Failure while executing: svn checkout -q --force http://gyp.googlecode.com/svn/trunk /Library/Caches/Homebrew/v8--gyp--svn -r 1685
Unable to decipher the problem here. Any information at this point would really help.
Found this! Seems to be an issue with AnyConnect.
https://apple.stackexchange.com/questions/113717/svn-cant-co-source-code
I ran sudo /opt/cisco/anyconnect/bin/websecurity_uninstall.sh and voila
I've got the same probleme, but I found another solution.
Simply reinstalling svn :
brew install svn
Removing old version :
rm /usr/local/bin/svnversion
Recreate link :
brew link subversion
And then install v8
brew install v8
I got yet another solution: my xcode installation was brand new and I never accepted the terms and conditions. Just try to execute $ svn and the terms and conditions of xcode will prompt

Upgrading Maven on Mac

Tried to upgrade maven. Followed this tutorial. Now I am getting this
How does a file exist and not exist?
To upgrade to the latest version (if you have one already installed but need to update the version) do the following:
1. brew update
2. brew unlink maven
3. brew install maven
if you then execute the mvn --version command you should see that your version of maven has been upgraded.
EDIT:
If you have an issue with the update (command 1) that goes along the lines of
error: The following untracked working tree files would be overwritten by merge:
Library/Formula/... try this answer from another issue
You created a symbolic link from your Downloads directory with a directory that may not exist anymore (or with an incorrect path). The directory /usr/bin/mvn obviously exists but the link is incorrect to the target which leads to the "No such file or directory" error when typing mvm --version.
Go through the tutorial again (which seems ok) but if you fail you could always try using Homebrew with the following commands :
brew update
brew install maven
if you installed maven in your mac, i use the next command...
>brew upgrade maven
screenshot
I will be fixed if you run below commands
brew update
brew install maven
Still issue is exist check your M2_HOME path.
It should set to
M2_HOME=/usr/local/bin/mvn

Resources