为Ubuntu瘦身

2007年2月21日星期三

大家都知道系统用久了,就会慢慢变得臃肿,速度当然也就会有一些影响,所以当那些加速系统的方法不在奏效的时候,来试试给系统减肥吧.
其实Ubuntu的减肥很简单,只需简单的几步就可以吧那些不需要的文件彻底清除,还你一个清洁的系统..

1. 用新利得删除残留的配置文件
经常安装和卸载软件用户都知道只用 apt-get remove 是不能把软件彻底清除的,所以养成良好的习惯很重要,我一般都是认为那些以后不会再安装的软件都用 aptitude purge/apt-get remove -- purge 来卸载,这样就会把配置文档也一起删除,如果不知道以前卸载的那些配置文档删除有没有怎么办!?
没关系"凡存在过的必留下痕迹"(keso语^_^),我们来一步一步删除那些残留文档:
打开新利得(系统-系统管理-新利得),在左下角选择状态,现在在上面的列表里就会看到如下的分类:

  1. 已安装
  2. 已安装(本地的或陈旧的)
  3. 未安装
  4. 未安装的(残存配置)
  5. 软件仓库里的新内容
现在选择未安装的(残存配置)如果没有这个选择那就证明你的系统并没有残存配置文件.:)
现在把右面列表里不想保留的配置文件删除就可以了.

2. 删除系统无用的软件包
当你需要安装某个软件包时,APT从/etc/apt/sources.list中所列的主机下载所 需的文件,将它们保存到本机软件库(/var/cache/apt/archives/), 然后开始安装.
本地软件库会不断膨胀占用大量硬盘空间,幸运的是,APT提供了工具来管理本地 软件库:apt-getclean方法和autoclean方法.
apt-get clean将删除/var/cache/apt/archives目录 和/var/cache/apt/archives/partial目录下锁文件以外的所有文件. 这样以来,当你需要再次安装某个软件包时,APT将重新下载它.
apt-get autoclean仅删除那些不需要再次下载的文件.

3. 卸载那些不被使用的local翻译文档
这次我们要用到一个工具啦:localepurge 看名字就能明白他是干什么的啦.
安装localepurge: sudo apt-get install localepurge
安装好以后,当我们每次使用apt安装软件的时候localepurge就会根据你locale的设置来删除那些不需要的locale文档,比如:当我aapt安装armarok以后就会在安装完成之后看到像:
localepurge: Disk space freed in /usr/share/locale: 70***K (7M左右的文档,具体的数据忘了)
当然你也可以通过编辑/etc/locale.nopurge 来编辑需要保留的locale文档..

4. 使用一些工具删除"孤儿软件包"
孤儿软件包是指那些已经没有人维护的软件包当然也就没有软件要依赖它,这儿我们可以用GtkOrphan(要自己下载Deb包安装)或者Wajig(可以apt安装),这两个都是GUI的操作界面,我都没有使用过就不多说了,如果想了解更多的信息可以参考这儿 .

5. 使用debfoster来跟踪安装的软件包
安装:sudo apt-get install debfoster
当我们使用apt安装软件的时候,它会把那个软件所依赖的软件包都安装上去,但是当我们卸载这个软件包的时候,那些为满足这个软件包的依赖关系而装上去的包并没有从系统里卸载掉.这个时候我们就会用到debfoster啦.
debfoster是apt-get和dpkg的前端,当第一次运行debfoster的时候它会问你那些软件包是要保留的,如果不需要就选n就行了.
使用debfoster我们可以方便的安装和卸载软件,比如可以使用debfoster package 来安装某个软件,当我们不需要的时候可以用 debfoster package- 来删除它,同时那些没有用的包也会一起删掉.

6. 使用trans-purge 来为Linux桌面瘦身加速
这个可以参考LinuxTOY的介绍,十分详细.


好了经过这几步系统基本上就很清爽了..

Source(感谢):LinuxTOY,Ubuntu Tutorials

发帖者 apuar 时间: 17:50 1 评论  

升级Azureus2.5.0.0到2.5.0.4

2007年2月14日星期三

Azureus是我一直使用的BT客户端,但最近没怎么下东西,有段时间没用了,今天打开的时候提示可以升级到2.5.0.4(我现在的版本是2.5.0.0),于是就让他自动升级..但是下载好Azureus2.5.0.4.jar以后重启,竟然没更新,试了好几次都是这样,只好手动更新..
关闭Azureus,打开终端:

sudo cp /tmp/Azureus2.5.0.4.jar /usr/share/java/Azureus2.jar
似乎Azureus自动升级本来就有点问题..还是我的RP有问题!?

发帖者 apuar 时间: 03:15 0 评论  

巴西google adsense 用户怎么不找我呢!

2007年2月6日星期二

第一疯:

Hello,
I want to solicit your attention to recieve money on my behalf.

The purpose of my contacting you is because my status will not permit me to do this alone.
When you reply this message,

I will send you details of the business and more information about myself.

My personal email is: mou_xinshengxx1@yahoo.com.hk
Thank you.
Mou Xinsheng
第二疯:
Am Lady Peggy Morrison, suffering from cancerous ailment. I am a widow my husband Sir Richard Morrison an Englishman who is dead. My husband was into private practice all his life before his death. My husband and I made a vow to uplift the down-trodden and the less-privileged individuals as he had passion for people who can not help themselves due to physical disability or financial predicament. I can adduce this to the fact that he needed a Child from this relationship, which never came. When my late husband was alive he deposited the sum of 20 Million(twenty Million Great Britain Pounds Sterling which were derived from his vast estates and investment in capital market with his bank here in UK. Presently, this money is still with the bank.Recently,my Doctor told me that I have limited days to live due to the cancerous problems I am suffering from.I have decided to donate this fund to you and want you to i took this decision because I do not have any child that will inherit this money.please assure me that you will act just as I have
stated herein.Hope to hear from you thanks.contact my private
emailaddress:peggymorrison14@yahoo.co.uk
Peggy Morrison

有这好事.巴西的google adsense用户快给我发邮件吧.
PS:最近收到从yahoo.com.hk来的这种垃圾邮件太多了..

发帖者 apuar 时间: 23:53 0 评论  

Ubuntu下RAR Unrar 版本的问题

rar unrar是win.rar GmbH发布的linux下解压缩rar文件的工具.它的版本和windows下winrar的版本是相对应的.
所以一般都在在装完系统后就直接

apt-get install rar unrar
但是最近我发现有些在verycd下载的rar文档无法解压..提示
*** glibc detected *** realloc(): invalid next size: 0x080bda88 ***
google一下似乎是rar版本太低的问题..
源里的rar 版本是3.51 而windows下的winrar都3.70了..
所以用老板本的rar 无法解压新版本压缩的rar文档
刚才去rarlab去下载了3.60的版本试了一下.果然可以解压缩..

RAR 3.60 Copyright (c) 1993-2006 Alexander Roshal 5 Aug 2006
Shareware version Type RAR -? for help


Extracting from 80.rar

VeryCD Mp3共享计划

对象:
所有崇尚自由、热爱音乐的网友

目标:
1. 每人共享两三张专辑,建立P2P世界最大的Mp3音乐库
2. 通过VeryCD网站检索让所有用户都能方便、快速的下载Mp3
3. 让收费下载站都去死……

对下载者的倡议:
1. 下载的同时提供尽可能多的上传,利人利己
2. 推荐你的亲友也来下载,让更多的人分享资源
3. 保留下载的压缩包,并将其继续共享

对发布者的要求:
1. 有计划的发布,附上介绍&图片,不发布重复资源
2. 统一的Mp3格式、ID3信息
3. 统一的RAR打包方式及文件名
4. 提供足够的带宽进行发布

软件条件:
eMule:建议使用最新的VeryCD版eMule软件
服务器:ed2k://|server|61.152.99.115|4242|/
昵称:[CHN][VeryCD:论坛ID]你的昵称


Creating 70.80 OK
Extracting 70.80/少年维特的烦恼.mp3 OK
Extracting 70.80/爱 春 秋 .mp3 OK
Extracting 70.80/太阳的眼泪.mp3 OK
Extracting 70.80/月舞.mp3 OK
Extracting 70.80/别哭别哭.mp3 OK
Extracting 70.80/垮掉的一代.mp3 OK
Extracting 70.80/二十二条校规 .mp3 OK
Extracting 70.80/DANCING IN THE RAIN.mp3 76%^ OK
Extracting 70.80/爱上你我很快乐.mp3 OK
Extracting 70.80/逃亡列车.mp3 OK
All OK

发帖者 apuar 时间: 16:50 0 评论  

我的Firefox扩展

生成: Tue Feb 06 2007 02:24:43 GMT+0800 (MALST)
User Agent: Mozilla/5.0 (X11; U; Linux i686; zh-CN; rv:1.8.1) Gecko/20061010 Firefox/2.0

启用扩展: [17]

  • Adblock Plus 0.7.2.4 - 广告已成往事!
  • Add Bookmark Here 0.5.7 - A convenient way to add bookmarks.
  • ChatZilla 0.9.77 - A clean, easy to use and highly extensible Internet Relay Chat (IRC) client.
  • CustomizeGoogle 0.55 - Enhance Google search results and remove ads and spam
  • DownThemAll! 0.9.9.7 - 针对Firefox设计的批量下载工具。
  • Fasterfox 2.0.0 - 对Firefox进行性能与网络优化
  • GButts 1.4.8 - Display all of your Google Services as buttons just next to your "Home" button or anywhere you like it!
  • Gmail Notifier 0.5.6.5 - Gmail邮件提醒插件
  • Google Toolbar for Firefox 3.0.20061204L beta - 让 Google 的动力伴您在网上任意遨游!
  • Greasemonkey 0.6.6.20061017.0 - A User Script Manager for Firefox
  • MR Tech Local Install 5.3.2.3 - 便于本地安装扩展和主题的强大工具包 (zh-CN)
  • NoScript 1.1.4.5.061221 - 为您的 Firefox 提供额外保护: NoScript 根据您的选择,只允许受信任的网站启用 JavaScript、Java 或其他插件。白名单基于优先阻止机制,在不损失任何功能的情况下,阻止利用已知或未知安全漏洞的攻击。您一定会发现: 使用 NoScript 的 Firefox 确实更安全了。
  • Performancing 1.3.5 - A full featured blog editor that sits right in your Firefox browse and lets you post to your blog easily.
  • Personal Menu 2.3 - 取代一成不變的選單, 美化您的 Firefox!
  • ReminderFox 1.1.1 - 显示并管理备忘和计划
  • Tab Mix Plus 0.3.5.2 - 加强标签页浏览功能。
  • United States English Dictionary 2.0.0.6 - English United States (en-US) spellchecking dictionary

已安装主题: [2]
已安装插件: (8)
  • Default Plugin
    - The default plugin handles plugin data for mimetypes and extensions that are not specified and facilitates downloading of new plugins.
  • Google VLC multimedia plugin 1.0
    - mplayerplug-in 3.25

    Video Player Plug-in for QuickTime, RealPlayer and Windows Media Player streams using MPlayer
    JavaScript Enabled and Using GTK2 Widgets
  • Java(TM) Plug-in 1.5.0_06-b05
    - Java(TM) Plug-in 1.5.0_06
  • mplayerplug-in 3.25
    - mplayerplug-in 3.25

    Video Player Plug-in for QuickTime, RealPlayer and Windows Media Player streams using MPlayer
    JavaScript Enabled and Using GTK2 Widgets
  • QuickTime Plug-in 6.0
    - mplayerplug-in 3.25

    Video Player Plug-in for QuickTime, RealPlayer and Windows Media Player streams using MPlayer
    JavaScript Enabled and Using GTK2 Widgets
  • RealPlayer 9
    - mplayerplug-in 3.25

    Video Player Plug-in for QuickTime, RealPlayer and Windows Media Player streams using MPlayer
    JavaScript Enabled and Using GTK2 Widgets
  • Shockwave Flash
    - Shockwave Flash 9.0 r31
  • Windows Media Player Plugin
    - mplayerplug-in 3.25

    Video Player Plug-in for QuickTime, RealPlayer and Windows Media Player streams using MPlayer
    JavaScript Enabled and Using GTK2 Widgets

发帖者 apuar 时间: 02:50 0 评论  

Ubuntu 新手入门视频教程

2007年2月2日星期五

发帖者 apuar 时间: 23:58 0 评论  

Ubuntu下一款不错的截图软件scrot

安装:
sudo apt-get install scrot
安装完以后在终端运行就会保存当前全屏幕到home文件夹,
为了使用方便可以用Alacarte菜单编辑器把scrot添加到图像菜单中.命令参数可以在终端下输入
scrot –help
查看,我的参数设置为
scrot -s -b -e ‘mv $f ~/Doc/Picture/snapshoot/’

-s 表示 手动选择截图区域或者窗口
-b 截取窗口时保存带窗口边框的图片
-e 截图之后对所截图片执行命令操作(这儿是把截好的图片放到我指定的文件夹里)

最后把它拖到菜单栏就可以了,以后截图是只要点击一下图标,再点一下窗口标题就可以了,想截取任意屏幕范围,就点一下菜单栏上的图标,再在屏幕上拉框.

发帖者 apuar 时间: 00:58 0 评论  

更改 Ubuntu 系统的预设程序

via:linuxtoy
在默认情况下,Ubuntu 系统会为用户预设程序。就拿文本编辑器来说吧,Ubuntu 预设的是 Nano,对某些朋友来说,使用 Vim 可能更得心应手些。那么如何更改这些预设的程序呢?
你可以使用 sudo update-alternatives –config editor 命令来更改默认的文本编辑器。在我的系统中,执行该命令后输出结果如下:

Selection Alternative
———————————————–
1 /usr/bin/vim
2 /bin/ed
*+ 3 /bin/nano

按照提示,输入数字 1 即可将当前默认的 Nano 更改为 Vim。
事实上,update-alternatives 命令还可以配置 FTP、Telnet、rsh 等预设程序。更多的你可以查看 /etc/alternatives 目录。

发帖者 apuar 时间: 00:56 0 评论  

在Gnome桌面环境下安装KDE和XFCE

Gnome是Ubuntu/Linux下默认的桌面环境,KDE和XFCE也是Ubuntu下的桌面环境,不过都对应着一个单独的发行版Kubuntu和 Xubuntu,如果想尝试一下KDE和XFCE桌面的话,只需下载和安装他们的桌面前端就可以了.安装方法如下终端内输入:KDE:

  • sudo aptitude update && sudo aptitude install kubuntu-desktopXFCE:
  • sudo aptitude update && sudo aptitude install xubuntu-desktop
安装完以后登出,在屏幕左下的选项里就可以自由切换桌面环境.
卸载方法:
  • sudo aptitude remove kubuntu-desktop/xubuntu-desktop
说明: 使用aptitude而不用apt-get 是因为aptitude会记录额外安装的软件并解决依赖性问题,在卸载时也会把不被已安装软件使用的套件卸载.这样安装和卸载比较方便,不致于会有不用的依赖套件遗留在系统内造成资源浪费.

发帖者 apuar 时间: 00:54 0 评论  

Mount参数和一个挂在ISO脚本

参数 作用
mount 列出挂载中的设备
mount -V 显示版本
mount -l : 列出挂载中的设备,并且显示卷标

挂载ISO文件

创建一个挂载点:

  • sudo mkdir –p /mnt/iso
假设ISO文件的名字是disk1.iso,使用mount命令如下:
  • sudo mount -o loop disk1.iso /mnt/iso
此时,该ISO文件就被挂载到了/mnt/iso/

下面推荐一个挂载ISO文件的小脚本,非常实用,Ubuntu.cnxiaosilent编写:

GMountISO(0.6)

发帖者 apuar 时间: 00:45 0 评论  

让VIM支持gb2312编码

修改.vimrc文件 添加:

"设定文件编码类型,彻底解决中文编码问题

let &termencoding=&encoding
set fileencodings=utf-8,gbk,ucs-bom,cp936
来源Ubuntu.cn 感谢:karron

发帖者 apuar 时间: 00:43 0 评论  

bcchunk 把bin/cue镜像转换为ISO

安装

sudo apt-get install bchunk

用法

就像名字提到的一样,一个BIN/CUE 的CD镜像包含两个文件。BIN是一个CD的二进制原始数据,CUE是表示CD数据布局的ASCII文件.

一般用法:

bchunk

例如:

bchunk myimage.bin myimage.cue myimage
这将生成一个myimage.iso的新文件.

来源: wiki.ubuntu.org.cn

发帖者 apuar 时间: 00:40 0 评论  

安装中文man

1.安装manpages-zh

sudo apt-get install manpages-zh
2. 因为这个man的中文包不是很全,所以就采用了ee的方法,定义一个命令'cman'来查看中文man文件.
alias cman='man -M /usr/share/man/zh_CN'
3. 用ee的一个脚本转换中文man的编码为utf-8

#!/bin/bash
cd /usr/share/man/zh_CN/
for k in *
do
cd $k
for i in *.gz
do
j=`echo ${i%\.gz}`
gunzip $i
iconv -f gb18030 -t utf8 $j >tmp
mv tmp $j
gzip $j
done
cd ..
done
4. 现在可以用cman来查看中文man喽...e.g: cman ls

来源:Ubuntu中文论坛

发帖者 apuar 时间: 00:35 0 评论  

基本Unix命令

2007年2月1日星期四

  • pwd
    • 显示当前工作路径。
  • whoami
    • 显示当前用户名。
  • file foo
    • 显示foo文件的属性。
  • type -p commandname
    • 显示命令commandname所的的地方。
    • which commandname也可以用来做这个 .

  • type commandname
    • 显示命令 commandname的信息。
  • apropos key-word
    • 找到和 key-word相关的命令。
    • man -k key-word也可以做到
  • whatis commandname
    • 显示该命令的一句话帮助。 commandname.
  • man -a commandname
    • 显示命令的解释信息。 commandname. (Unix style)
  • info commandname
    • 显示很长的命令解释 commandname. (GNU style) ls
    • 列出目录内容 (非以.开始的文件和目录)

  • ls -a
    • 列出目录内容(所有的文件和目录)
  • ls -A
    • 列出目录内容。(几乎所有的文件和目录,略去".." and ".")
  • ls -la
    • 列出目录所有文件和目录的详细信息。

  • ls -d *
    • 列出当前目录下的目录名称,而不是目录下的内容。
  • lsof foo
    • 显示文件foo的打开状态。
  • mkdir foo
    • 在当前目录下创建一个新的目录foo。
  • cd foo
    • 切换到当前目录下或者在变量CDPATH中列出来的目录foo。在builtins(7)查看命令cd。
  • cd /
    • 切换到根目录。
  • cd
    • 切换到用户主目录。
  • cd /foo
    • 切换到绝对路径/foo所指定的目录。
  • cd ..
    • 切换到上一级目录。
  • cd ~foo
    • 切换到用户主目录下的foo目录去。
  • cd -
    • 切换到上一次所去的目录。
    • 使用默认的分页程序查看文件/etc/motd的内容.

  • touch junkfile
    • 创建一个空文件junkfile。
  • cp foo bar
    • 拷贝一个已有的文件foo到新文件bar。
  • rm junkfile
    • 删除文件junkfile
  • mv foo bar
    • 把已有的文件foo重命名为bar
  • mv foo bar/baz
    • 把已有的文件foo移动到新位置并重命名为bar/baz。目录bar必须存在。
  • chmod 600 foo
    • 让已经存在的文件foo其他人不能读写。(所有人都 不能执行)。
  • chmod 644 foo
    • 使文件foo其他的人可以读,但是不能写。(所有人 都不能执行)
  • chmod 755 foo
    • 使文件foo其他的人能读不能写。(所有人都可以执行)
  • top
    • 全屏显示进程信息。输入”q”退出。
  • ps aux | pager
    • 用BSD风格输出所有正在运行的进程的信息。

  • ps -ef | pager
    • 用system-V风格来输出所有正在运行的进程的信息。
  • ps aux | grep -e "[e]xim4*"
    • 显示exim4进程,或者运行exim的进程。输入man grep可以从grep(1)的手册页学习正则表达式。

  • ps axf | pager
    • 用ASCCI艺术形式来显示运行所有进程信息。
  • kill 1234
    • 杀死进程号为1234的进程。

  • grep -e "pattern" *.html
    • 找到当前目录下面所有以.html结尾的文件中含有"pattern"的行,并显示它们。
  • gzip foo
    • 用Lempel-Ziv(LZ77)压缩算法压缩foo,生成foo.gz。
  • gunzip foo.gz
    • 将文件foo.gz解压缩生成foo。
  • bzip2 foo
    • 将文件foo.bz2解压缩生成foo。
  • tar -xvvf foo.tar
    • 从打包文件foo.tar解出文件来。
  • tar -xvvzf foo.tar.gz
    • 从打包压缩的文件foo.tar.gz中解开文件。
  • tar -xvvf --bzip2 foo.tar.bz2
    • 从文件foo.tar.bz2解压缩文件。

  • tar -cvvf foo.tar bar/
    • 把目录bar/的内容打包存放到foo.tar存档中。
  • tar -cvvzf foo.tar.gz bar/
    • 把目录bar/的内容打包并且压缩存放到foo.tar.gz存档中。
  • tar -cvvf --bzip2 foo.tar.bz2 bar/
    • 把目录bar/中的内容打包存放到foo.tar.bz2存档里面。

  • zcat README.gz | pager
    • 实用默认的分页显示程序pager来显示压缩文件README.gz中的内容。
  • zcat README.gz > foo

    • 使用文件README.gz解开后的内容创建一个文件foo。
  • zcat README.gz >> foo

    • 把文件README.gz解开后的内容追加到文件foo的后面(如果文件不存在的话,就会创建一个)。
  • find . -name pattern
    • 用shell找到匹配pattern的文件名(慢一些)。
  • locate -d . pattern
    • 用shell找到匹配pattern的文件名(使用已有的规则的数据库,快一些)。

节选自:UbuntuManual

发帖者 apuar 时间: 21:30 0 评论