cabal failed to install mtl missing dependency of transformers - cabal-install

I was trying to use cabal to install mtl while it told me I missed transformers ==0.4.* && ==0.5.2.0.
$ cabal install mtl
Resolving dependencies...
Configuring mtl-2.2.1...
cabal.exe: At least the following dependencies are missing:
transformers ==0.4.* && ==0.5.2.0
cabal.exe: Error: some packages failed to install:
mtl-2.2.1 failed during the configure step. The exception was:
ExitFailure 1
I stuck here for almost one week. I've installed transformers in version 0.4.3.0 and 0.5.2.0. My cabal is in version 1.10.2.0 and my ghc is 7.6.3. I'm new to ghc so I can't figure out what is the problem. I can't understand what the transformers ==0.4.* means. Any suggestions? Thanks a lot!

The line
transformers ==0.4.* && ==0.5.2.0
is a dependency constraint on the version of the transformers library. Here it states that it requires that the transformers version is at the same time 0.4.* and 0.5.2.0.
Although there can be different versions installed, during compilation only one version can be used—therefore, this constraint can never be satisfied.
For some reasons, cabal seems to get confused with the two revisions of the mtl package.
The second revision adds support for transformers-5. See also issue 30 of mtl, where it is noted that the metadata of hackage is the second revision, but the source tarball that is finally downloaded is the original revision.
Until a new version of mtl is released, you have to explicitly install transformers-0.4.3.0 (and only that version) and then install mtl.
cabal install transformers-0.4.3.0
If the dependencies are satisfied when installing mtl, transformers-0.4.3.0 will pass the dependency check.
It seems that cabal automatically adds the latest version as a dependency (e.g. == transformers-0.5.2.0) when that version is installed. Therefore, only 0.4.* versions should be installed.
If you have already installed the latest transformers version, you can uninstall it:
ghc-pkg unregister --force transformers-0.5.2.0
rm -r .cabal/packages/hackage.haskell.org/transformers/0.5.2.0
(Do this for every 5.x version that is installed, see cabal info transformers for a list of installed version.)

Related

Cabal cannot resolve dependencies for Idris

I'm new to the Haskell ecosystem and trying to install Idris on my MacOS Catalina.
So after
$ brew install ghc
$ brew install cabal-install
I have The Glorious Glasgow Haskell Compilation System, version 8.8.2 and cabal-install version 3.0.0.0. Then I'm trying to install Idris but
$ cabal update; cabal install idris
from official docs fails with
Resolving dependencies... cabal: Could not resolve dependencies: [__6]
fail (backjumping, conflict set: template-haskell, text, time) After
searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: hashable, trifecta, base,
idris, text, template-haskell, time, pretty, blaze-builder,
blaze-markup, idris:setup.Cabal, zlib, unordered-containers, ivor,
optparse-applicative Try running with --minimize-conflict-set to
improve the error message.
Running with the flag mentioned in message doesn't help too.
Should I try building from sources or is there any other good way to fix this error?
This PR supporting those versions was just merged in January: https://github.com/idris-lang/Idris-dev/pull/4808
However, the last release on Hackage was July of last year:
http://hackage.haskell.org/package/idris
So I'd assume the currently released version doesn't build on GHC 8.8.
You could build current master from the git repo.
Or you could install the idris-current.pkg binary from https://www.idris-lang.org/download/ instead of building it yourself from source.
On Linux I needed to install zlib outside of cabal, you might need to do that. I see that in your list of failed packages.

automate brew upgrade when there is a conflict

When there is a conflict, brew upgrade will stop. For this particular case, I will use parallel from the gnu parallel package instead of from moreutils. When I originally installed them, I installed moreutils first then force install parallel. Can upgrade for this case be automated? I don't want to always do this manually.
==> Upgrading parallel
Error: Cannot install parallel because conflicting formulae are installed.
moreutils: because both install a `parallel` executable.
Please `brew unlink moreutils` before continuing.
Unlinking removes a formula's symlinks from /usr/local. You can
link the formula again after the install finishes. You can --force this
install, but the build may fail or cause obscure side effects in the
resulting software.

Erlang installation giving erlang-mode is broken error

I am trying to install Elixir from the elixir website on Ubuntu 14.04. I get the following error when I execute $ sudo apt-get install esl-erlang. Can anyone help me out here ?
$ sudo apt-get install esl-erlang
Reading package lists... Done
Building dependency tree
Reading state information... Done
esl-erlang is already the newest version.
The following packages were automatically installed and are no longer required:
libgconf2-4 python-requests-whl python-setuptools-whl python-six-whl
python-urllib3-whl python-wheel
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 406 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up erlang-mode (1:21.0.5-1) ...
ERROR: erlang-mode is broken - called emacs-package-install as a new-style add-on, but has no compat file.
Install emacsen-common for emacs23
emacsen-common: Handling install of emacsen flavor emacs23
Wrote /etc/emacs23/site-start.d/00debian-vars.elc
Wrote /usr/share/emacs23/site-lisp/debian-startup.elc
Install emacsen-common for emacs24
emacsen-common: Handling install of emacsen flavor emacs24
Wrote /etc/emacs24/site-start.d/00debian-vars.elc
Wrote /usr/share/emacs24/site-lisp/debian-startup.elc
Install erlang-mode for emacs
Install erlang-mode for emacs23
install/erlang: Handling install for emacsen flavor emacs23
Wrote /usr/share/emacs23/site-lisp/erlang/erlang-edoc.elc
Wrote /usr/share/emacs23/site-lisp/erlang/erlang-eunit.elc
Wrote /usr/share/emacs23/site-lisp/erlang/erlang-flymake.elc
Wrote /usr/share/emacs23/site-lisp/erlang/erlang-skels-old.elc
Wrote /usr/share/emacs23/site-lisp/erlang/erlang-skels.elc
Wrote /usr/share/emacs23/site-lisp/erlang/erlang-start.elc
Wrote /usr/share/emacs23/site-lisp/erlang/erlang.elc
Wrote /usr/share/emacs23/site-lisp/erlang/erlang_appwiz.elc
In toplevel form:
erldoc.el:64:1:Error: Cannot open load file: cl-lib
Wrote /usr/share/emacs23/site-lisp/erlang/path.elc
ERROR: install script from erlang-mode package failed
dpkg: error processing package erlang-mode (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
erlang-mode
E: Sub-process /usr/bin/dpkg returned an error code (1)
Thanks
I don't know what is causing your errors, but you could try ASDF with the Elixir plugin. This allows you to install multiple versions of Elixir and its dependencies, and uses your user environment with shims instead of installing to system directories. This avoids many of the dependency and permission problems that comes with performing a single system-level installation.
It looks like you have both emacs23 and emacs24 installed. The failure is happening when trying to build for emacs23. Unless you really want emacs23 for some reason, remove it and then it should install fine:
sudo apt-get remove emacs23
It is possible you might have to delete some of the other emacs23-* packages by hand.
This problem only affects the erlang-mode package, which adds support for editing Erlang code in Emacs. If you're not using Emacs (or not developing Erlang in it), you can just uninstall that package:
sudo apt remove erlang-mode
As noted in Penguin Brian's answer, this happens when installing erlang-mode on a system using Emacs 23, as erlang-mode only supports Emacs 24 or newer. (Looks like this is a bug in the package: it shouldn't try to compile itself for unsupported Emacs versions.) If you do want to use erlang-mode in Emacs, I'd suggest running Emacs 24 and installing the Erlang mode from MELPA.

ROS kinetic arch linux installation

I am trying to install ROS kinetic from this AUR package:https://aur.archlinux.org/packages/ros-kinetic-desktop-full/
However,I am getting thie following errors:
Using Yay:
> Error: Could not find all required packages:
pkg-config>=0.28 (Wanted by: ros-kinetic-desktop-full -> ros-kinetic-simulators -> ros-kinetic-gazebo-ros-pkgs -> ros-kinetic-gazebo-plugins -> ros-kinetic-gazebo-dev -> gazebo -> ignition-fuel_tools -> ignition-msgs)
Using Pikaur:
Version mismatch:
ignition-msgs depends on: 'pkg-config'
found in 'PackageSource.REPO': '{'pkg-config': '1.5.2-1'}'
This is why versioned dependencies in Arch Linux are ugly. The pkg-config package no longer exists, since Arch has transitioned to using the pkgconf implementation. However, even though pkgconf declares a virtual "provides" for pkg-config, in order to ease the transition, this provides is not versioned and therefore breaks the dependency resolution for the "ignition-msgs" package.
As a separate matter, it is completely wrong for any package to have a make dependency on either pkgconf or pkg-config, since whichever one Arch Linux uses has always been in the "base-devel" group which is required for running makepkg and is assumed always available.
t;dr "ignition-msgs" is broken because the AUR maintainer is bad at packaging, see the comments on the package details.

Javac not installed with openjdk-6-jdk

I have been trying some different java compilers over the weekend and decided to stick with javac this morning. I then proceeded to clean up the mess that was caused by my testing and removed every last trace of java and did a fresh 'apt-get install openjdk-6-jdk' after autoremove and autoclean.
The following weirdness was then encountered:
tarskin#5-PARA-11-0120:~$ javac
The program 'javac' can be found in the following packages:
* openjdk-6-jdk
* ecj
* gcj-4.4-jdk
* gcj-4.6-jdk
* gcj-4.5-jdk
* openjdk-7-jdk
Try: sudo apt-get install <selected package>
I had allready installed openjdk but i tried it anyhow yielding:
tarskin#5-PARA-11-0120:~$ sudo apt-get install openjdk-6-jdk
[sudo] password for tarskin:
Reading package lists... Done
Building dependency tree
Reading state information... Done
openjdk-6-jdk is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
tarskin#5-PARA-11-0120:~$
I know i must be doing something stupid but I have no idea what, if anyone else could give a pointer in the right direction that would be very much appreciated...
Cheers
EDIT: Found some other weird aspects about the 'new' instance of my java distro, it doesn't seem to recognise for example 'Pattern' or 'Matcher' that should be coming from the regex import shrugs.
TL;DR: install java-1.6.0-openjdk-devel
I had a similar issue on Fedora, but used rpm -q -l to list the contents of the (pre-installed) java-1.6.0-openjdk package, and discovered that it doesn't include javac. It is in fact only a JRE, not a JDK, as implied by the installation instructions on http://openjdk.java.net/install/ . To get javac, I installed java-1.6.0-openjdk-devel . Not exactly what I expected, because the usual packaging conventions would indicate that is the package for doing openjdk development (i.e., working on the JVM), not for developing programs with it.
Basically, openjdk's package naming doesn't follow either standard Java conventions (would require calling it a JRE somewhere), or standard Linux packaging conventions (using -devel indicates it is used for developing the package w/o -devel itself).
As per http://openjdk.java.net/install/, to install the OpenJDK-6 JRE only:
$ sudo apt-get install openjdk-6-jre
To install the full JDK:
$ sudo apt-get install openjdk-6-jdk
Check /etc/alternatives and /usr/bin. One or both will contain links to old Java versions which you had installed. When those links are broken, you can get the error message above.
To update the links after installing a new version of Java, try update-alternatives
First to check if javac is installed try to look for that file:
1. locate javac
2. or find / -name javac
And also you can check at this website with instrucions on how to install java on Ubuntu (i suppose you are on ubuntu):
http://openjdk.java.net/install/
You can also check:
http://packages.ubuntu.com/hardy/i386/openjdk-6-jdk/filelist for the files installed by the pacakge, and you can notice that javac should be installed.
Maybe you also need to run:
Open the terminal and run this command to install OpenJDK 7.0 on Ubuntu Oneiric:
sudo update-alternatives --config java

Resources