debian add-apt-repository
kevin.Zhu 发布于:2013-12-21 1:22 分类:Linux 有 16 人浏览,获得评论 0 条
前期准备工作
对于Ubuntu用户来说,安装一些PPA上的软件是一件简单的事情,然而对于Debian用户来说你经常会碰到如下情况“add-apt- repository: command not found, then you cannot add them … it is possible, although not recommended”。因此对于Debian或类Debian系统的用户,如果想要从PPA上面安装或更新软件包,可能需要下列脚本:
#!/bin/sh
if [ $# -eq 1 ]
then
ppa_name=`echo "$1" | 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 ppa: user-name"
else
echo "$ppa_name"
echo "deb http://ppa.launchpad.net/$ppa_name/ubuntu maverick main" >> /etc/apt/sources.list
apt-get update > /dev/null 2>> /tmp/apt_add_key.txt
key=`cat /tmp/apt_add_key.txt | cut -d ""-f6 | cut -d"" -f3`
apt-key adv-keyserver keyserver.ubuntu.com-recv-keys $key
rm -rf /tmp/apt_add_key.txt
fi
else
echo "Utility to add PPA repositories in your debian machine"
echo "$0/ppa ppa: user-name"
fi
1,安装add-apt-repository
保存这个脚本到/usr/bin目录下,名称为add-apt-repository,然后执行下列命令即可:
chmod +x /usr/bin/add-apt-repository
chown root:root /usr/bin/add-apt-repository
现在我们也可以使用 add-apt-repository 命令进行软件安装了。
2.安装硬件检测
apt-get install xdebconfigurator
检测你的硬件,xdebconfigurator
3.安装localepurge
apt-get install localepurge
在对话框中选择你要保留使用的locale .默认情况下它已经选好了你现前设置的那些locale,所以直接回车。当然你也可以 dpkg-reconfigure localepurge 进行详细的配置。 现在执行localepurge 这步将清除你用不着的locale,让他们释放你的磁盘空间。以后你不管安装什么软件,它都将自动帮你清除那些没用的locale。