MCPcopy Create free account
hub / github.com/bleachbit/bleachbit / apt_autoremove

Function apt_autoremove

bleachbit/Unix.py:613–624  ·  view source on GitHub ↗

Run 'apt-get autoremove' and return the size (un-rounded, in bytes) of freed space

()

Source from the content-addressed store, hash-verified

611
612
613def apt_autoremove():
614 """Run 'apt-get autoremove' and return the size (un-rounded, in bytes) of freed space"""
615
616 args = ['--yes', 'autoremove']
617 # After this operation, 74.7MB disk space will be freed.
618 # After this operation, 44.0 kB disk space will be freed.
619 freed_space_regex = r'.*, ([\d.]+ ?[a-zA-Z]{2}) disk space will be freed.'
620 try:
621 return run_cleaner_cmd('apt-get', args, freed_space_regex, ['^E: '])
622 except subprocess.CalledProcessError as e:
623 raise RuntimeError(
624 f"Error calling '{' '.join(e.cmd)}':\n{e.output}") from e
625
626
627def apt_autoclean():

Callers 1

test_aptMethod · 0.90

Calls 2

run_cleaner_cmdFunction · 0.85
joinMethod · 0.80

Tested by 1

test_aptMethod · 0.72