免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2138 | 回复: 1
打印 上一主题 下一主题

add-apt-repository in debian [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-12-06 18:54 |只看该作者 |倒序浏览
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. 1. Download the script



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


  3. 2.  Save this file in /usr/sbin/

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

  5. 3.  Change permissions to execute

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

  7. 4.  Change ownership to root

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

  9. 5.  Now when ever you need to execute command type

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

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

  12. hope this can help someone
复制代码
File :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 Fcitx
  1. view plaincopy to clipboardprint?sudo add-apt-repository ppa:fcitx-team/nightly  
  2. sudo apt-get update  
  3. sudo apt-get install fcitx  
  4. sudo apt-get install fcitx-module-cloudpinyin  
  5. sudo add-apt-repository ppa:fcitx-team/nightly
  6. sudo apt-get update
  7. sudo apt-get install fcitx
  8. sudo apt-get install fcitx-module-cloudpinyin
复制代码
over~

论坛徽章:
0
2 [报告]
发表于 2011-12-22 21:24 |只看该作者
谢谢分享....学习鸟
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP