gerardpuig / ubuntu-cleaner

Ubuntu Cleaner is a tool that makes it easy to clean your ubuntu system.
GNU General Public License v3.0
225 stars 21 forks source link

Old kernel cleaning function is crashing #50

Closed kelebek333 closed 1 year ago

kelebek333 commented 2 years ago

Hi, Old kernel cleaning function is crashing on focal base. I did not try other bases. Version: 1.1.4

/usr/lib/python3/dist-packages/ubuntucleaner/settings/debug.py:7: PyGIWarning: Notify was imported without specifying a version first. Use gi.require_version('Notify', '0.7') before import to ensure that the right version gets loaded.
  from gi.repository import Gdk, Gtk, Notify
/usr/bin/ubuntu-cleaner:70: DeprecationWarning: Gdk.threads_init is deprecated
  Gdk.threads_init()
/usr/bin/ubuntu-cleaner:71: PyGIDeprecationWarning: Since version 3.11, calling threads_init is no longer needed. See: https://wiki.gnome.org/PyGObject/Threading
  GObject.threads_init()
[OldKernelPlugin][ERROR] list index out of range (oldkernel_plugin.py:27)
[utils.icon][WARNING] gtk-icon-theme-error-quark: 'gnome-app-install' simgesi Mint-Y teması içinde bulunmuyor (0) (icon.py:33)
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/ubuntucleaner/janitor/oldkernel_plugin.py", line 38, in get_cruft
    if pkg.is_installed and self.is_old_kernel_package(pkg.name):
  File "/usr/lib/python3/dist-packages/ubuntucleaner/janitor/oldkernel_plugin.py", line 84, in is_old_kernel_package
    if match and self._compare_kernel_version(match[0]):
  File "/usr/lib/python3/dist-packages/ubuntucleaner/settings/debug.py", line 152, in func_wrapper
    return func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/ubuntucleaner/janitor/oldkernel_plugin.py", line 90, in _compare_kernel_version
    c1, c2 = self.current_kernel_version.split('-')
ValueError: not enough values to unpack (expected 2, got 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3/dist-packages/ubuntucleaner/janitor/oldkernel_plugin.py", line 48, in get_cruft
    error = get_traceback()
  File "/usr/lib/python3/dist-packages/ubuntucleaner/settings/debug.py", line 82, in get_traceback
    return run_traceback('error', text_only=True)
  File "/usr/lib/python3/dist-packages/ubuntucleaner/settings/debug.py", line 47, in run_traceback
    output = StringIO.StringIO()
AttributeError: type object '_io.StringIO' has no attribute 'StringIO'
gerardpuig commented 2 years ago

Hi @kelebek333 just tested but it's working fine for me. Could you please send me the list of items you get when clicking to the Old Kernel option?

kelebek333 commented 2 years ago

I think, issue is related Xanmod kernel. If I boot my system with Xanmod kernel, ubuntu-cleaner's old-kernel-purge feature crashed. If I boot the system with stock kernel or mainline ppa version, ubuntu-cleaner's old-kernel-purge feature working well.

gerardpuig commented 1 year ago

If it's so specific I won't work on it. But feel free to send a PR fixing this issue