I've been trying to create a script that runs sudo apt-get update and sudo apt-get autoremove whenever I log in. It goes like this:
#!/bin/bash
(sudo apt-get update)
(sudo apt-get autoremove)
But whenever I run the script it freezes my computer. I'm assuming it's because it's waiting for the script to supply a password. Would it work if I added PASSWD:mypassword after the commands like this:
#!/bin/bash
(sudo apt-get update)PASSWD:mypassword
(sudo apt-get autoremove)PASSWD:mypassword
or is there something else I should do? Is there even a way? If so please tell me!