<<上篇 | 首页 | 下篇>>

如何扩展Ubuntu的/root分区

一安装Ubuntu发现root "/"分区只有2G多,必须得扩大root文件系统,否则没法用。那扩展/root分区最容易的办法还是:使用Ubuntu的Live CD安装盘启动,选择“不改变操作系统启动Ubuntu试用”选项,该选项直接从光盘启动Ubuntu系统并且没有挂载mount任何硬盘;然后在 Ubuntu操作系统里的system菜单里使用Partition Editor分区编辑器进行扩展root分区,选择/root分区右键鼠标,选择resize/move(改变大小/移动)菜单进行扩展。

除了使用Ubuntu livecd还可以直接使用GParted LiveCD
如果是使用lvm,可以,将pv将入vg,然后调整root filesystem使用的lv的大小
标签 : , ,

Ubuntu下Flash中文方格乱码的解决

安装Ubuntu9.04后访问Google音乐播放器,发现中文变成了方块乱码,Ubuntu下Flash中文方格乱码的解决方法有二,如下:

  • 删除/etc/fonts/conf.d/49-sansserif.conf
sudo mv /etc/fonts/conf.d/49-sansserif.conf /etc/fonts/conf.d/49-sansserif.conf_back
  • 修改/etc/fonts/conf.d/49-sansserif.conf

输入:
cd /etc/fonts/conf.d/

为了安全,备份一下:

sudo cp 49-sansserif.conf 49-sansserif.conf_backup

输入如下指令:

sudo gedit ./49-sansserif.conf

此时文件显示内容。

将其中的第1、2、4个后面的sans-serif或者serif用你自己系统中支持中文的字体的名字代替,注意字体名字的大小写

比如:我的系统中安装了wqy-zenhei.ttf,我则用wqy-zenhei代替上述所说的字段,结果如下:

<match target=”pattern”>
<test qual=”all” name=”family” compare=”not_eq”>
<string>wqy-zenhei</string>
</test>
<test qual=”all” name=”family” compare=”not_eq”>
<string>wqy-zenhei</string>
</test>
<test qual=”all” name=”family” compare=”not_eq”>
<string>monospace</string>
</test>
<edit name=”family” mode=”append_last”>
<string>wqy-zenhei</string>
</edit>
</match>

标签 : , ,

四个Linux版本软件源的设置

Debian和Ubuntu使用apt,Fedora使用yum而Mandriva使用urpm可以通过设置软件源而在线安装或升级软件。Debian和Ubuntu使用apt,Fedora使用yum而Mandriva使用urpm来执行这些操作。首先得选择合适的软件源。

对于Debian,建议使用ustc的源,修改/etc/apt/source.list文件如下:

deb http://debian.ustc.edu.cn/debian/ testing main non-free contrib 
deb http://debian.ustc.edu.cn/debian-security/ testing/updates main non-free contrib
deb http://debian.ustc.edu.cn/debian-uo/ sid marillat ustc java misc
#deb http://ftp3.tsinghua.edu.cn/mirror/debian/debian testing main non-free contrib
#deb http://ftp3.tsinghua.edu.cn/mirror/debian/debian-security testing/updates main non-free contrib
#deb http://ftp3.tsinghua.edu.cn/mirror/debian/debian-unofficial sid marillat ustc java misc

Debian的安装程序开始只安装了基本的软件包,要安装基本的Gnome系统,可以在命令行下输入:

apt-get install x-window-system-core gnome-core gdm xscreensaver

对于Ubuntu,建议使用Ubuntu中文站的源,修改/etc/apt/source.list文件如下:

deb http://archive.ubuntu.org.cn/ubuntu dapper main restricted universe multiverse
deb http://archive.ubuntu.org.cn/ubuntu dapper-security main restricted universe multiverse
deb http://archive.ubuntu.org.cn/ubuntu dapper-updates main restricted universe multiverse
deb http://archive.ubuntu.org.cn/ubuntu dapper-backports main universe multiverse restricted
deb http://archive.ubuntu.org.cn/ubuntu-cn dapper main universe multiverse restricted
deb http://archive.ubuntu.org.cn/ubuntu-cn breezy main universe multiverse restricted

对于Fedora,首先修改yum的软件源,使用速度比较快的国内镜像。按照以下修改/etc/yum.repos.d目录的下面fedora-core.repo,fedora-extras.repo和fedora-updates.repo这几个文件:

#/etc/yum.repos.d/fedora-core.repo
[core]
name=Fedora Core $releasever - $basearch - Base
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/$releasever/$basearch/os/
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/download.fedora.redhat.com/pub/fedora/linux/core/$releasever/$basearch/os/
#baseurl=http://mirrors.geekbone.org/fedora/core/$releasever/$basearch/os/
#mirrorlist=http://fedora.redhat.com/download/mirrors/fedora-core-$releasever
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
#/etc/yum.repos.d/fedora-extras.repo
[extras]
name=Fedora Extras $releasever - $basearch
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/extras/$releasever/$basearch/
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/download.fedora.redhat.com/pub/fedora/linux/extras/$releasever/$basearch/
#baseurl=http://mirrors.geekbone.org/fedora/extras/$releasever/$basearch/
#mirrorlist=http://fedora.redhat.com/download/mirrors/fedora-extras-$releasever
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-extras
gpgcheck=1
#/etc/yum.repos.d/fedora-updates.repo
[updates]
name=Fedora Core $releasever - $basearch - Released Updates
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/updates/$releasever/$basearch/
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/download.fedora.redhat.com/pub/fedora/linux/core/updates/$releasever/$basearch
#baseurl=http://mirrors.geekbone.org/fedora/core/updates/$releasever/$basearch/
#mirrorlist=http://fedora.redhat.com/download/mirrors/updates-released-fc$releasever
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora

然后建议加上freshrpms这个软件源(这个源包括了mp3插件,Mplayer,BmpX,aMule,unrar等等)。 首先以root用户运行如下命令导入密钥:

rpm --import http://freshrpms.net/RPM-GPG-KEY-freshrpms

然后在/etc/yum.repos.d目录里新建一个freshrpms.repo文件,内容如下:

[freshrpms]
name=Fedora Core $releasever - $basearch - Freshrpms
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/ayo.freshrpms.net/pub/freshrpms/ayo/fedora/linux/$releasever/$basearch/freshrpms/
#baseurl=http://ayo.freshrpms.net/fedora/linux/$releasever/$basearch/freshrpms/
#mirrorlist=http://ayo.freshrpms.net/fedora/linux/$releasever/mirrors-freshrpms
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-freshrpms

最后建议加上livna这个软件源(这个源包括了MP3插件,Mplayer,Totem-xine,NTFS插件等等)。首先以root用户运行如下命令导入密钥:

rpm --import http://rpm.livna.org/RPM-LIVNA-GPG-KEY

然后在/etc/yum.repos.d目录里新建一个livna.repo文件,内容如下:

[livna]
name=Livna for Fedora Core $releasever - $basearch - Base
baseurl=
ftp://ftp3.tsinghua.edu.cn/mirror/livna/fedora/$releasever/$basearch/
http://rpm.livna.org/fedora/$releasever/$basearch/
http://livna.cat.pdx.edu/fedora/$releasever/$basearch/
http://wftp.tu-chemnitz.de/pub/linux/livna/fedora/$releasever/$basearch/
http://ftp-stud.fht-esslingen.de/pub/Mirrors/rpm.livna.org/fedora/$releasever/$basearch/
failovermethod=priority
#mirrorlist=http://rpm.livna.org/mirrorlist-5
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-LIVNA-GPG-KEY

对于Mandriva,建议使用Mandriva国内镜像的源,在控制台中输入如下命令行:

> /etc/urpmi/urpmi.cfg
rm -rf /var/lib/urpmi/*
urpmi.addmedia --distrib ftp://202.38.75.11/FreeOS/MandrivaLinux/official/2006.0/i586/
urpmi.addmedia updates ftp://202.38.75.11/FreeOS/MandrivaLinux/official/updates/2006.0/main_updates/
urpmi.addmedia plf-free ftp://[email protected]/plf/free/2006.0/
urpmi.addmedia plf-non-free ftp://[email protected]/plf/non-free/2006.0/

参考资料

标签 : ,