Archlinux安装笔记

其他Linux/Unix/BSD/OSX等发行版讨论
neil.sun
帖子: 110
注册时间: 2009-08-28 15:00

Archlinux安装笔记

#1

帖子 neil.sun » 2010-08-22 13:00

--------------------------环境--------------------------
  • 硬件架构:x86_64
    硬件配置:lenovo T61 / 160G 硬盘 / 4G 内存
    网络环境:WEP无线网络,有密码,有DHCP

    代码: 全选

    08:33:36 nansun@T61 ~ $ lspci
    00:00.0 Host bridge: Intel Corporation Mobile PM965/GM965/GL960 Memory Controller Hub (rev 0c)
    00:02.0 VGA compatible controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (rev 0c)
    00:02.1 Display controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (rev 0c)
    00:19.0 Ethernet controller: Intel Corporation 82566MM Gigabit Network Connection (rev 03)
    00:1a.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #4 (rev 03)
    00:1a.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #5 (rev 03)
    00:1a.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #2 (rev 03)
    00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03)
    00:1c.0 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 1 (rev 03)
    00:1c.1 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 2 (rev 03)
    00:1c.2 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 3 (rev 03)
    00:1c.3 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 4 (rev 03)
    00:1c.4 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 5 (rev 03)
    00:1d.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #1 (rev 03)
    00:1d.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #2 (rev 03)
    00:1d.2 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #3 (rev 03)
    00:1d.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 (rev 03)
    00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev f3)
    00:1f.0 ISA bridge: Intel Corporation 82801HBM (ICH8M-E) LPC Interface Controller (rev 03)
    00:1f.1 IDE interface: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) IDE Controller (rev 03)
    00:1f.2 SATA controller: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) SATA AHCI Controller (rev 03)
    00:1f.3 SMBus: Intel Corporation 82801H (ICH8 Family) SMBus Controller (rev 03)
    03:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection (rev 02)
    15:00.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev ba)
    15:00.1 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller (rev 04)
    
--------------------------准备--------------------------
  • 安装镜像:archlinux-2010.05-core-dual.iso
    安装指导:Beginners' Guide
    安装媒介:U盘
    安装方式:无线网络
  • 如何将安装镜像刻录到U盘
    Flash Memory Device or USB stick
  • 磁盘分区建议
    How big should my partitions be?
    本人硬盘160G,内存4G,分区如下:

    代码: 全选

    /dev/sda1  25G jfs      /
    /dev/sda2  15G reiserfs /var
    /dev/sda3   5G swap
    /dev/sda4 115G jfs      /home
    
    如何计算出以上数据:

    网站建议:
    / 15-20G
    /var 8-12G reiserfs
    所有分区扩展25%
    如需使用hibernate则swap至少要和内存一样大
    参见How big should my partitions be?

    本人需求:
    可能要使用hibernate
    偏好jfs

    代码: 全选

    /      20G * (1+25%) = 25G
    /var   12G * (1+25%) = 15G
    swap    4G * (1+25%) = 5G
    /home 160G - 25G - 15G - 5G = 115G
    
--------------------------安装--------------------------
  • 如何联网
    安装镜像:archlinux-2010.05-core-dual.iso
    网络环境:WEP无线网络,有密码,有DHCP
    网络硬件:Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection (rev 02)
    用root登录后,运行:

    代码: 全选

    cd /src/core/pkg
    pacman -U netcfg-2.5.4-1-any.pkg.tar.gz
    
    创建/etc/network.d/wlan0,如下:

    代码: 全选

    CONNECTION='wireless'
    INTERFACE='wlan0'
    SECURITY='wep'
    ESSID='<essid>'
    KEY='s:<password>'
    IP='dhcp'
    
    联网:

    代码: 全选

    netcfg wlan0
  • 如何为pacman启用wget
    修改/etc/pacman.conf,如下:

    代码: 全选

    XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
    
  • 选择要安装的软件包[本人偏好,仅供参考]
    选择:

    代码: 全选

    base
    取消:(取消的包如果被其他包依赖,会自动装上,所以别担心)

    代码: 全选

    dash           我用bash,不用dash
    e2fsprogs      我分区表中没有ext2/ext3/ext4
    mailx          我不用命令行手工发邮件
    mdadm          我不用Software RAID
    nano           我用vim,不用nano
    pcmciautils    我没有pcmcia设备
    perl           我喜欢python,不喜欢perl,但perl被很多包依赖,会自动安装
    ppp            我不用ppp联网
    rp-pppoe       我不用pppoe联网
    vi             同nano
    wpa_supplicant 我不用,但被netcfg依赖,会自动安装
    
    增加:

    代码: 全选

    linux-firmware 我的无线网卡需要它
    netcfg         用来连无线网络
    sudo           我要用这个
    
  • 配置文件:
    /etc/rc.conf

    配置中文locale(后面会装fbterm):
    LOCALE="zh_CN.UTF-8"

    配置console字体:
    CONSOLEFONT=Lat2-Terminus16:

    配置无线网络:
    NETWORKS=(wlan0)
    DAEMONS=(syslog-ng net-profiles)
    参见上文/etc/network.d/wlan0,net-profiles使用netcfg和/etc/network.d/wlan0来联网

    代码: 全选

    LOCALE="zh_CN.UTF-8"
    HARDWARECLOCK="UTC"
    TIMEZONE="Asia/Shanghai"
    KEYMAP="us"
    CONSOLEFONT=Lat2-Terminus16
    CONSOLEMAP=
    USECOLOR="yes"
    MOD_AUTOLOAD="yes"
    USELVM="no"
    HOSTNAME="<hostname>"
    NETWORKS=(wlan0)
    DAEMONS=(syslog-ng net-profiles)
    
    /etc/locale.gen

    代码: 全选

    zh_CN.UTF-8 UTF-8
    /etc/pacman.d/mirrorlist
    请自选镜像服务器,适合我的不一定适合你

    代码: 全选

    Server = http://mirror.bjtu.edu.cn/archlinux ...
    
  • grub启动管理器:
    /boot/grub/menu.lst

    为jfs启用deadline调度器
    elevator=deadline

    调整显示分辨率:
    vga=872
    该选项仅适合我的显卡+1280*800,请参考menu.lst里的注释,显卡损坏概不负责

    减少启动时显示的信息:
    quiet

    代码: 全选

    timeout   0
    default   0
    hiddenmenu
    
    title  Arch Linux
    root   (hd0,0)
    kernel /boot/vmlinuz26 root=/dev/sda1 ro elevator=deadline vga=872 quiet
    initrd /boot/kernel26.img
    
--------------------------重启/中文化--------------------------
  • 安装中文字体:
    安装包用aur中的PKGBUILD打包,暂时为最新,以后会过期
    wqy-microhei-0.2.0_beta-2-any.pkg.tar.xz
    (1.47 MiB) 已下载 111 次

    代码: 全选

    pacman -S bdf-unifont
    pacman -U wqy-microhei-0.2.0_beta-2-any.pkg.tar.xz
    
  • 安装fbterm:
    安装前请读README
    安装包用aur中的PKGBUILD打包,暂时为最新,以后会过期
    fbterm.tar.gz
    (1.66 MiB) 已下载 101 次

    代码: 全选

    pacman -S libtool
    pacman -U fbterm-1.6-3-x86_64.pkg.tar.xz libucimf-2.3.7-1-x86_64.pkg.tar.xz fbterm-ucimf-0.2.9-1-x86_64.pkg.tar.xz openvanilla-modules-0.9.0a1.3-1-x86_64.pkg.tar.xz ucimf-openvanilla-2.10.11-1-x86_64.pkg.tar.xz
    
  • 为fbterm配置中文字体:
    修改.fbtermrc,如下:

    代码: 全选

    font-names=WenQuanYi Micro Hei Mono
    font-size=14
    
  • 为ucimf配置中文字体:
    修改/etc/ucimf,如下:

    代码: 全选

    font-name=unifont
    font-size=16
    
  • 在fbterm中自动启用输入法:
    修改.fbtermrc,如下:

    代码: 全选

    input-method=fbterm_ucimf
  • 自动在tty1运行fbterm:
    修改/etc/profile,增加:

    代码: 全选

    [[ `tty` == /dev/tty1 ]] && exec fbterm
--------------------------Console--------------------------
  • 安装vim

    代码: 全选

    pacman -S vim
    
    which vim
    cd /usr/bin
    ln -s vim vi
    
    cd /usr/share/man/man1
    ls vi*
    ln -sf vim.1.gz vi.1p.gz
    
  • 修改提示符
    全局设置:/etc/bash.bashrc
    用户设置:/etc/skel/.bashrc
    本地设置:~/.bashrc
    本地设置会覆盖全局设置

    红色:\[\e[0;31m\]
    黄色:\[\e[0;33m\]
    蓝色加深:\[\e[1;34m\]
    恢复初始状态:\[\e[0;0m\]

    时间:\t
    用户:\u
    主机:\h
    当前路径:\w
    提示符:\$(普通用户显示$,root显示#)

    代码: 全选

    PS1='\[\e[0;33m\]\t \[\e[0;31m\]\u@\h \[\e[1;34m\]\w \[\e[0;0m\]\$ '
  • 开启字体反锯齿
    Font Configuration
    创建/etc/fonts/local.conf,如下:

    代码: 全选

    <?xml version="1.0"?>
    <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
    <!-- /etc/fonts/local.conf is the global font configuration file -->
    <fontconfig>
            <match target="font">
                    <edit name="antialias" mode="assign">
                            <bool>true</bool>
                    </edit>
            </match>
            <match target="font">
                    <edit name="hinting" mode="assign">
                            <bool>true</bool>
                    </edit>
            </match>
            <match target="font">
                    <edit name="hintstyle" mode="assign">
                            <const>hintslight</const>
                    </edit>
            </match>
            <match target="font">
                    <edit name="rgba" mode="assign">
                            <const>rgb</const>
                    </edit>
            </match>
    </fontconfig>
    
--------------------------优化--------------------------
  • Maximizing performance
  • 取消多余的tty
    修改/etc/inittab,如下:

    代码: 全选

    c1:2345:respawn:/sbin/agetty -8 38400 tty1 linux
    #c2:2345:respawn:/sbin/agetty -8 38400 tty2 linux
    #c3:2345:respawn:/sbin/agetty -8 38400 tty3 linux
    c4:2345:respawn:/sbin/agetty -8 38400 tty4 linux
    #c5:2345:respawn:/sbin/agetty -8 38400 tty5 linux
    #c6:2345:respawn:/sbin/agetty -8 38400 tty6 linux
    
  • 取消重启等待
    修改/etc/inittab,如下:

    代码: 全选

    #ca::ctrlaltdel:/sbin/shutdown -t3 -r now
    ca::ctrlaltdel:/sbin/shutdown -r now
    
  • 尽量使用内存,减少交换文件的使用
    修改/etc/sysctl.conf,增加:

    代码: 全选

    vm.swappiness=1
    vm.vfs_cache_pressure=50
    
  • 优化文件系统
    修改/etc/fstab,如下:

    对jfs启用noatime
    对reiserfs启用noatime,notail
    对/tmp, /var/lock和/var/run启用tmpfs

    代码: 全选

    /dev/sda1              /             jfs       defaults,noatime                         0      1
    /dev/sda2              /var          reiserfs  defaults,noatime,notail                  0      1
    /dev/sda3              swap          swap      defaults                                 0      0
    /dev/sda4              /home         jfs       defaults,noatime                         0      1
    
    tmpfs                  /tmp          tmpfs     defaults,nodev,nosuid,noatime,mode=1777  0      0
    tmpfs                  /var/lock     tmpfs     defaults,nodev,nosuid,noatime,mode=1777  0      0
    tmpfs                  /var/run      tmpfs     defaults,nodev,nosuid,noatime,mode=0755  0      0
    
--------------------------X--------------------------
  • 安装X
    本人Intel显卡,请根据自己情况调整。twm不装,因为我不用。

    代码: 全选

    pacman -S xf86-video-intel xorg-server xorg-xinit xterm
    
  • warning: font for charset GBK-0 is lacking
    修改/usr/share/X11/locale/zh_CN.UTF-8/XLC_LOCALE,如下:

    代码: 全选

    #  fs3 class (Chinese Han Character GBK)
    fs3    {
           charset {
                   #name    GBK-0:GLGR
                   name    GB2312.1980-0:GL
           }
           font    {
                   #primary GBK-0:GLGR
                   primary GB2312.1980-0:GL
                   substitute GB13000.1993-1:GLGR
           }
    }
    
  • Failed to load module "vesa"

    代码: 全选

    pacman -S xf86-video-vesa
    我不装,因为我不用
  • Failed to load module "fbdev"

    代码: 全选

    pacman -S xf86-video-fbdev
    我不装,因为我不用
  • 设置桌面管理器
    修改/etc/X11/xinit/xinitrc,如下:

    代码: 全选

    #twm &
    #xclock -geometry 50x50-1+1 &
    #xterm -geometry 80x50+494+51 &
    #xterm -geometry 80x20+494-0 &
    #exec xterm -geometry 80x66+0+0 -name login
    
    awesome
    #openbox-session
    
--------------------------awesome--------------------------
  • 安装awesome

    代码: 全选

    pacman -S awesome
  • Failed to bind socket "/var/run/dbus/system_bus_socket"
    修改/etc/rc.conf,添加dbus,如下:

    代码: 全选

    DAEMONS=(dbus syslog-ng net-profiles)
  • 配置xterm
    修改/etc/xdg/awesome/rc.lua,如下:

    代码: 全选

    -- terminal = "xterm"
    terminal = "xterm -font -gnu-unifont-medium-r-normal--16-160-75-75-c-80-iso10646-1 -bg black -fg white"
    
  • 为awesome配置文本编辑器
    修改/etc/xdg/awesome/rc.lua,如下:

    代码: 全选

    -- editor = os.getenv("EDITOR") or "nano"
    editor = os.getenv("EDITOR") or "vi"
    
  • edit config无法保存
    这一版awesome 3.4.6-1把rc.lua放在cache而不是config中,修改/etc/xdg/awesome/rc.lua,如下:

    代码: 全选

    --   { "edit config", editor_cmd .. " " .. awful.util.getdir("config") .. "/rc.lua" },
       { "edit config", editor_cmd .. " " .. awful.util.getdir("cache") .. "/rc.lua" },
    
  • 如何更换awesome的theme
    修改/etc/xdg/awesome/rc.lua,如下:

    代码: 全选

    beautiful.init("/usr/share/awesome/themes/<theme>/theme.lua")
    
  • 配置awesome字体
    修改/usr/share/awesome/themes/<theme>/theme.lua,如下:

    代码: 全选

    -- theme.font = "sans 8"
    theme.font = "WenQuanYi Micro Hei 10"
    
  • 调整awesome菜单项的尺寸
    修改/usr/share/awesome/themes/<theme>/theme.lua,如下:

    代码: 全选

    theme.menu_height = "15"
    -- theme.menu_width  = "100"
    theme.menu_width  = "120"
    
--------------------------openbox--------------------------
  • 安装openbox

    代码: 全选

    pacman -S openbox
  • 配置xterm
    修改/etc/xdg/openbox/menu.xml,如下:

    代码: 全选

    <!-- <action name="Execute"><command>xterm</command></action> -->
    <action name="Execute"><command>xterm -font -gnu-unifont-medium-r-normal--16-160-75-75-c-80-iso10646-1 -bg black -fg white</command></action>
    
  • 配置openbox字体
    修改/etc/xdg/openbox/rc.xml,如下:
    rc.xml中有5处字体设定,需修改多次

    代码: 全选

    <!-- <name>sans</name> -->
    <name>WenQuanYi Micro Hei</name>
    <size>10</size>
    
--------------------------完--------------------------


--------------------------补遗--------------------------
1. 我的/var为reiserfs, 在关机/重启时, 不能被正常地unmount, 而是会fail然后remount, 解决方法如下:
修改/etc/rc.shutdown, 如下:

代码: 全选

#/bin/umount -a -r -t noramfs,notmpfs,nosysfs,noproc,nodevtmpfs -O no_netdev
# do not umount /var
/bin/umount -a -r -t noramfs,notmpfs,nosysfs,noproc,nodevtmpfs,noreiserfs -O no_netdev

代码: 全选

/bin/mount -n -o remount,ro /
# remount /var
/bin/mount -n -o remount,ro /var
开机后fsck.reiserfs显示File system is clean. 成功.

2. 在console环境下安装matlab的时候要注意:
需要在/lib64下面创建libc.so.6, link到/lib下的相同文件.
matlab依赖: libxpm libxmu
用install -t安装, 建议安装到/usr/share/matlab
安装完成后把license文件copy到$MATLAB/licenses/license.dat
alias matlab='matlab -nodisplay -nojvm'

3. 谢谢bikeman的帮助, 修改了fstab
上次由 neil.sun 在 2010-09-07 0:11,总共编辑 24 次。
KIS
帖子: 30
注册时间: 2009-07-13 15:12

Re: Archlinux安装笔记[未完成]

#2

帖子 KIS » 2010-08-22 14:13

那个perl被依赖的关系挺多的。。。至少我这里vim都要依赖他的。。怎么能不装呢。。。
neil.sun
帖子: 110
注册时间: 2009-08-28 15:00

Re: Archlinux安装笔记[未完成]

#3

帖子 neil.sun » 2010-08-22 18:16

KIS 写了:那个perl被依赖的关系挺多的。。。至少我这里vim都要依赖他的。。怎么能不装呢。。。
neil.sun 写了:取消的包如果被其他包依赖,会自动装上
头像
phoenixlzx
帖子: 2245
注册时间: 2009-07-29 20:11
系统: Arch Linux
来自: Gensokyo
联系:

Re: Archlinux安装笔记[未完成]

#4

帖子 phoenixlzx » 2010-08-22 22:15

mark留用 :em11
头像
qiang_liu8183
论坛版主
帖子: 10701
注册时间: 2006-09-10 22:36
系统: Arch Debian
来自: 北京

Re: Archlinux安装笔记

#5

帖子 qiang_liu8183 » 2010-08-23 1:12

第一次见用core-dual装arch的
干不了大事就把小事干的大气点
neil.sun
帖子: 110
注册时间: 2009-08-28 15:00

Re: Archlinux安装笔记

#6

帖子 neil.sun » 2010-08-23 8:54

qiang_liu8183 写了:第一次见用core-dual装arch的
core是因为netinstall的镜像没有/src/core/pkg目录,不能直接装netcfg,我的机器比较破,没有netcfg上不了无线,所以只好用core。
dual是因为我有一台T43一台T61,所以32bit和64bit都需要。
头像
schizophrenia
帖子: 1111
注册时间: 2008-12-03 23:36

Re: Archlinux安装笔记

#7

帖子 schizophrenia » 2010-08-26 11:10

:em50 嘗試學習了一下,感謝仙人
My Lovely: Fujitsu Lifebook AH531
Windows 7 Home Premium 64-bits
Intel Core i3-2310M (2.26GHz)、8GB DDR3、 NVIDIA GeForce GT 525M (1GB VRAM)、
15.6 吋 LED 16:9 (1,366 x 768) 、 500GB SATA
头像
guiwen1158
帖子: 1078
注册时间: 2008-05-11 11:10
来自: 深圳
联系:

Re: Archlinux安装笔记

#8

帖子 guiwen1158 » 2010-08-26 15:46

:em11
头像
Angus_Yann
帖子: 1736
注册时间: 2008-03-20 23:29
来自: ZJU

Re: Archlinux安装笔记

#9

帖子 Angus_Yann » 2010-08-26 15:58

哇,好详细,用心了!
:em11 :em11
80后俊男一枚,Arch党,软件洁癖,标准果粉,萝莉控
欢迎Follow我的Twitter:@AngusYann <--点击前请自学[穿·墙·术]
bikeman
帖子: 1
注册时间: 2010-08-17 17:31

Re: Archlinux安装笔记

#10

帖子 bikeman » 2010-08-31 13:10

Some directories where tmpfs can be safely used are /tmp, /var/lock and /var/run. Do NOT use it on /var/tmp, because that folder is meant for temporary files that are preserved between reboots.
头像
Jarson
帖子: 2371
注册时间: 2008-07-21 9:44
来自: 深圳
联系:

Re: Archlinux安装笔记

#11

帖子 Jarson » 2010-08-31 13:21

bikeman 写了:Some directories where tmpfs can be safely used are /tmp, /var/lock and /var/run. Do NOT use it on /var/tmp, because that folder is meant for temporary files that are preserved between reboots.
学习,顺便顶LZ :em11
头像
linlee
帖子: 1132
注册时间: 2007-10-20 11:30

Re: Archlinux安装笔记

#12

帖子 linlee » 2010-08-31 13:48

目标,学习
neil.sun
帖子: 110
注册时间: 2009-08-28 15:00

Re: Archlinux安装笔记

#13

帖子 neil.sun » 2010-08-31 22:28

bikeman 写了:Some directories where tmpfs can be safely used are /tmp, /var/lock and /var/run. Do NOT use it on /var/tmp, because that folder is meant for temporary files that are preserved between reboots.
找到了, 多谢
fstab
头像
cnshzj007
帖子: 685
注册时间: 2006-05-24 21:38
来自: 上海
联系:

Re: Archlinux安装笔记

#14

帖子 cnshzj007 » 2010-09-12 12:33

启动到udev之后就没反应了,屏幕是黑屏,怎么办?

也是U盘安装的,使用的是i686的core。
我只是一个ARCH的FANS,来自RH和UBUNTU的滋润!
头像
jary_p
帖子: 135
注册时间: 2009-10-25 20:14

Re: Archlinux安装笔记

#15

帖子 jary_p » 2010-09-12 19:56

换显卡驱动...
回复