add-apt-repository in debian

←手機掃碼閱讀     火星人 @ 2014-03-03 , reply:0

add-apt-repository in debian

add-apt-repository in debian


在ubuntu下 add-apt-repository 命令挺好用,今天看別人推薦fcitx的新功能就想試試。以前我是從debina的backports裡面直接拉的,版本為4.0.1~現在通過ppa直接從fcitx的站點裡拿了

原文地址:http://blog.anantshri.info/howto-add-ppa-in-debian/1. Download the script



$ wget http://blog.anantshri.info/content/uploads/2010/09/add-apt-repository.sh.txt


2.  Save this file in /usr/sbin/

$ cp add-apt-repository.sh.txt /usr/sbin/add-apt-repository

3.  Change permissions to execute

$ chmod o+x /usr/sbin/add-apt-repository

4.  Change ownership to root

$chown root:root /usr/sbin/add-apt-repository

5.  Now when ever you need to execute command type

$ sudo add-apt-repository ppa:ppa-name

Opening this script to larger audience so that we can crowdsource efforts if someone likes it.

hope this can help someoneFile :add-apt-repository

view plaincopy to clipboardprint?#!/bin/bash   
if [ $# -eq 1 ]  
NM=`uname -a && date`  
NAME=`echo $NM | md5sum | cut -f1 -d" "`  
then  
    ppa_name=`echo "$1" | cut -d":" -f2 -s`  
    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"  
        echo "deb http://ppa.launchpad.net/$ppa_name/ubuntu lucid main" >> /etc/apt/sources.list  
        apt-get update >> /dev/null 2> /tmp/${NAME}_apt_add_key.txt  
        key=`cat /tmp/${NAME}_apt_add_key.txt | cut -d":" -f6 | cut -d" " -f3`  
        apt-key adv --keyserver keyserver.ubuntu.com --recv-keys $key  
        rm -rf /tmp/${NAME}_apt_add_key.txt  
    fi  
else  
    echo "Utility to add PPA repositories in your debian machine"  
    echo "$0 ppa:user/ppa-name"  
fi  
#!/bin/bash
if [ $# -eq 1 ]
NM=`uname -a && date`
NAME=`echo $NM | md5sum | cut -f1 -d" "`
then
        ppa_name=`echo "$1" | cut -d":" -f2 -s`
        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"
                echo "deb http://ppa.launchpad.net/$ppa_name/ubuntu lucid main" >> /etc/apt/sources.list
                apt-get update >> /dev/null 2> /tmp/${NAME}_apt_add_key.txt
                key=`cat /tmp/${NAME}_apt_add_key.txt | cut -d":" -f6 | cut -d" " -f3`
                apt-key adv --keyserver keyserver.ubuntu.com --recv-keys $key
                rm -rf /tmp/${NAME}_apt_add_key.txt
        fi
else
        echo "Utility to add PPA repositories in your debian machine"
        echo "$0 ppa:user/ppa-name"
fi

Install Fcitxview plaincopy to clipboardprint?sudo add-apt-repository ppa:fcitx-team/nightly  
sudo apt-get update  
sudo apt-get install fcitx  
sudo apt-get install fcitx-module-cloudpinyin  
sudo add-apt-repository ppa:fcitx-team/nightly
sudo apt-get update
sudo apt-get install fcitx
sudo apt-get install fcitx-module-cloudpinyinover~
《解決方案》

謝謝分享....學習鳥




[火星人 ] add-apt-repository in debian已經有661次圍觀

http://coctec.com/docs/service/show-post-1373.html