12345678910111213141516171819202122232425262728293031323334353637 |
- #! /bin/bash
- basepath=$(cd `dirname $0`; pwd)
- pkg="$*"
- #rm -rf /var/cache/apt/archives/*
- function getDepends()
- {
- ret=`sudo apt-cache depends $1 |grep -i 依赖 |cut -d: -f2 |tr -d "<>"`
- if [[ -z $ret ]]; then
- # echo '$1 No depends'
- echo -n
- else
- for i in $ret
- do
- if [[ `echo $pkg |grep -e "$i "` ]]; then
- echo "$i already in set"
- echo -n
- #dpkg-query --list | grep libgtkglext1
- #elif [ "`sudo apt-cache search $i | grep $i`" != "" ]; then
- elif [ "`dpkg -l | grep $i`" != "" ]; then
- echo "$i already installed"
- else
- pkg="$pkg $i"
- echo "Download $i ing"
- getDepends $i
- fi
- done
- fi
- }
- for j in $@
- do
- getDepends $j
- done
- echo $pkg
- #apt install $pkg --reinstall -d -y
- sudo apt-get download $pkg -d -y
|