Skip to content

Instantly share code, notes, and snippets.

@wataken44
Created April 26, 2019 02:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wataken44/a64f6b0ec8212c99d28728a4de3e4f6c to your computer and use it in GitHub Desktop.
Save wataken44/a64f6b0ec8212c99d28728a4de3e4f6c to your computer and use it in GitHub Desktop.
#!/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