How do I uninstall a Homebrew cask manually? - homebrew-cask

I have a Homebrew cask installed which, when I attempt to uninstall it gives me an error:
$ brew cask uninstall julia
Error: Cask 'julia' definition is invalid: invalid 'depends_on macos' value: ":lion"
This leaves me unable to use brew to remove the files installed by the cask or undo the other changes the cask installation processes made.
How do I manually remove a cask, and reverse the ranges that were made when it was installed?
$ brew cask info julia
julia: 1.1.0
https://julialang.org/
/usr/local/Caskroom/julia/0.5.0 (64B)
From: https://github.com/Homebrew/homebrew-cask/blob/master/Casks/julia.rb
==> Name
Julia
==> Artifacts
Julia-1.1.app (App)
/Applications/Julia-1.1.app/Contents/Resources/julia/bin/julia (Binary)
$ brew cask outdated julia
julia (0.5.0) != 1.1.0
brew cask reinstall julia
==> Satisfying dependencies
==> Downloading https://julialang-s3.julialang.org/bin/mac/x64/1.1/julia-1.1.0-mac64.dmg
######################################################################## 100.0%
==> Verifying SHA-256 checksum for Cask 'julia'.
Error: Cask 'julia' definition is invalid: invalid 'depends_on macos' value: ":lion"

I had this problem, and was able to manage it by running the command in the first post at https://github.com/Homebrew/homebrew-cask/issues/58046 -- which is:
/usr/bin/find "$(brew --prefix)/Caskroom/"*'/.metadata' -type f -name '*.rb' -print0 | /usr/bin/xargs -0 /usr/bin/perl -i -pe 's/depends_on macos: \[.*?\]//gsm;s/depends_on macos: .*//g'
According to that post:
This will remove all depends_on macos references of installed casks
(where it doesn’t matter anymore anyway).

Try updating it, cleaning it, then forcing the uninstall.
brew update
brew cleanup
rm -rf /opt/homebrew-cask/Caskroom/julia
You may need to use sudo to get the last one to work

Related

How does one install a specific ocaml compiler when it doesn't appear on the opam switch list?

I've installed this compiler before in a docker container, but I don't understand why it's missing right now. Command and error:
(iit_synthesis) brando9~ $ opam switch create ocaml-variants.4.07.1+flambda_coq-serapi.8.11.0+0.11.1 ocaml-variants.4.07.1+flambda
[ERROR] No compiler matching `ocaml-variants.4.07.1+flambda' found, use `opam switch list-available' to see what is available, or use `--packages' to
select packages explicitly.
but it's not in the list:
(iit_synthesis) brando9~ $ opam switch list-available
# Listing available compilers from repositories: default
# Name # Version # Synopsis
ocaml-option-32bit 1 Set OCaml to be compiled in 32-bit mode for 64-bit Linux and OS X hosts
ocaml-option-flambda 1 Set OCaml to be compiled with flambda activated
ocaml-option-nnpchecker 1 Set OCaml to be compiled with --enable-naked-pointers-checker
ocaml-option-spacetime 1 Set OCaml to be compiled with spacetime activated
ocaml-options-vanilla 1 Ensure that OCaml is compiled with no special options enabled
Opam update fails
Output:
$ opam update --all
<><> Updating package repositories ><><><><><><><><><><><><><><><><><><><><><><>
Processing 1/1: [default: http]
Processing 1/1: [default: http]
[default] synchronised from https://opam.ocaml.org
[ERROR] Could not update repository "default": "~/anaconda/bin/patch -p1 -i /dfs/scratch0/brando9/.opam/log/patch-99014-0624b6" exited with code 2
I probably should have started with this but I installed opam with "manually" with deb because I don't have sudo. In particular I did this:
# - opam (snap, no sudo)
# ref: https://askubuntu.com/questions/339/how-can-i-install-a-package-without-root-access
apt-get download opam
#apt-get download opam_1.2.2-4_amd64
# manually checked the opam name
#ls | less
mkdir -p ~/.local
dpkg -x opam_1.2.2-4_amd64.deb ~/.local/bin
export PATH="$HOME/.local/bin:$PATH"
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc.user
source ~/.bashrc.user
tr ':' '\n' <<< "$PATH"
opam --version
before that I did try installing opam with conda (which has worked in the past) but it failed. I wonder if that screwed things up :/. Will try to reproduce to post the conda error. But I ran conda install -c conda-forge opam.
related:
How to install a specific version of ocaml compiler with opam
https://discuss.ocaml.org/t/why-doesnt-my-server-show-the-ocaml-compiler-that-i-need/10917
https://www.reddit.com/r/ocaml/comments/zed88p/how_does_one_install_a_specific_ocaml_compiler/
How does one install opam without sudo priveledges on linux/ubuntu?

I don't know how to fix this error when installing homebrew and mingw

I was trying to install mingw-w64 with homebrew to use C++ on my Macbook (intel chip).
I followed a tutorial I found on youtube: https://www.youtube.com/watch?v=KhGnYWplLVo&t=310s
Everything was going well until the terminal won't show up anything about the installation. It was at this specific point when I was installing homebrew:
==> Tapping homebrew/core
remote: Enumerating objects: 1148169, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 1148169 (delta 2), reused 3 (delta 0), pack-reused 1148162
Receiving objects: 100% (1148169/1148169), 455.12 MiB | 5.71 MiB/s, done.
Resolving deltas: 100% (793326/793326), done.
I tried typing something but it didn't seem to response. So I pressed Control+C and it worked normal again.
I wasn't sure if the installation was successful or not (later on I found that when the installation is done then it will appear this line: ==> Installation successful!)
I then used this command brew install MinGW-w64 to instal MinGW and got this error
Tapped 3967 casks (4,038 files, 309.3MB).
Warning: No available formula with the name "mingw-w64".
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.
I tried uninstalling homebrew and then installed it again but nothing worked.
I also used brew config and brew doctor and these are the inputs
Macs-MacBook-Air:~ mac$ brew config
HOMEBREW_VERSION: 3.3.16-55-g377ac64
ORIGIN: https://github.com/Homebrew/brew
HEAD: 377ac6475c8785dc80d50df3c6b173065d32183d
Last commit: 13 hours ago
Core tap ORIGIN: https://github.com/Homebrew/brew
Core tap HEAD: 377ac6475c8785dc80d50df3c6b173065d32183d
Core tap last commit: 13 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_CORE_GIT_REMOTE: https://github.com/Homebrew/homebrew-core
HOMEBREW_MAKE_JOBS: 4
Homebrew Ruby: 2.6.8 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.8/bin/ruby
CPU: quad-core 64-bit broadwell
Clang: 10.0.1 build 1001
Git: 2.20.1 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.54.0 => /usr/bin/curl
macOS: 10.14.6-x86_64
CLT: 10.3.0.0.1.1562985497
Xcode: N/A
Macs-MacBook-Air:~ mac$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!
Warning: A newer Command Line Tools release is available.
Update them from Software Update in System Preferences or run:
softwareupdate --all --install --force
If that doesn't show you any updates, run:
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
Alternatively, manually download them from:
https://developer.apple.com/download/all/.
You should download the Command Line Tools for Xcode 11.3.1.
Warning: Homebrew/homebrew-core was not tapped properly! Run:
rm -rf "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core"
brew tap homebrew/core
Warning: You are using macOS 10.14.
We (and Apple) do not provide support for this old version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Twitter or any other official channels. You are responsible for resolving
any issues you experience while you are running this
old version.

libcurl4-openssl-dev:armhf cannot be installed when libcurl4-openssl-dev is already installed

I have created a c++ app on Debian Jessie 8.10 amd64 which also need the following libraries:
sudo apt-get install libssl-dev
sudo apt-get install libcurl4-openssl-dev
I also need to cross compile the source code for armhf. So according to this quite helpful link https://wiki.embeddedarm.com/wiki/Jessie_armhf_Cross_Compile I gave the following commands:
sudo apt-get install curl build-essential
su root
echo "deb http://emdebian.org/tools/debian jessie main" >
/etc/apt/sources.list.d/emdebian.list
curl http://emdebian.org/tools/debian/emdebian-toolchain-archive.key | apt-key add -
dpkg --add-architecture armhf
apt-get update
apt-get install crossbuild-essential-armhf
Everything got installed correctly and then I also gave :
sudo apt-get install libssl-dev:armhf
sudo apt-get install libcurl4-openssl-dev:armhf
The first command executed successfully. On the other hand the second one failed giving the following output:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
libcurl4-doc:armhf libcurl3-dbg:armhf libidn11-dev:armhf libkrb5-dev:armhf libldap2-dev:armhf
librtmp-dev:armhf libssh2-1-dev:armhf pkg-config:armhf
The following NEW packages will be installed:
libcurl4-openssl-dev:armhf
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
23 not fully installed or removed.
Need to get 0 B/316 kB of archives.
After this operation, 863 kB of additional disk space will be used.
(Reading database ... 94032 files and directories currently installed.)
Preparing to unpack .../libcurl4-openssl-dev_7.38.0-4+deb8u8_armhf.deb ...
Unpacking libcurl4-openssl-dev:armhf (7.38.0-4+deb8u8) ...
dpkg: error processing archive /var/cache/apt/archives/libcurl4-openssl-dev_7.38.0-4+deb8u8_armhf.deb (--unpack):
trying to overwrite shared '/usr/include/curl/curlbuild.h', which is different from other instances of package libcurl4-openssl-dev:armhf
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Processing triggers for man-db (2.7.0.2-5) ...
Errors were encountered while processing:
/var/cache/apt/archives/libcurl4-openssl-dev_7.38.0-4+deb8u8_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Since I'm quite new in cross compilation procedures does anyone have any idea what I'm doing wrong?
You are doing nothing wrong. It is a file conflict in related with multiarch packages. It is a bug in the package
Here is a explanation of this kind of bugs, from https://wiki.debian.org/MultiArch/Hints
The package in question is marked Multi-Arch: same, but has
conflicting versions of at least one file for different architectures.
The hint tells the filename (or the number of filenames) and the
architectures (or number of architectures) in question. The easiest
way to fix is to remove the Multi-Arch: same declaration, but often
enough it can be fixed by moving the offending files to
per-architecture locations (typically
/usr/lib/$(DEB_HOST_MULTIARCH)/). For *-dev packages, the Multi-Arch:
same capability often is not critical and removing is a good initial
measure.
I just run into the same kind of problem, which still is an issue with some packages. In my case libcurl-openssl-dev was replacing the /usr/bin/curl-config binary.
To me it required swapping from x64/i386 libraries when i needed cross-compiling but i am well aware it might not be possible for everyone.

Installing Camomile via opam fails due to missing patch file. How can I fix this?

While installing utop via opam on my ArchLinux laptop, I got the following message:
$ opam install utop
The following actions will be performed:
- install camomile.0.8.5 [required by utop]
- install zed.1.3 [required by utop]
- install lambda-term.1.6 [required by utop]
- install utop.1.14
4 to install | 0 to reinstall | 0 to upgrade | 0 to downgrade | 0 to remove
Do you want to continue ? [Y/n]
=-=-= Installing camomile.0.8.5 =-=-=
Applying cmxs.patch.
[ERROR] Due to some errors while processing camomile.0.8.5, the following actions will NOT proceed:
- install utop.1.14
- install lambda-term.1.6
- install zed.1.3
===== ERROR while installing camomile.0.8.5 =====
Could not get the source for camomile.0.8.5:
# opam-version 1.1.1
# os linux
Patch file "/home/sinan/.opam/system/build/camomile.0.8.5/cmxs.patch" not found.
'opam install utop' failed.
Trying to install camomile by itself also gives the same error. This seems to be related to commit 672e44e which carried over to the opam repository as cmxs.patch. I am not sure where things break so that opam tries to build without the patch file.
I tried downloading, and putting cmxs.patch in the reported location, but, of course, that directory gets clobbered the next time I try to install via opam.
How should I proceed?
I would have preferred to have been able to fix the underlying problem, but, in the end, downloading the contents of the cmxs.patch file, adding it to the already downloaded ~/.opam/archives/camomile.0.8.5+opam.tar.gz archive, and then issuing
$ opam install camomile
worked.
After that, opam install utop went without a hitch as well.
For your reference, I have:
$ opam --version
1.1.1
$ cat .opam/repo/default/repo
upstream: "https://github.com/ocaml/opam-repository/tree/master/"
browse: "https://opam.ocaml.org/pkg/"

Frama-C Gui on mavericks not working

Does anyone have installed Frama-C on Mavericks ?
Because i can't install it or do not know how to install it (Gui Version)!
I already installed ocaml on my pc, but for the Gui version i need to install these libraries : Gtk, GtkSourceView, GnomeCanvas and Lablgtk2.
So i saw a previous post and did that :
export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig
sudo port install opam
opam init
Y
eval `opam config env`
sudo port install gtksourceview2 lablgtk2 ocaml-ocamlgraph
opam install frama-c
Im' having a problem in making "make" with frama-c which is :
Ocamlc src/logic/property_status.cmo
File "src/logic/property_status.ml", line 1444, characters 4-2027:
Error: Signature mismatch:
...
Values do not match:
val vertex_attributes :
v ->
[> `Color of int
| `Label of string
| `Shape of [> `Box | `Diamond ]
| `Style of [> `Bold | `Filled ] list
| `Width of float ]
list
is not included in
val vertex_attributes :
V.t -> Graph.Graphviz.DotAttributes.vertex list
File "src/logic/property_status.ml", line 1479, characters 16-33:
Actual declaration
make: *** [src/logic/property_status.cmo] Error 2
How am i able to solve this ?
i've just successfully installed Frama-c neon (with Gui) on maverick, using opam and homebrew.
here's my walkthrough. (Thanks to tips above)
1) Install homebrew
$ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
2) Install opam:
$ brew install opam
$ opam init
(i had to modify .profile instead of .bashrc with f option)
$ eval `opam config env`
3) Install all dependencies
$ brew install gtk+
$ brew install gtksourceview
$ brew install libgnomecanvasmm libgnomecanvas
$ brew install lablgtk
4) Install Frama-c
$ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
$ opam install frama-c
If you prefer install dependencies with macports, change the PKG_CONFIG_PATH to /opt/X11/lib/pkgconfig as explained here
Hope this help
I have successfully installed frama-c Neon with gui on mavericks using brew to get all the dependencies and using the source code in http://frama-c.com/download.html . If you try to do it using brew, you should install lablgtk from this repository(https://github.com/mht208/homebrew-formal) and only after all the other dependencies so the commands to install with gui would be(in source folder):
brew install ocaml
brew install gtk
brew install gtksourceview
brew install gnomecanvasmm gnomecanvas
brew tap mht208/formal
brew install lmht208/formal/lablgtk -with-gnomecanvas -with-gtksourceview2
./configure
make
You can also install ocamlgraph with opam, and you can compile Zarith and install in your system.
Graph.Graphviz is from OCamlGraph. There seems to be an incompatibility between the two latest versions of each.
You'll have to add version contraints on the frama-c library, or change the Style attribute to have a list of the polymorphic variant set.
EDIT -
you don't need to install ocamlgraph via port, you should install that by opam as well.