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

Function apt_clean

bleachbit/Unix.py:636–645  ·  view source on GitHub ↗

Run 'apt-get clean' and return the size in bytes of freed space

()

Source from the content-addressed store, hash-verified

634
635
636def apt_clean():
637 """Run 'apt-get clean' and return the size in bytes of freed space"""
638 old_size = get_apt_size()
639 try:
640 run_cleaner_cmd('apt-get', ['clean'], '^unused regex$', ['^E: '])
641 except subprocess.CalledProcessError as e:
642 raise RuntimeError(
643 f"Error calling '{' '.join(e.cmd)}':\n{e.output}") from e
644 new_size = get_apt_size()
645 return old_size - new_size
646
647
648def get_apt_size():

Callers

nothing calls this directly

Calls 3

get_apt_sizeFunction · 0.85
run_cleaner_cmdFunction · 0.85
joinMethod · 0.80

Tested by

no test coverage detected