Run 'apt-get autoremove' and return the size (un-rounded, in bytes) of freed space
()
| 611 | |
| 612 | |
| 613 | def 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 | |
| 627 | def apt_autoclean(): |