r-darwish / topgrade

Upgrade everything
GNU General Public License v3.0
3.37k stars 162 forks source link

Topgrade v9.0.1 can't find apt_pkg #948

Closed johnblommers closed 2 years ago

johnblommers commented 2 years ago

What did you expect to happen?

topgrade should update from the APT repository. It used to until the other day.

What actually happened?

Traceback (most recent call last):
  File "/build/nala-Skdmi8/nala-0.5.0/nala-cli.py", line 30, in <module>
  File "/build/nala-Skdmi8/nala-0.5.0/nala/__main__.py", line 31, in <module nala.__main__>
  File "/build/nala-Skdmi8/nala-0.5.0/nala/constants.py", line 33, in <module nala.constants>
ModuleNotFoundError: No module named 'apt_pkg'

Retry? (y)es/(N)o/(s)hell/(q)uit

Additional details

topgrade -v
 2022-05-30T02:55:28.954Z DEBUG topgrade::config > Configuration at /home/johnb/.config/topgrade.toml
 2022-05-30T02:55:28.954Z 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: None, vim: None, firmware: None, vagrant: None, flatpak: None }
 2022-05-30T02:55:28.954Z DEBUG topgrade::utils  > Detected "/usr/bin/notify-send" as "notify-send"
 2022-05-30T02:55:28.954Z DEBUG topgrade         > Version: 9.0.1
 2022-05-30T02:55:28.954Z DEBUG topgrade         > OS: x86_64-unknown-linux-gnu
 2022-05-30T02:55:28.954Z DEBUG topgrade         > Args { inner: ["topgrade", "-v"] }
 2022-05-30T02:55:28.954Z DEBUG topgrade         > Binary path: Ok("/home/johnb/.cargo/bin/topgrade")
 2022-05-30T02:55:28.954Z DEBUG topgrade         > Self Update: false
 2022-05-30T02:55:28.954Z DEBUG topgrade::utils  > Detected "/usr/bin/git" as "git"
 2022-05-30T02:55:28.954Z DEBUG topgrade::utils  > Cannot find "doas"
 2022-05-30T02:55:28.954Z DEBUG topgrade::utils  > Detected "/usr/bin/sudo" as "sudo"
 2022-05-30T02:55:28.955Z DEBUG topgrade::utils  > Cannot find "pwsh"
 2022-05-30T02:55:28.955Z DEBUG topgrade::utils  > Cannot find "powershell"
 2022-05-30T02:55:28.955Z DEBUG topgrade::runner > Step "System update"

―― 19:55:28 - System update ――――――――――――――――――――――――――――――――――――――――――――――――――――
 2022-05-30T02:55:28.955Z DEBUG topgrade::utils  > Cannot find "apt-fast"
 2022-05-30T02:55:28.955Z DEBUG topgrade::utils  > Detected "/usr/bin/nala" as "nala"
 2022-05-30T02:55:28.955Z DEBUG topgrade::executor > Running "/usr/bin/sudo" "/usr/bin/nala" "upgrade"
Traceback (most recent call last):
  File "/build/nala-Skdmi8/nala-0.5.0/nala-cli.py", line 30, in 
  File "/build/nala-Skdmi8/nala-0.5.0/nala/__main__.py", line 31, in 
  File "/build/nala-Skdmi8/nala-0.5.0/nala/constants.py", line 33, in 
ModuleNotFoundError: No module named 'apt_pkg'
 2022-05-30T02:55:29.044Z DEBUG topgrade::runner   > Step "System update" failed: exit status: 1
 2022-05-30T02:55:29.044Z DEBUG topgrade::terminal > Desktop notification: System update failed

Retry? (y)es/(N)o/(s)hell/(q)uit
MCOfficer commented 2 years ago

It uses nala instead of apt because it is installed, and nala throws this error. Make sure nala is installed properly, or remove it if you don't mean to use it. See 1e259269995405192dd24cb2ad1d6210fc927403 for reasoning.

johnblommers commented 2 years ago

Removing nala restored Topgrade's ability to update APT-based packages.

I don't remember installing nala but as they say "memory is the first thing to go."

All good now. Thank you.