Skip to content

Commit

Permalink
3.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
lbr38 committed Sep 2, 2024
1 parent 36099b5 commit 1c70d91
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/controllers/Package/Apt.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,20 @@ def get_available_packages(self):
#
#-----------------------------------------------------------------------------------------------
def clear_cache(self):
result = subprocess.run(
["apt", "clean"],
stdout = subprocess.PIPE, # subprocess.PIPE & subprocess.PIPE are alias of 'capture_output = True'
stderr = subprocess.PIPE,
universal_newlines = True # Alias of 'text = True'
)
try:
self.aptcache.clear()
except Exception as e:
raise Exception('could not clear apt cache: ' + str(e))

if result.returncode != 0:
raise Exception('could not clear apt cache: ' + result.stderr)
# result = subprocess.run(
# ["apt", "clean"],
# stdout = subprocess.PIPE, # subprocess.PIPE & subprocess.PIPE are alias of 'capture_output = True'
# stderr = subprocess.PIPE,
# universal_newlines = True # Alias of 'text = True'
# )

# if result.returncode != 0:
# raise Exception('could not clear apt cache: ' + result.stderr)


#-----------------------------------------------------------------------------------------------
Expand Down

0 comments on commit 1c70d91

Please sign in to comment.