How to upgrade lambda-term with opam

After having executed opam list, I know that the lambda-term version I have is 1.11.
At https://opam.ocaml.org/packages/lambda-term/ I see that the latest version of lambda-term is 1.12.

But when I do opam upgrade lambda-term, I am told “Already up-to-date.” What am I missing ?

Have you tried an opam update? This re-syncs your local opam with the public one. It sounds like your local opam does not know about the latest version of lamdba-term.

I tried that and here is what I got :

$ opam update

=-=- Updating package repositories =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= :camel:
[default] synchronized from https://opam.ocaml.org
[NOTE] The repository ‘default’ will be permanently redirected to https://opam.ocaml.org/1.2.0 (opam-version <
“1.2.2”)
[default] synchronized from https://opam.ocaml.org/1.2.0

Updates available for 4.04.1, apply them with ‘opam upgrade’:
===== :arrow_upper_right: 1 =====
$ opam upgrade lambda-term
Already up-to-date.

So opam still won’t upgrade my lambda-term to the latest version.

You could try a more general opam upgrade or opam install lambda-term.1.12.0.

Syill doesn’t work :

$ opam upgrade
Everything as up-to-date as possible (run with --verbose to show unavailable upgrades).
$ opam install lambda-term.1.12.0
[ERROR] No package matches lambda-term.1.12.0.

On my system:

$ opam install lambda-term.1.12.0
[NOTE] Package lambda-term is already installed (current version is 1.12.0).

What does opam info lambda-term tell you? I still suspect that your Opam does not know about it.

$ opam info lambda-term

=-=- lambda-term: information on all versions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
name                   lambda-term
all-installed-versions 1.10.1 [system]  1.12.0 [4.04.2]
all-versions           1.2  1.4  1.5  1.6  1.7  1.8  1.9  1.10  1.10.1  1.11  1.12.0

=-=- Version-specific details -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
version       1.12.0
repository    default
url.src:      https://github.com/diml/lambda-term/releases/download/1.12.0/lambda-term-1.12.0.tbz
url.checksum: md5=5eaf97fc02e89d29a5f9e58d074e9a6a
homepage:     https://github.com/diml/lambda-term
bug-reports:  https://github.com/diml/lambda-term/issues
dev-repo:     git://github.com/diml/lambda-term.git
authors:      Jérémie Dimino
license:      BSD3
depends:      "ocaml" {>= "4.02.3"}
              "lwt" {>= "2.7.0"}
              "react"
              "zed" {>= "1.2"}
              "camomile"
              "lwt_react"
              "jbuilder" {build & >= "1.0+beta9"}
synopsis      Terminal manipulation library for OCaml
description   Lambda-term is a cross-platform library for manipulating the terminal. It
              provides an abstraction for keys, mouse events, colors, as well as a set of
              widgets to write curses-like applications. The main objective of lambda-term is
              to provide a higher level functional interface to terminal manipulation than,
              for example, ncurses, by providing a native OCaml interface instead of bindings
              to a C library. Lambda-term integrates with zed to provide text edition
              facilities in console applications.

This is confirmed by what I get :

$ opam info lambda-term
package: lambda-term
version: 1.11
repository: default
upstream-url: https://github.com/diml/lambda-term/archive/1.11.tar.gz
upstream-kind: http
upstream-checksum: 51ae50136ad0989c941ad35ae4d89c72
homepage: GitHub - ocaml-community/lambda-term: Terminal manipulation library for OCaml
bug-reports: Issues · ocaml-community/lambda-term · GitHub
dev-repo: git://github.com/diml/lambda-term.git
author: Jérémie Dimino
license: BSD3
depends: lwt >= 2.7.0 & zed >= 1.2 & lwt_react & jbuilder >= 1.0+beta7
installed-version: 1.11 [system 4.04.1]
available-versions: 1.2, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 1.10, 1.10.1, 1.11
description: Terminal manipulation library for OCaml
Lambda-term is a cross-platform library for manipulating the terminal.
It provides an abstraction for keys, mouse events, colors, as well as
a set of widgets to write curses-like applications.

The main objective of lambda-term is to provide a higher level
functional interface to terminal manipulation than, for example,
ncurses, by providing a native OCaml interface instead of bindings to
a C library.

Lambda-term integrates with zed to provide text edition facilities in
console applications.

Maybe I am wrong, but this note seems to indicate that you are using an old version of opam, and so you use an old snapshot of the opam repository.

Is it the system opam? Can you upgrade opam in any way? I think anything between 1.2.2 and 1.3.1 should be enough

Forgive me for not understanding the terms you use, but what do you mean by “the system opam” ? By “upgrade opam”, do you mean typing “opam upgrade” in the terminal ? I did that and merlin was the only package that got updated.

I meant: did you install opam using your system package manager (like apt, yum, brew, …)? I am not sure if opam upgrade opam does the trick, but you can try. You can try using the binary distribution from https://opam.ocaml.org/doc/Install.html

I cannot remember how I installed it, all I know is that my .opam directory is located in my home directory

I get [ERROR] No package named opam found. actually. I’ll try the link you suggested.

If I try brew install opam, I get the following warning :

Warning: You are using OS X 10.13.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.

So I decided not to continue. I think I understand better the problem now : I installed opam when my OS was OS X 10.11, and my upgrading to 10.13 sort of broke my opam.

Curious, what’s the output of opam --version?

Sorry, you asked too late … since then I finally solved my problem by deleting my .opam directory, putting the latest opam executable in /usr/bin/local, and doing a opam init.

1 Like