Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Fallback to non-ostree package managers on failure #997

Open
stranger-danger-zamu opened this issue Aug 29, 2022 · 1 comment
Open

Fallback to non-ostree package managers on failure #997

stranger-danger-zamu opened this issue Aug 29, 2022 · 1 comment

Comments

@stranger-danger-zamu
Copy link

stranger-danger-zamu commented Aug 29, 2022

What did you expect to happen?

To run topgrade and have it work even if rpm-ostree was installed on a conventional install (ie. not an immutable install).

So, once it detects that "libostree" is installed, it attempts to run rpm-ostree upgrade, and if that fails, it checks for conventional package managers.

What actually happened?

Once it detects that "libostree" (actually checks for rpm-ostree executable) is installed, it attempts to run rpm-ostree upgrade and fails out with no option to work around this.

Additional Details

  • Which operating system or Linux distribution are you using?

Fedora 36

  • How did you install Topgrade?

cargo install topgrade

  • Which version are you running?

Topgrade 9.0.1

 2022-08-29T18:41:10.850Z DEBUG topgrade::config > Configuration at /home/$USER/.config/topgrade.toml
 2022-08-29T18:41:10.850Z DEBUG topgrade::config > Loaded configuration: ConfigFile { pre_commands: Some({}), post_commands: None, commands: Some({}), git_repos: None, predefined_git_repos: None, disable: None, ignore_failures: None, remote_topgrades: None, remote_topgrade_path: None, ssh_arguments: None, git_arguments: None, tmux_arguments: None, set_title: None, display_time: None, assume_yes: None, yay_arguments: None, no_retry: None, run_in_tmux: None, cleanup: None, notify_each_step: None, accept_all_windows_updates: None, bashit_branch: None, only: None, composer: Some(Composer { self_update: None }), brew: Some(Brew { greedy_cask: None }), linux: Some(Linux { yay_arguments: None, arch_package_manager: None, show_arch_news: None, trizen_arguments: None, pikaur_arguments: None, dnf_arguments: None, apt_arguments: None, enable_tlmgr: None, redhat_distro_sync: None, rpm_ostree: None, emerge_sync_flags: None, emerge_update_flags: None }), git: Some(Git { max_concurrency: None, arguments: None, repos: None, pull_predefined: None }), windows: Some(Windows { accept_all_updates: None, self_rename: None, open_remotes_in_new_terminal: None, enable_winget: None }), npm: Some(NPM { use_sudo: None }), vim: None, firmware: Some(Firmware { upgrade: None }), vagrant: None, flatpak: Some(Flatpak { use_sudo: None }) }
 2022-08-29T18:41:10.850Z DEBUG topgrade::utils  > Detected "/usr/bin/notify-send" as "notify-send"
 2022-08-29T18:41:10.850Z DEBUG topgrade         > Version: 9.0.1
 2022-08-29T18:41:10.850Z DEBUG topgrade         > OS: x86_64-unknown-linux-gnu
 2022-08-29T18:41:10.850Z DEBUG topgrade         > Args { inner: ["topgrade", "--verbose"] }
 2022-08-29T18:41:10.850Z DEBUG topgrade         > Binary path: Ok("/src/.cargo/bin/topgrade")
 2022-08-29T18:41:10.850Z DEBUG topgrade         > Self Update: false
 2022-08-29T18:41:10.850Z DEBUG topgrade::utils  > Detected "/usr/bin/git" as "git"
 2022-08-29T18:41:10.850Z DEBUG topgrade::utils  > Detected "/usr/bin/doas" as "doas"
 2022-08-29T18:41:10.850Z DEBUG topgrade::utils  > Cannot find "pwsh"
 2022-08-29T18:41:10.850Z DEBUG topgrade::utils  > Cannot find "powershell"
 2022-08-29T18:41:10.850Z DEBUG topgrade::runner > Step "System update"

―― 14:41:10 - System update ――――――――――――――――――――――――――――――――――――――――――――――――――――
2022-08-29T18:41:10.850Z DEBUG topgrade::utils > Detected "/usr/bin/rpm-ostree" as "rpm-ostree"
2022-08-29T18:41:10.850Z DEBUG topgrade::executor > Running "/usr/bin/rpm-ostree" "upgrade"
error: This system was not booted via libostree.
Currently, most rpm-ostree commands only work on ostree-based host systems.

2022-08-29T18:41:10.858Z DEBUG topgrade::runner > Step "System update" failed: exit status: 1
2022-08-29T18:41:10.858Z DEBUG topgrade::terminal > Desktop notification: System update failed

@stranger-danger-zamu
Copy link
Author

stranger-danger-zamu commented Aug 29, 2022

rpm-ostree is a dependencies for other things not just for atomic installs (eg. osbuild).

Maybe you could check for the error code and then try other package managers. Maybe split out libostree solutions from System update and into it's own (therefore you can at least blacklist it). Or there might be something in /etc/os-release which can specify whether to do the System update via libostree or conventional package managers.


/etc/os-release is actually perfect. When installing Fedora Silverblue or Kinoite it has a OSTREE_VERSION entry where a conventional installation doesn't. So it's existence should be enough to determine whether it should check for rpm-ostree at all.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant