apt/dpkg errors

Bug #1731516 reported by Ingela on 2017-11-10
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
BleachBit
Undecided
Unassigned

Bug Description

Error in execution of <bleachbit.Command.Function instance at 0x7f239d901cb0>
Traceback (most recent call last):
  File "/usr/share/bleachbit/Worker.py", line 83, in execute
    for ret in cmd.execute(self.really_delete):
  File "/usr/share/bleachbit/Command.py", line 138, in execute
    func_ret = self.func()
  File "/usr/share/bleachbit/Unix.py", line 616, in apt_autoclean
    raise RuntimeError("Error calling '%s':\n%s" % (' '.join(e.cmd), e.output))
RuntimeError: Error calling 'apt-get autoclean':
E: Could not open lock file /var/cache/apt/archives/lock - open (13: Permission denied)
E: Unable to lock the download directory

Error in execution of <bleachbit.Command.Function instance at 0x7f239d9526c8>
Traceback (most recent call last):
  File "/usr/share/bleachbit/Worker.py", line 83, in execute
    for ret in cmd.execute(self.really_delete):
  File "/usr/share/bleachbit/Command.py", line 138, in execute
    func_ret = self.func()
  File "/usr/share/bleachbit/Unix.py", line 608, in apt_autoremove
    raise RuntimeError("Error calling '%s':\n%s" % (' '.join(e.cmd), e.output))
RuntimeError: Error calling 'apt-get --yes autoremove':
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

Bleachbit 1.17 on Ubuntu 16.10

Andrew Ziem (ahziem1) wrote :

Are you running with sudo/root permissions?

Would you please send me the system information? It's available in the GUI when clicking on Help - System Information. Alternatively it's on the command line with the --sysinfo option.

Changed in bleachbit:
milestone: none → 2.0
dino99 (9d9) wrote :

Also get that error with 1.15-2 (bionic) each time i use bleachbit 'as root' from the Applications -> System Tools menu

tags: added: artful bionic
Changed in bleachbit:
status: New → Confirmed
Andrew Ziem (ahziem1) wrote :

dino99: Could you please send me the system information in BleachBit under Help - System Information? You can post it here or email it to me directly.

summary: - Bleachbit error
+ apt/dpkg errors
dino99 (9d9) wrote :

BleachBit version 1.15
GTK version 2.24.31
local_cleaners_dir = /home/oem/.config/bleachbit/cleaners
locale_dir = /usr/share/locale/
options_dir = /home/oem/.config/bleachbit
personal_cleaners_dir = /home/oem/.config/bleachbit/cleaners
system_cleaners_dir = /usr/share/bleachbit/cleaners
locale.getdefaultlocale = ('en_US', 'UTF-8')
os.getenv('DESKTOP_SESSION') = None
os.getenv('LOGNAME') = root
os.getenv('USER') = root
os.getenv('SUDO_UID') = 1000
os.path.expanduser('~') = /home/oem
platform.linux_distribution() = ('Ubuntu', '18.04', 'bionic')
platform.platform = Linux-4.14.0-13-generic-x86_64-with-Ubuntu-18.04-bionic
platform.version = #15-Ubuntu SMP Mon Dec 18 19:08:44 UTC 2017
sys.argv = ['/usr/bin/bleachbit']
sys.executable = /usr/bin/python
sys.version = 2.7.14+ (default, Dec 5 2017, 15:17:02)
[GCC 7.2.1 20171205]
__file__ = /usr/share/bleachbit/bleachbit/Diagnostic.pyc

Andrew Ziem (ahziem1) wrote :

I tested the latest BleachBit (a bit newer than 1.19 beta) on Ubuntu 16.04. When I use "sudo python bleachbit.py" my diagnostic information looks like yours (such as LOGNAMEE, USER, and SUDO_UID). It does seem like you are root.

I can run apt autoclean and autoremove without any errors, and I enabled extra debugging and saw that apt was really running. For example, I saw this

Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 72 not upgraded.

There was a change 9/23/2017 to apt clean, but that did not affect autoclean or autoremove.

There was another change to apt 8/12/2017, but it just added the PATH environment variable. This seems unrelated.

Another change to apt made 10/22/2016 seems unrelated.

So far it is not clear why it fails on your system.

Have you tried BleachBit version 1.12? While changes were made since 1.12 that seem unrelated, it would be interesting to test 1.12.

Do you have any extra security software on your system like SELinux?

dino99 (9d9) wrote :

With a genuine Bionic install, libselinux1/libsepol1/libsemanage1 are required dependencies for many apps. But selinux is not installed by default (on my systems at least, but some users can need it with special use cases)

Andrew Ziem (ahziem1) wrote :

I installed Ubuntu Bionic 2018-02-22 from http://cdimage.ubuntu.com/daily-live/20180222/ . This was a clean install

Then I installed the latest BleachBit https://download.opensuse.org/repositories/home:/andrew_z/xUbuntu_17.10/all/bleachbit_1.19_all.deb

This version of BleachBit is a bit newer than 1.19 beta, but the APT parts here should be the same

I launched BleachBit as Administrator from the Ubuntu menu, and I cleaned all of APT (one at a time) without any errors.

I closed BleachBit and from the terminal ran "sudo bleachbit" and cleaned APT again, and there were no errors.

The two tests produced different results in Help - System Information. The second way ("sudo bleachbit") looked like yours (e.g., SUDO_UID=1000 and the user folder is the non root "/home/username"). In any case, I tried it both ways.

Any thoughts on how to reproduce this issue?

Changed in bleachbit:
milestone: 2.0 → 2.2
Andrew Ziem (ahziem1) wrote :

I uninstalled that .deb (the one I packaged) and installed BleachBit 1.15 from the Ubuntu universe repository, and it cleaned APT too.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers