admin管理员组

文章数量:1606170

一个Linux脚本搞定常用软件的安装

为了测试今天装了一个Vista,Vista感觉很难用,老是出确认提示框,烦死个人鸟。后面再重装了ubuntu,这是第二次装ubuntu。显卡不太顺利,于是我在字符界面安装完之后,再把显卡驱动装上,然后是ADSL和beryl,还算顺利。为了以后结省时间,把常用软件都做成了一个脚本,边做边运行。以后再重装,运行这个脚本就行了,可以实现无人监管的软件安装,linux的命令行和脚本的功能就是强!现在用MySQL基本也是用命令行的时候多,一条命令搞定的事,用GUI要点上几点,习惯了命令行后确实感觉要方便快捷很多。

另注:

(1)为了重装方便,最好备份一下“主文件夹”,里面全是各个软件的配置。

(2)/var/cache/apt/archives/ 文件也要备份下来,除非你想下次重装再从网上慢悠悠的下软件。

(3)find . -name *kopete* -exec rm -rf {} \; 这个命令用于删除当前目录及子目录下所有名称中包含kopete字样的文件。因为用apt-get remove删软件,软件的配置文件还会遗留在主文件,这个命令就可以把它们统统清除干净。

#!/bin/bash

#/var/cache/apt/archives/

#find . -name *kopete* -exec rm -rf {} \;

#-------------------------------------------

#--------- 删除一些没用的软件 ------------

#-------------------------------------------

#Ekiga 软电话

sudo apt-get remove ekiga -y

#电影播放机

sudo apt-get remove totem totem-gstreamer totem-mozilla -y

#Rhythmbox 音乐播放器

sudo apt-get remove rhythmbox -y

#Bittorrent

sudo apt-get remove bittorrent -y

#-------------------------------------------

#--------- 添加新的软件源 ---------------------

#-------------------------------------------

#加入一个软件源

(echo '$a';

echo '## 江苏常州电信';

echo 'deb http://ubuntu99/ubuntu/ feisty main restricted universe multiverse';

echo 'deb http://ubuntu99/ubuntu/ feisty-security main restricted universe multiverse';

echo 'deb http://ubuntu99/ubuntu/ feisty-updates main restricted universe multiverse';

echo 'deb http://ubuntu99/ubuntu/ feisty-proposed main restricted universe multiverse';

echo 'deb http://ubuntu99/ubuntu/ feisty-backports main restricted universe multiverse';

echo 'deb-src http://ubuntu99/ubuntu/ feisty main restricted universe multiverse';

echo 'deb-src http://ubuntu99/ubuntu/ feisty-security main restricted universe multiverse';

echo 'deb-src http://ubuntu99/ubuntu/ feisty-updates main restricted universe multiverse';

echo 'deb-src http://ubuntu99/ubuntu/ feisty-proposed main restricted universe multiverse';

echo 'deb-src http://ubuntu99/ubuntu/ feisty-backports main restricted universe multiverse';

echo 'deb http://ubuntu99/ubuntu-cn/ feisty main multiverse restricted universe';

echo '.'; echo 'wq') | sudo ed -s /etc/apt/sources.list

#从新获取软件源的信息

本文标签: 脚本常用软件Ubuntuvisio2010ubuntuLinux