1
#!/usr/bin/env python3

# KINPM | KINPM Is Not a Package Manager

from subprocess import run
from time import sleep
from sys import exit

def hata():
    print("An error has just occured!")
    return None
def yok():
    print("No such option!")

sleep(1)

print("\n----------------------------------\n| KINPM Is Not a Package Manager |\n----------------------------------")

result = run("cd /root || echo 'kök'", shell=True, capture_output=True, text=True)
if "kök" in result.stdout:
    sleep(3)
    print("\nYou haven't run KINPM with sudo!\n")
    exit()
    
while True: 
    sleep(2)
    islem = input("\nWhat to do now?\n\n1: Refresh the package lists\n2: Cleaning\n0: Exit\n\n>>> ")
    islem = islem.replace(" ","")
    sleep(1)
    print()
    if islem == "1":
        print("Refreshing the package lists...")
        result = run("apt update", shell=True, capture_output=True, text=True)
        if "çözümlenemedi" in result.stdout or "geçici bir sorunla" in result.stdout or "but failed" in result.stdout:
            hata()
        elif "Tüm paketler güncel." in result.stdout or "All packages are up to date." in result.stdout:
            print("All packages are up to date.")
        else:
            sleep(1)
            gncl = input("There are some upgradeable packages. Want to upgrade all? [Y/any]: ")
            gncl = gncl.lower()
            gncl = gncl.replace(" ","")
            if gncl == "y":
                sleep(1)
                print("Upgrading all...")
                result = run("apt update && apt upgrade -y ; apt autoremove -y ; apt clean", shell=True, capture_output=True, text=True)
                if "çözümlenemedi" in result.stdout or "geçici bir sorunla" in result.stdout or "but failed" in result.stdout:
                    hata()
                else:
                    print("All packages are now upgraded!")
            else:
                sleep(1)
                print("Ok then.")
    elif islem == "2":
        try:
            run("apt autoremove -y ; apt clean", shell=True, capture_output=True, text=True)
        except Exception:
            hata()
        print("Cleaning is done!")
    elif islem == "0":
        exit()
    else:
        yok()

For immediate assistance, please email our customer support: [email protected]

Download RAW File