View Full Version : [ubuntu] installing a lot of .deb packages using a script

December 16th, 2012, 10:32 AM

It concerns installing a lot of .deb packages using a script rather than making a large .deb package. I apologize if this is not the right place to post my question.

I have several archived packages and I want to install them on another machine that has no Internet access.

I have all the packages downloaded with wget script that is generated by synoptics and therefore it is good regards dependencies.

To achieve this, what I did was strip away the "wget ..." stuff and left the filenames only in the same order so when I install these packages the dependencies would not pose a problem.

I have tried several versions of the script but all failed.
This is just 4 lines of what is about 50 line package install.

gnome-terminal -x dpkg -i adobe-flashplugin_11.2.202.258-0lucid1_i386.deb
gnome-terminal -x dpkg -i adobe-flash-properties-gtk_11.2.202.258-0lucid1_i386.deb
gnome-terminal -x pkge -i apport-hooks-medibuntu_1medibuntu1_all.deb
gnome-terminal -x pkge -i openjdk-6-jre-lib_6b24-1.11.5-0ubuntu1~10.04.2_all.deb

(the actual file contains many more of these so doing it manually is the very very last resort)

The first line executes console ok. Looked like it because it flashes up and went through several lines and then closes. could not read a thing because it was too fast.
The second console came up and then closed. no problems that I noticed.
but the 3rd consol and the 4th consol said

"There was an error creating the child process for this terminal"

Basically the code should work shouldn't it?
Is there an option that would open the console once and then execute the dpkg for all the files?

If someone could let me know the correct way to code this so that I can install all these packages with a single script it would be appreciated. The script does not have to use terminal but would be nice if I could see the outputs for any error messages.

As long as it does the job I would try any script.


December 16th, 2012, 11:42 AM
from man dpkg

-i, --install package-file...
Install the package. If --recursive or -R option is specified,
package-file must refer to a directory instead.

put all the pakgs in una directory and then:
gnome-terminal -x dpkg -i -R Dir

December 16th, 2012, 03:03 PM
cd thedir
sudo dpkg -i *.deb

December 17th, 2012, 01:10 PM

Thank you so much it makes sense I just did not think.
I should have known that from my dos batch file days.

Unfortunately I broke my ucuntu 10.04 so I am currently reinstalling it now. so
As soon as I have a chance to test this out I will.

thenks again.