歡迎您光臨本站 註冊首頁

Linux系統軟體源的設置

←手機掃碼閱讀     火星人 @ 2014-03-23 , reply:0

這四個Linux版本都可以通過設置軟體源而在線安裝或升級軟體。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://cooker@mirror.mandrakelinux.cn/plf/free/2006.0/
urpmi.addmedia plf-non-free ftp://cooker@mirror.mandrakelinux.cn/plf/non-free/2006.0/

[火星人 ] Linux系統軟體源的設置已經有410次圍觀

http://coctec.com/docs/linux/show-post-117127.html