Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,15 +7,50 @@ import subprocess
|
|
| 7 |
st.title("Try")
|
| 8 |
st.text("running commondsd .....")
|
| 9 |
# subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
| 10 |
-
subprocess.run("sudo apt update", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
sleep(5)
|
| 12 |
-
subprocess.run("sudo apt install wget apt-transport-https", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
sleep(5)
|
| 14 |
-
subprocess.run("wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
sleep(5)
|
| 16 |
-
subprocess.run("sudo dpkg -i google-chrome-stable_current_amd64.deb", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
sleep(5)
|
| 18 |
-
subprocess.run("sudo apt --fix-broken install", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
sleep(5)
|
| 20 |
st.text("done")
|
| 21 |
st.text("chrome")
|
|
|
|
| 7 |
st.title("Try")
|
| 8 |
st.text("running commondsd .....")
|
| 9 |
# subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
| 10 |
+
cmd1 = subprocess.run("sudo apt update", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
| 11 |
+
if cmd1.returncode == 0:
|
| 12 |
+
print("Command output:")
|
| 13 |
+
print(cmd1.stdout)
|
| 14 |
+
else:
|
| 15 |
+
# Print the error message
|
| 16 |
+
print("Error executing command:")
|
| 17 |
+
print(cmd1.stderr)
|
| 18 |
sleep(5)
|
| 19 |
+
cmd2 = subprocess.run("sudo apt install wget apt-transport-https", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
| 20 |
+
if cmd2.returncode == 0:
|
| 21 |
+
print("Command output:")
|
| 22 |
+
print(cmd2.stdout)
|
| 23 |
+
else:
|
| 24 |
+
# Print the error message
|
| 25 |
+
print("Error executing command:")
|
| 26 |
+
print(cmd2.stderr)
|
| 27 |
sleep(5)
|
| 28 |
+
cmd3 = subprocess.run("wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
| 29 |
+
if cmd3.returncode == 0:
|
| 30 |
+
print("Command output:")
|
| 31 |
+
print(cmd3.stdout)
|
| 32 |
+
else:
|
| 33 |
+
# Print the error message
|
| 34 |
+
print("Error executing command:")
|
| 35 |
+
print(cmd3.stderr)
|
| 36 |
sleep(5)
|
| 37 |
+
cmd4 = subprocess.run("sudo dpkg -i google-chrome-stable_current_amd64.deb", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
| 38 |
+
if cmd4.returncode == 0:
|
| 39 |
+
print("Command output:")
|
| 40 |
+
print(cmd4.stdout)
|
| 41 |
+
else:
|
| 42 |
+
# Print the error message
|
| 43 |
+
print("Error executing command:")
|
| 44 |
+
print(cmd4.stderr)
|
| 45 |
sleep(5)
|
| 46 |
+
cmd5 = subprocess.run("sudo apt --fix-broken install", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
| 47 |
+
if cmd5.returncode == 0:
|
| 48 |
+
print("Command output:")
|
| 49 |
+
print(cmd5.stdout)
|
| 50 |
+
else:
|
| 51 |
+
# Print the error message
|
| 52 |
+
print("Error executing command:")
|
| 53 |
+
print(cmd5.stderr)
|
| 54 |
sleep(5)
|
| 55 |
st.text("done")
|
| 56 |
st.text("chrome")
|