apt下载依赖

    技术2022-07-16  69

    #!/bin/bash logfile=./log ret="" function getDepends() { echo "fileName is" $1>logfile # use tr to del < > ret=`apt-cache depends $1|grep 依赖 |cut -d: -f2 |tr -d "<>"` echo $ret|tee -a $logfil } libs=$1 i=0 while [ $i -lt 3 ] ; do let i++ echo $i # download libs newlist=" " for j in $libs do added="$(getDepends $j)" newlist="$newlist $added" apt install $added --reinstall -d -y done libs=$newlist done

     

    Processed: 0.011, SQL: 10