# Opam troubles, update doing nothing

**URL:** https://discuss.ocaml.org/t/opam-troubles-update-doing-nothing/17018
**Category:** Ecosystem
**Tags:** opam
**Created:** [July 27, 2025, 1:29am UTC](https://discuss.ocaml.org/t/opam-troubles-update-doing-nothing/17018 "2025-07-27T01:29:19Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![quietlight](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/quietlight/32/4937_2.png) [@quietlight](https://discuss.ocaml.org/u/quietlight)
#### Post date: [July 27, 2025, 1:29am UTC](https://discuss.ocaml.org/t/opam-troubles-update-doing-nothing/17018/1 "2025-07-27T01:29:19Z")

</div>

I have been trying to make a new switch with ocaml 5.3.0, but nothing works for me. Even after an opam reinstall, using brew and without. I would clean out the .opam folder and start again, but I have a switch in there that I need. I tried everything I can think of, even after this my default switch is still on 5.1.1 $opam switch reinstall default --packages=ocaml-base-compiler.latest. I did have some switches with 5.2.0 but removed those as they were taking space. I know it used to work.

I think the problem is opam update is not doing anything.

Any ideas how I could fix this. I have a small but important to me project in ocaml. After some time building a big new project with typescript/react assisted by claude, I just want some sanity.

```auto
 david@Air  ~  opam update
 david@Air  ~  opam switch list-available
# Listing available compilers from repositories: default
# No matches found
 david@Air  ~  opam switch create 5.3.0 ocaml-base-compiler.5.3.0
[ERROR] No compiler matching `ocaml-base-compiler.5.3.0' found, use `opam switch list-available' to see what is
        available, or use `--packages' to select packages explicitly.
 ✘ david@Air  ~  opam switch
# switch compiler description
→ default ocaml-base-compiler.5.1.1,ocaml-options-vanilla.1 default
   finch ocaml-base-compiler.4.14.2 finch
   forms ocaml-base-compiler.5.1.1 forms

```

---

<div class="post-metadata">

### Author: ![R\_Huxton](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/r_huxton/32/4216_2.png) [@R\_Huxton](https://discuss.ocaml.org/u/R_Huxton)
#### Post date: [July 27, 2025, 7:41am UTC](https://discuss.ocaml.org/t/opam-troubles-update-doing-nothing/17018/2 "2025-07-27T07:41:26Z")

</div>

I’m no expert but the obvious next debugging steps are to try `opam switch list-available` with `--debug` in case that prints anything useful. Then to see what is in `opam repository list --all`. Oh - presumably you are on a Mac, judging by your prompt?

---

<div class="post-metadata">

### Author: ![quietlight](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/quietlight/32/4937_2.png) [@quietlight](https://discuss.ocaml.org/u/quietlight)
#### Post date: [July 27, 2025, 8:05am UTC](https://discuss.ocaml.org/t/opam-troubles-update-doing-nothing/17018/3 "2025-07-27T08:05:42Z")

</div>

Thanks for your kind reply.

I am not in a huge rush, the world is waking up and i am about to go to bed, but any ideas appreciated. Bound to be something obvious, just not to me.

Here are the results of that.

```auto
david@Air  ~  opam switch list-available --debug
00:00.158 CLI Parsing CLI version 2.4
00:00.158 GSTATE LOAD-GLOBAL-STATE @ /Users/david/.opam
00:00.159 RSTATE LOAD-REPOSITORY-STATE @ /Users/david/.opam
00:00.164 CACHE(repository) Loaded /Users/david/.opam/repo/state-1DC2C051.cache in 0.001s
00:00.164 RSTATE Cache found
# Listing available compilers from repositories: default
# No matches found
 david@Air  ~  opam repository list --all
# Repository # Url # Switches(rank)
platform-cache file:///Users/david/.opam/plugins/ocaml-platform/cache/repo
david@Air  ~  opam update
david@Air  ~ 

```

---

<div class="post-metadata">

### Author: ![R\_Huxton](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/r_huxton/32/4216_2.png) [@R\_Huxton](https://discuss.ocaml.org/u/R_Huxton)
#### Post date: [July 27, 2025, 12:43pm UTC](https://discuss.ocaml.org/t/opam-troubles-update-doing-nothing/17018/4 "2025-07-27T12:43:45Z")

</div>

Hmm. Why don’t you have a default repository of [ocaml.org](http://ocaml.org) listed?

---

<div class="post-metadata">

### Author: ![quietlight](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/quietlight/32/4937_2.png) [@quietlight](https://discuss.ocaml.org/u/quietlight)
#### Post date: [July 27, 2025, 8:53pm UTC](https://discuss.ocaml.org/t/opam-troubles-update-doing-nothing/17018/5 "2025-07-27T20:53:28Z")

</div>

I don’t know. I am busy elsewhere, when I get a chance I will move ~.opam to something else and try a fresh reinstall. Maybe I can reinstal the packages on the one switch I care about.

Thanks for your kindness  
David

---

<div class="post-metadata">

### Author: ![kit-ty-kate](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/kit-ty-kate/32/5953_2.png) [@kit-ty-kate](https://discuss.ocaml.org/u/kit-ty-kate)
#### Post date: [July 28, 2025, 1:51pm UTC](https://discuss.ocaml.org/t/opam-troubles-update-doing-nothing/17018/6 "2025-07-28T13:51:22Z")

</div>

The empty list of repositories is suspicious. Have you ever ran `opam repository remove default --all` or something similar? What does `cat ~/.opam/repo/repos-config` say?

---

<div class="post-metadata">

### Author: ![Chet\_Murthy](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/chet_murthy/32/1501_2.png) [@Chet\_Murthy](https://discuss.ocaml.org/u/Chet_Murthy)
#### Post date: [July 28, 2025, 5:07pm UTC](https://discuss.ocaml.org/t/opam-troubles-update-doing-nothing/17018/7 "2025-07-28T17:07:42Z")

</div>

A tiny suggestion: you don’t need to change anything about your current OPAM configuration to test out new installations. I routinely install opam in a “nonstandard location” so I can have multiple opam installs – typically so I can test out a new opam (e.g. 2.4.1) without disturbing the existing one (e.g. 2.3.0). So I just set the `OPAMROOT` env var:

```auto
export OPAMROOT=/home/chet/Hack/Opam/GENERIC

```

or

```auto
export OPAMROOT=/home/chet/Hack/Opam-2.3.0/GENERIC

```

then I just make sure `opam` is in the path, and I can run `opam init` and it’ll take effect below that `OPAMROOT`.

---

<div class="post-metadata">

### Author: ![quietlight](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/quietlight/32/4937_2.png) [@quietlight](https://discuss.ocaml.org/u/quietlight)
#### Post date: [July 28, 2025, 9:12pm UTC](https://discuss.ocaml.org/t/opam-troubles-update-doing-nothing/17018/8 "2025-07-28T21:12:35Z")

</div>

I probably did something like “opam switch remove default”, then “opam switch create default 5.3.0” in my effort to get this sorted. Anyway, it was troubling before that.  
david@Air  ~  cat ~/.opam/repo/repos-config  
opam-version: “2.0”  
repositories:  
“platform-cache”  
{“file:///Users/david/.opam/plugins/ocaml-platform/cache/repo”}  
david@Air  ~ 

---

<div class="post-metadata">

### Author: ![quietlight](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/quietlight/32/4937_2.png) [@quietlight](https://discuss.ocaml.org/u/quietlight)
#### Post date: [July 28, 2025, 9:13pm UTC](https://discuss.ocaml.org/t/opam-troubles-update-doing-nothing/17018/9 "2025-07-28T21:13:12Z")

</div>

Thanks for that. That could solve my problem.

David

---

<div class="post-metadata">

### Author: ![quietlight](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/quietlight/32/4937_2.png) [@quietlight](https://discuss.ocaml.org/u/quietlight)
#### Post date: [July 29, 2025, 12:54am UTC](https://discuss.ocaml.org/t/opam-troubles-update-doing-nothing/17018/10 "2025-07-29T00:54:32Z")

</div>

I had some time and fixed the problem by moving all .opam folders, reinstalling opam from scratch. Onward.

Thanks for your kind responses.

Regards  
David
