更新: 使用software-properties-common 代替脚本 sudo apt install -y apt-transport-https ca-certificates gnupg2 software-properties-common ============================================================================== #!/bin/bash if [ "$#" -ge "1" ]; then ppa_name=`echo "$1" | awk -F ':' '{print $2}'` app_name=`echo "$ppa_name" | cut -d '/' -f2-` if [ -z "$ppa_name" ]; then echo "PPA name not found" echo "Utility to add PPA repositories in your debian machine" echo "$0 ppa:user/ppa-name" else echo "$ppa_name" " $app_name" if [ "$2" != "" ]; then version=$2 else version="xenial" fi echo "deb http://ppa.launchpad.net/$ppa_name/ubuntu $version main" > /etc/apt/sources.list.d/$app_name.list apt-get update > /dev/null 2> /tmp/apt_add_key.txt key=`cat /tmp/apt_add_key.txt | awk -F ":" '{print $6}' | awk '{print $2}'` apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv $key rm -rf /tmp/apt_add_key.txt fi else echo "Utility to add PPA repositories in……

阅读全文