首页 > 其他 > 详细

〖Linux〗apt-get wait for another apt process

时间:2014-01-19 08:54:07      阅读:297      评论:0      收藏:0      [点我收藏+]
bubuko.com,布布扣
#!/bin/bash

i=0
tput sc
while fuser /var/lib/dpkg/lock >/dev/null 2>&1 ||         fuser /var/cache/apt/archives/lock >/dev/null 2>&1; do
    case $(($i % 4)) in
        0 ) j="-" ;;
        1 ) j="\\" ;;
        2 ) j="|" ;;
        3 ) j="/" ;;
    esac
    tput rc
    echo -en "\r[$j] Waiting for other software managers to finish..." 
    sleep 0.5
    ((i=i+1))
done

/usr/bin/apt-get "$@"
bubuko.com,布布扣

 Save to /usr/local/sbin/apt-get, then chmod +x /usr/local/sbin/apt-get.

参考文献:

  [1] http://askubuntu.com/questions/373425/how-can-i-make-apt-get-wait-for-another-instance-to-finish

〖Linux〗apt-get wait for another apt process

原文:http://www.cnblogs.com/scue/p/3525698.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!