Created
April 26, 2019 02:28
-
-
Save wataken44/a64f6b0ec8212c99d28728a4de3e4f6c 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" getdeb.py | |
""" | |
import os | |
import sys | |
def command(s): | |
print(s) | |
os.system(s) | |
def main(): | |
command("sudo apt clean") | |
command("rm ~/work/* -f ") | |
packages = " ".join(sys.argv[1:]) | |
command("sudo apt install -d -y %s" % packages) | |
command("cp -v /var/cache/apt/archives/*.deb ~/work/") | |
command("cd ~/work && tar cvzf packages.tar.gz *.deb") | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment