0

I am trying to install a list of software with the following command:

sudo apt-get install $(cat installed_software.txt)

But I receive an error message:

sudo: unable to execute /usr/bin/apt-get: Argument list too long

Can anyone help me solve this problem? Thanks!

(Oh, and I have also tried:

xargs -rxa installed_software.txt -- sudo apt-get install --

With no success).

  • Long lists of packages is a poor use of apt. Instead, simply tell apt the few top-level packages you really want, and let apt automagically handle the rest. – user535733 Nov 5 '18 at 12:59
0

Try with following command (see https://askubuntu.com/a/1027484/790920):

sudo apt-get install < installed_software.txt
0

The maximum number of arguments for a command running under sudo is rather pathetic. You will find a the maximum number of arguments is much higher if you run the command as root. i.e. do this instead:

$ sudo su
# apt-get install $(cat installed_software.txt)
  • running as root: apt-get install $(cat installed_software.txt) Reading package lists... Done E: Unsupported file /proc given on commandline E: Unsupported file /proc given on commandline E: Unsupported file /dev/ given on commandline E: Unsupported file /usr/share/dict given on commandline E: Unsupported file /usr/share/dict given on commandline // I don't get it. Why didn't it work? – reaction hashs Nov 5 '18 at 15:07
  • So, I think that would be a problem with the file installed_software.txt. – Doug Smythies Nov 5 '18 at 15:12
  • I guess... Thanks for the help anyway. Gonna try sorting it out. – reaction hashs Nov 5 '18 at 15:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.