红联Linux门户
Linux帮助

arch linux中配置网络与更新软件包

发布时间:2007-06-26 21:39:38来源:红联作者:Prospect
1.配置网络
如果采用DHCP上网的话,就仿照如下的代码在rc.conf里面写

lo="lo 127.0.0.1"
eth0="dhcp"
eth1="dhcp"
INTERFACES=(lo eth0 eth1)

如果不是的话,在rc.conf里面添上IP信息,仿照/etc/network-profiles/template里面的内容

eth0="eth0 192.168.1.2 netmask 255.255.255.0 broadcast 192.168.1.255"
GATEWAY=192.168.1.1
# DNS Settings (optional)
DOMAIN=localdomain
DNS1=192.168.0.1

hostname也在rc.conf里面

HOSTNAME=myhost
一个基本可用的网络就算是配置好了。

2.更新软件包
软件包配置在/etc/pacman.conf文件中定义,而/etc/pacman.d/*定义了各个软件仓库的信息。我的配置文件如下

HOSTNAME=myhost [testing]
Server = ftp://ftp.archlinux.org/testing/os/i686

[current]
# Add your preferred servers here, they will be used first
Include = /etc/pacman.d/current

[extra]
# Add your preferred servers here, they will be used first
Include = /etc/pacman.d/extra

[unstable]
# Add your preferred servers here, they will be used first
Include = /etc/pacman.d/unstable

[community]
# Add your preferred servers here, they will be used first
Include = /etc/pacman.d/community

我打开了所有的软件包分支。如果是用来做服务器,那还是用release好了,current也不要用。这种分包方式有点象FreeBSD的风格。

一些软件包管理的命令

更新软件包信息用 pacman -Sy
升级软件包信息用 pacman -Su
查找软件包信息用 pacman -Ss Key
更新软件包信息用 pacman -S --info packname
安装软件包信息用 pacman -S packname
删除软件包信息用 pacman --remove packname
升级某个软件包信息用 pacman -Su packname

和传统的dpkg-apt rpm-yum模式不同,arch linux把软件包管理程序合并成了一个--所有的软件包管理工作都通过pacman完成。
文章评论

共有 0 条评论