0

I'm trying to write a shell script so that when I reinstall my Ubuntu again. I could just run script and retain all the packages. And I'm planning to pass password in form of argument.

My question here is how can i enter into sudo domain without manually entering password. As I'm also planning to design a UI where it can't access the terminal there.

Ex:

./recover.sh password

Would appriciate the response ;)

with regards

pavan

Pavan
  • 101
  • 3

1 Answers1

1

You can issue the command apt-get install ${package_list} and all packages in the the package-list variable will be installed if possible.

There are tools that will give you lists of installed packages. You should remove any packages installed as dependencies, as well as packages installed by default.

Look at the command listed by man -k apt.

If you want no output execute the command export DEBIAN_FRONTEND=noninteractive before running apt-get.

BillThor
  • 11,345
  • 2
  • 28
  • 25