This is a script that allows to install packages from a folder, filtering to use only which are already installed
01 | #!/bin/bash |
02 | # END |
03 | for e in $( ls -F | grep - v [/,*]) |
04 | do |
05 | #we'll store in $filename the dpkg package name. |
06 | filename=$( echo $e | cut -d_ -f1) |
07 | dpkg -l | grep $filename > /dev/null |
08 |
09 | if [ $? == 0 ] ; then |
10 |
11 | sudo dpkg -i $e |
12 | else |
13 | echo $filename "is not installed, ignored" |
14 | fi |
15 | done |