Skip to content

feat(ollama): check system-wide installation path#1995

Draft
uwuclxdy wants to merge 1 commit into
topgrade-rs:mainfrom
uwuclxdy:ollama-paths
Draft

feat(ollama): check system-wide installation path#1995
uwuclxdy wants to merge 1 commit into
topgrade-rs:mainfrom
uwuclxdy:ollama-paths

Conversation

@uwuclxdy
Copy link
Copy Markdown
Member

@uwuclxdy uwuclxdy commented May 2, 2026

What does this PR do

ref #1968

Adds an additional path (system-wide installation) check for Ollama models to update.

Standards checklist

  • The PR title is descriptive
  • I have read CONTRIBUTING.md
  • Optional: I have tested the code myself, with the relevant tools installed. If yes, add Topgrade's output of the relevant steps.
    • kinda? it seems to work but need someone with an actual system-wide ollama installation to verify.
  • If this PR introduces new user-facing messages they are translated

AI involvement

None.

@PonyLucky can you please test this fixes your issue?

@PonyLucky
Copy link
Copy Markdown

Sure will test today

@PonyLucky
Copy link
Copy Markdown

It works for me :

$ ollama ls
NAME           ID              SIZE     MODIFIED   
gemma4:26b     5571076f3d70    17 GB    6 days ago    
gpt-oss:20b    17052f91a42e    13 GB    6 days ago

$ ls /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/
gemma4  gpt-oss

I no longer have an error:

$ ./topgrade -v --only ollama
DEBUG Current system locale is fr-FR
DEBUG Configuration at /home/louis/.config/topgrade/topgrade.toml
DEBUG Loaded configuration: ConfigFile { include: Some(Include { paths: None }), misc: Some(Misc { allow_root: None, pre_sudo: Some(true), sudo_loop: None, sudo_loop_interval: None, sudo_command: None, disable: None, first: None, last: None, ignore_failures: None, remote_topgrades: None, remote_topgrade_path: None, ssh_arguments: None, tmux_arguments: None, set_title: None, display_time: None, assume_yes: Some(true), ask_retry: None, auto_retry: None, no_retry: None, show_skipped: None, run_in_tmux: None, tmux_session_mode: None, cleanup: Some(true), notify_each_step: None, skip_notify: None, notify_end: None, bashit_branch: None, only: None, no_self_update: None, log_filters: None, show_distribution_summary: None, nix_handler: None }), pre_commands: Some({}), post_commands: Some({}), commands: Some({}), conda: Some(Conda { env_names: None, env_paths: None }), python: Some(Python { enable_pip_review: None, enable_pip_review_local: None, enable_pipupgrade: None, pipupgrade_arguments: None, poetry_force_self_update: None }), composer: Some(Composer { self_update: None }), brew: Some(Brew { greedy_cask: None, greedy_latest: None, greedy_auto_updates: None, autoremove: None, fetch_head: None }), linux: Some(Linux { yay_arguments: None, aura_aur_arguments: None, aura_pacman_arguments: None, arch_package_manager: None, show_arch_news: None, garuda_update_arguments: None, trizen_arguments: None, pikaur_arguments: None, pamac_arguments: None, shelly_arguments: None, dnf_arguments: None, nix_arguments: None, nix_env_arguments: None, apt_arguments: None, enable_tlmgr: None, redhat_distro_sync: None, suse_dup: None, rpm_ostree: Some(false), bootc: None, emerge_sync_flags: None, emerge_update_flags: None, home_manager_arguments: None }), mandb: Some(Mandb { enable: None }), git: Some(Git { max_concurrency: None, arguments: None, repos: None, pull_predefined: None, fetch_only: None }), go: Some(Go { gup_exclude: None }), containers: Some(Containers { ignored_containers: None, runtime: None, system_prune: None, use_sudo: None }), windows: Some(Windows { accept_all_updates: None, updates_auto_reboot: None, self_rename: None, open_remotes_in_new_terminal: None, wsl_update_pre_release: None, wsl_update_use_web_download: None, winget_silent_install: None, winget_use_sudo: None }), npm: Some(NPM { use_sudo: None }), chezmoi: Some(Chezmoi { exclude_encrypted: None }), mise: Some(Mise { bump: None, interactive: None, jobs: None, verbose: None, quiet: None, silent: None }), yarn: Some(Yarn { use_sudo: None }), deno: Some(Deno { version: None }), vim: Some(Vim { force_plug_update: None }), firmware: Some(Firmware { upgrade: None }), vagrant: Some(Vagrant { directories: None, power_on: None, always_suspend: None }), flatpak: Some(Flatpak { use_sudo: None }), pixi: Some(Pixi { include_release_notes: None }), distrobox: Some(Distrobox { use_root: None, containers: None }), lensfun: Some(Lensfun { use_sudo: None }), julia: Some(JuliaConfig { startup_file: None }), zigup: Some(Zigup { target_versions: None, install_dir: None, path_link: None, cleanup: None }), vscode: Some(VscodeConfig { profile: None }), doom: Some(DoomConfig { aot: None }), cargo: Some(Cargo { git: None, quiet: None, locked: None }), rustup: Some(Rustup { channels: None }), pkgfile: Some(Pkgfile { enable: None }), viteplus: Some(VitePlus { use_sudo: None }) }
DEBUG Version: 17.4.0
DEBUG OS: x86_64-unknown-linux-gnu
DEBUG Args { inner: ["./topgrade", "-v", "--only", "ollama"] }
DEBUG Binary path: Ok("/home/louis/Documents/dev/topgrade/target/debug/topgrade")
DEBUG self-update Feature Enabled: false
DEBUG Configuration: Config { opt: CommandLineArgs { edit_config: false, show_config_reference: false, run_in_tmux: false, no_tmux: false, cleanup: false, dry_run: false, run_type: Wet, no_retry: false, no_ask_retry: false, auto_retry: None, disable: [], only: [Ollama], custom_commands: [], env: [], verbose: true, keep_at_end: false, skip_notify: false, notify_end: Always, yes: None, disable_predefined_git_repos: false, config: None, remote_host_limit: None, show_skipped: false, allow_root: false, sudo_loop: false, sudo_loop_interval: None, log_filter: "warn", gen_completion: None, gen_manpage: false, no_self_update: false }, config_file: ConfigFile { include: Some(Include { paths: None }), misc: Some(Misc { allow_root: None, pre_sudo: Some(true), sudo_loop: None, sudo_loop_interval: None, sudo_command: None, disable: None, first: None, last: None, ignore_failures: None, remote_topgrades: None, remote_topgrade_path: None, ssh_arguments: None, tmux_arguments: None, set_title: None, display_time: None, assume_yes: Some(true), ask_retry: None, auto_retry: None, no_retry: None, show_skipped: None, run_in_tmux: None, tmux_session_mode: None, cleanup: Some(true), notify_each_step: None, skip_notify: None, notify_end: None, bashit_branch: None, only: None, no_self_update: None, log_filters: None, show_distribution_summary: None, nix_handler: None }), pre_commands: Some({}), post_commands: Some({}), commands: Some({}), conda: Some(Conda { env_names: None, env_paths: None }), python: Some(Python { enable_pip_review: None, enable_pip_review_local: None, enable_pipupgrade: None, pipupgrade_arguments: None, poetry_force_self_update: None }), composer: Some(Composer { self_update: None }), brew: Some(Brew { greedy_cask: None, greedy_latest: None, greedy_auto_updates: None, autoremove: None, fetch_head: None }), linux: Some(Linux { yay_arguments: None, aura_aur_arguments: None, aura_pacman_arguments: None, arch_package_manager: None, show_arch_news: None, garuda_update_arguments: None, trizen_arguments: None, pikaur_arguments: None, pamac_arguments: None, shelly_arguments: None, dnf_arguments: None, nix_arguments: None, nix_env_arguments: None, apt_arguments: None, enable_tlmgr: None, redhat_distro_sync: None, suse_dup: None, rpm_ostree: Some(false), bootc: None, emerge_sync_flags: None, emerge_update_flags: None, home_manager_arguments: None }), mandb: Some(Mandb { enable: None }), git: Some(Git { max_concurrency: None, arguments: None, repos: None, pull_predefined: None, fetch_only: None }), go: Some(Go { gup_exclude: None }), containers: Some(Containers { ignored_containers: None, runtime: None, system_prune: None, use_sudo: None }), windows: Some(Windows { accept_all_updates: None, updates_auto_reboot: None, self_rename: None, open_remotes_in_new_terminal: None, wsl_update_pre_release: None, wsl_update_use_web_download: None, winget_silent_install: None, winget_use_sudo: None }), npm: Some(NPM { use_sudo: None }), chezmoi: Some(Chezmoi { exclude_encrypted: None }), mise: Some(Mise { bump: None, interactive: None, jobs: None, verbose: None, quiet: None, silent: None }), yarn: Some(Yarn { use_sudo: None }), deno: Some(Deno { version: None }), vim: Some(Vim { force_plug_update: None }), firmware: Some(Firmware { upgrade: None }), vagrant: Some(Vagrant { directories: None, power_on: None, always_suspend: None }), flatpak: Some(Flatpak { use_sudo: None }), pixi: Some(Pixi { include_release_notes: None }), distrobox: Some(Distrobox { use_root: None, containers: None }), lensfun: Some(Lensfun { use_sudo: None }), julia: Some(JuliaConfig { startup_file: None }), zigup: Some(Zigup { target_versions: None, install_dir: None, path_link: None, cleanup: None }), vscode: Some(VscodeConfig { profile: None }), doom: Some(DoomConfig { aot: None }), cargo: Some(Cargo { git: None, quiet: None, locked: None }), rustup: Some(Rustup { channels: None }), pkgfile: Some(Pkgfile { enable: None }), viteplus: Some(VitePlus { use_sudo: None }) }, allowed_steps: [Ollama] }
DEBUG Running with euid: 1000
DEBUG Cannot find "doas"
DEBUG Detected "/usr/bin/sudo" as "sudo"
DEBUG Sudo: Ok(Sudo { path: Some("/usr/bin/sudo"), kind: Sudo })

── 19:00:38 - Sudo ─────────────────────────────────────────────────────────────
DEBUG Executing command `/usr/bin/sudo -v`
DEBUG Step "Ollama"
DEBUG Detected "/usr/local/bin/ollama" as "ollama"

── 19:00:38 - Résumé ───────────────────────────────────────────────────────────
Ollama: PASSÉ: No Ollama models to pull
DEBUG Desktop notification: Topgrade terminé avec succès

@uwuclxdy
Copy link
Copy Markdown
Member Author

uwuclxdy commented May 3, 2026

Hm okay, but topgrade still doesn't find those two models as updatable... Can you ollama pull any model and run topgrade after? At least that new model should get an update attempt

Thanks

@uwuclxdy
Copy link
Copy Markdown
Member Author

uwuclxdy commented May 8, 2026

@PonyLucky any updates on this? i don't want to make it ready for review before you confirm this PR absolutely fixes the issue for you.

@PonyLucky
Copy link
Copy Markdown

PonyLucky commented May 9, 2026

Ha, sorry I forgot to respond.

Yes doing a ollama pull does the same. The models I have installed don't currently have any newer version because it is for both the only one available.

It's the expected behavior for me.

@uwuclxdy
Copy link
Copy Markdown
Member Author

uwuclxdy commented May 9, 2026

Thanks for replying @PonyLucky

However, looking at the command output you shared earlier, I don't think this is expected behavior. Topgrade will run ollama pull for all models that aren't recognized as local-only (eg. created, finetuned by you or installed in some other way than with ollama pull). Your command output shows Ollama: PASSÉ: No Ollama models to pull which should happen only if /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/ were to be empty (or had only non ollama pull-ed models). I will investigate this further, can you share one file from /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/ in full please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants