Created
February 19, 2019 16:50
-
-
Save ibrechin/0dc42f36a22015f3d6608700bc4e440f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
''' | |
dpkg -l | tail -n +6 | grep -E 'linux-image-[0-9]+' | grep -Fv (uname -r) | |
''' | |
versions = [ | |
] | |
packages = [ | |
'linux-headers-{}-generic', | |
'linux-headers-{}', | |
'linux-image-extra-{}-generic', | |
'linux-image-{}-generic', | |
] | |
for version in versions: | |
for package in packages: | |
subprocess.run(['dpkg', '--purge', package.format(version)]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment