Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apt-smart does not work on Ubuntu 24.04 LTS (Noble) #22

Open
grossmj opened this issue May 18, 2024 · 0 comments
Open

Apt-smart does not work on Ubuntu 24.04 LTS (Noble) #22

grossmj opened this issue May 18, 2024 · 0 comments

Comments

@grossmj
Copy link

grossmj commented May 18, 2024

I installed and ran apt-smart like this:

sudo python3 -m pip install -U apt-smart --break-system-packages
apt-smart -a

and got this traceback:

Encountered unexpected exception! Aborting ..
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/dist-packages/apt_smart/cli.py", line 211, in main
    callback()
  File "/usr/local/lib/python3.12/dist-packages/apt_smart/__init__.py", line 589, in change_mirror
    new_mirror = self.best_mirror
                 ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/property_manager3/__init__.py", line 784, in __get__
    value = super(custom_property, self).__get__(obj, type)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/apt_smart/__init__.py", line 203, in best_mirror
    logger.debug("Selecting best %s mirror ..", self.distributor_id.capitalize())
                                                ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/property_manager3/__init__.py", line 784, in __get__
    value = super(custom_property, self).__get__(obj, type)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/apt_smart/__init__.py", line 313, in distributor_id
    return self.release.distributor_id
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/property_manager3/__init__.py", line 784, in __get__
    value = super(custom_property, self).__get__(obj, type)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/apt_smart/__init__.py", line 447, in release
    return coerce_release(self.distribution_codename)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/property_manager3/__init__.py", line 784, in __get__
    value = super(custom_property, self).__get__(obj, type)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/apt_smart/__init__.py", line 298, in distribution_codename
    raise EnvironmentError("Failed to determine the distribution codename using apt's package resource list!")
OSError: Failed to determine the distribution codename using apt's package resource list!

I suspect this is because of the switch to the deb822 format for Ubuntu sources:

$ cat /etc/apt/sources.list
# Ubuntu sources have moved to the /etc/apt/sources.list.d/ubuntu.sources
# file, which uses the deb822 format. Use deb822-formatted .sources files
# to manage package sources in the /etc/apt/sources.list.d/ directory.
# See the sources.list(5) manual page for details.
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

No branches or pull requests

1 participant