附加在/etc/apt/sources.list [英] Append to /etc/apt/sources.list
本文介绍了附加在/etc/apt/sources.list的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我创建一些脚本来简化应用程序安装,我需要追加到/etc/apt/sources.list中的结尾
这code以下追加到〜文件,但没有在/ etc /公寓/
回声的deb http://ppa.launchpad.net/person/ppa/ubuntu主业力>>的/etc/apt/sources.list
@meder
我都试过,没有运气这下面的命令:
须藤回声的deb http://ppa.launchpad.net/person/ppa/ubuntu主业力>>的/etc/apt/sources.list
#=== ---
须藤SH回声的deb http://ppa.launchpad.net/person/ppa/ubuntu主业力'>>的/etc/apt/sources.list
解决方案
这将工作:
须藤SH -c回声的deb http://ppa.launchpad.net/person/ppa/ubuntu主业力'>>的/etc/apt/sources.list
然而,而不是编辑的/etc/apt/sources.list
,这是简单的增加一个新的 *名单
文件 /etc/apt/sources.list.d
。
例如,
回声的deb http://ppa.launchpad.net/person/ppa/ubuntu主业力'> /tmp/myppa.list
须藤CP /tmp/myppa.list /etc/apt/sources.list.d/
RM /tmp/myppa.list
I'm creating some scripts to streamline application installations and I need to append to the end of /etc/apt/sources.list
This code below append to files in ~ but not in /etc/apt/
echo "deb http://ppa.launchpad.net/person/ppa/ubuntu karmic main" >> /etc/apt/sources.list
@meder
I have tried these following commands with no luck:
sudo echo "deb http://ppa.launchpad.net/person/ppa/ubuntu karmic main" >> /etc/apt/sources.list
#===---
sudo sh "echo 'deb http://ppa.launchpad.net/person/ppa/ubuntu karmic main' >> /etc/apt/sources.list"
解决方案
This will work:
sudo sh -c "echo 'deb http://ppa.launchpad.net/person/ppa/ubuntu karmic main' >> /etc/apt/sources.list"
However, instead of editing /etc/apt/sources.list
, it is simpler to add a new *.list
file to /etc/apt/sources.list.d
.
For example,
echo 'deb http://ppa.launchpad.net/person/ppa/ubuntu karmic main' >/tmp/myppa.list sudo cp /tmp/myppa.list /etc/apt/sources.list.d/ rm /tmp/myppa.list
这篇关于附加在/etc/apt/sources.list的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文