手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

定制并硬盘安装ArchLinux 20120804版

[日期:2012-09-04] 来源:Linux社区  作者:tiancong [字体: ]

系统初步启动后
-1.硬盘安装模块
准备以下文件:
grldr
menu.lst
archlinux-2012.08.04-dual.iso

内容:
#cat menu.lst
root (hd0,0)
kernel /arch/vmlinuz archisolabel=archiso
initrd /arch/archiso.img
boot

加载ISO
#mkdir udisk
#mount /dev/sdb1 /udisk
#modprobe loop
#losetup /dev/loop6 /udisk/arch/archlinux-2012.08.04-dual.iso
#ln -s /dev/loop6 /dev/disk/by-label/archiso
#exit


0.设置IP地址
注意此IP是手动设置,故意不能联网,仅与另一台登陆机器相联通
ifconfig eth0 192.168.0.95 netmask 255.255.255.0

1.更改密码
passwd
2.开启sshd服务
rc.d start sshd
3.查看系统IP地址
ifconfig eth0 | grep netmask
4.远程访问当前系统
ssh root@192.168.0.95
下面便可以在远程访问的系统中,通过复制粘贴来批量处理命令了,这样即提高了命令输入的速度也减少了输入错误。
5.分区
fdisk /dev/sda

格式化分区/dev/sda2为ext4格式
mkfs.ext4 /dev/sda1
mkfs.ext4 /dev/sda2
mkswap /dev/sda5 && swapon /dev/sda5
mount /dev/sda1 /mnt
若需要挂载其它的分区如下:
mount /dev/sda1 /mnt
mkdir /mnt/home && mount /dev/sda3 /mnt/home

6.添加网易源
#vi /etc/pacman.d/mirrorlist
Server = http://mirrors.163.com/archlinux/$repo/os/$arch

7.安装基本系统
# pacstrap /mnt base base-devel

8.写 fstab
# genfstab -p /mnt >> /mnt/etc/fstab

9.安装 grub
pacstrap /mnt grub-bios

10. chroot
#arch-chroot /mnt
mkinitcpio -p linux
grub-install --recheck /dev/sda
rc.conf文件需要添加新的行如下:
LOCALE="zh_CN.UTF-8"

/etc/locale.gen
把下列行取消注释:

    #en_US ISO-8859-1
    #en_US.UTF-8 UTF-8
    zh_CN.GB18030 GB18030
    zh_CN.GBK GBK
    zh_CN.UTF-8 UTF-8
    zh_CN GB2312
11.基本配置
#echo 'archlinux' >> /etc/hostname
#ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

12.设置密码
#passwd

13.时间配置
# date MMDDhhmmYYYY
# hwclock --systohc
# exit


14.更新系统
pacman -Syu
使语言设置生效:

locale-gen


15.添加用户, 配置sudo
pacman -S sudo
visudo

16.为该用户添加sudo权限

USER_NAME   ALL=(ALL) ALL
%wheel      ALL=(ALL) ALL

17.然后添加管理员用户
useradd -m -g users -G audio,games,log,lp,optical,power,scanner,storage,video,wheel -s /bin/bash [username]

18.安装yaourt (Yet AnOther User Repository Tool)
修改 /etc/pacman.conf 文件, 添加
[archlinuxfr]
Server = http://repo.archlinux.fr/$arch
pacman -S yaourt

19.同步并安装,
pacman -Syu openssh net-tools netcfg sshfs
pacman -S firefox firefox-i18n-zh-cn flashplugin fcitx leafpad audacious smplayer qtwebkit zip unrar unzip file-roller xscreensaver stardict
xscreensaver安装并配置后,xfce4的锁屏按钮便可用了。

pacman -S net-tools netcfg sshfs firefox firefox-i18n-zh-cn flashplugin fcitx leafpad audacious smplayer qtwebkit zip unrar unzip file-roller xscreensaver stardict xorg-server xorg-xinit xorg-server-utils mesa dbus xfce4 xfce4-goodies lxdm

$ yaourt -S stardict将./词典文件.rar 词典文件复制到目录:/usr/share/stardict/dic

注意到, 由此开始, 可以通过命令 yaourt -S 替代 pacman -S 进行包的安装

20.安装 X Windows System, 显卡等

pacman -S xorg-server xorg-xinit xorg-server-utils
pacman -S mesa
pacman -S xf86-video-vesa
pacman -S xorg-twm xorg-xclock xterm [可以省略]

测试显卡:
查看显卡类型:
输入命令:lspci |grep VGA
00:02.0 VGA compatible controller: Intel Corporation 82G33/G31 Express Integrated Graphics Controller (rev 10)
根据查到的信息搜索软件包:
pacman -Ss xf86-video|grep intel
以下是结果
extra/xf86-video-intel 2.20.6-1 (xorg-drivers xorg)
最后,安装对应的显卡驱动包
pacman -S xf86-video-intel

21.安装配置xfce4, slim
以下关于slim的废除,代之的是lxdm---同样轻量且易操作的引导器。
pacman -S dbus
rc.d start dbus
pacman -S xfce4 xfce4-goodies[比较大,要耐心]
[废除]pacman -S slim
pacman -S lxdm
pacman -S ttf-dejavu

配置登陆管理器:
通过inittab 方式:
编辑 /etc/inittab 找到如下这一行:
id:3:initdefault:
为了启动X11需要把'3'修改成'5':
id:5:initdefault:
修改默认显示管理器
编辑 /etc/inittab 找到类似如下这一行(在接近文件尾部)
x:5:respawn:/usr/bin/xdm -nodaemon
根据你的不同情况修改:
GDM:
x:5:respawn:/usr/sbin/gdm -nodaemon
KDM:
x:5:respawn:/usr/bin/kdm -nodaemon
SLiM
x:5:respawn:/usr/bin/slim >/dev/null 2>&1
LXDM:
x:5:respawn:/usr/sbin/lxdm >& /dev/null
LightDM:
x:5:respawn:/usr/sbin/lightdm >& /dev/null
下一次重启,你选择的显示管理器就会运行了。

cp /etc/skel/.xinitrc ~
chmod +x ~/.xinitrc
echo 'exec startxfce4' >>~/.xinitrc

22.修改 /etc/rc.conf 配置DAEMONS

DAEMONS=(syslogd network crond dbus slim sshd)

23.配置用户目录下 .xinitrc 文件

cp /etc/skel/.xinitrc ~
chmod +x ~/.xinitrc
echo 'exec startxfce4' >>~/.xinitrc
并添加 exec startxfce4

24.使得xfce4的关机按钮可用

user hostname=NOPASSWD:/usr/lib/xfce4/xfsm-shutdown-helper
shenzhi archlinuxz=NOPASSWD:/usr/lib/xfce4/xfsm-shutdown-helper

25.安装windows模拟器wine[不对外]
pacman -S wine wine_gecko


26.安装PPS与QQ
要使用普通用户来执行
$ yaourt -S ppstream
$ yaourt -S linuxqq

27.安装永中Office2012个人版
下载页面:
http://download.pchome.net/utility/file/editor/detail-34076-0.html

字体显示-有锯齿
字体安装
由于字体有锯齿,界面很不好看,所以需要安装字体。这里首先安装永中宋体,下载页面为:http://115.com/file/dp7y1j1p#
下载后,复制到/usr/local/Yozosoft/Yozo_Office/Jre/lib/fonts,重启永中Office即可。

该字体主要解决界面的字体问题,如果需要正确显示公式,目前还是要使用Windows字体

使用Windows字体

如果电脑中装有Windows,让永中Office使用Windows字体做界面字体或许是最简便的办法:将Windows字体文件夹中的所有文件(\Windows\Fonts\)复制(或创建符号链接)到永中Office的JRE的字体夹/usr/local/Yozosoft/Yozo_Office/Jre/lib/fonts/s即可。

再打开永中Office,会发现界面会自动采用宋体。

安装Windows字体
公式字体

公式显示不正确的问题目前只有通过安装Windows中的相应字体解决了。请从Windows中复制如下字体:symbol.ttf、mtextra.ttf、wingding.ttf、WINGDNG2.TTF、WINGDNG3.TTF、monotypesorts.ttf到/usr/share/fonts中的适当文件夹内,再fc-cache。

我的执行过程:
[shenzhi@shenzhi fonts]$ sudo su -
密码:
[root@shenzhi ~]# cd /home/shenzhi/fonts/
[root@shenzhi fonts]# mkdir /usr/share/fonts/msfonts
[root@shenzhi fonts]# cp ./* /usr/share/fonts/msfonts/
[root@shenzhi fonts]# cd /usr/share/fonts/
[root@shenzhi fonts]# fc-cache
[root@shenzhi fonts]#


个人版增强插件下载网页:
http://www.yozosoft.com/office/person.jsp

28.美化系统
系统变一个模样,也是一件很有意思的事情。
这里我仅简要说明下:
外观:
将对应文件复制到~/.themes,便可在“设置管理器”-“外观”-“样式”中看到。
图标:
将对应文件复制到~/.icons,便可在“设置管理器”-“外观”-“图标”中看到。
光标:
将对应文件复制到~/.icons,便可在“设置管理器”-“鼠标和触摸板”-“主题”中看到。

29.让回收站可用
pacman -S gvfs dbus
且在/etc/rc.conf中开启dbus服务

30.安装再生龙
pacman -S coreutils ntfsprogs partimage pigz
手动安装:drbl partclone clonezilla
只需一条命令:
yaourt -S clonezilla
全部搞定
以下作废:
*************
现在是在Grub2中的设置,clonezilla文件夹位于/dev/sda1下的/boot文件夹下。
menuentry "Clonezilla For Shenzhi" {
set root=(hd0,0)
linux /boot/clonezilla/live/vmlinuz boot=live live-config noswap nolocales edd=on nomodeset ocs_live_run=\"ocs-live-general\" ocs_live_extra_param=\"\" ocs_live_keymap=\"\" ocs_live_batch=\"no\" ocs_lang=\"\" vga=788 ip=frommedia nosplash live-media-path=/boot/clonezilla/live bootfrom=/dev/sda1 toram=filesystem.squashfs
initrd /boot/clonezilla/live/initrd.img
}
*************

31.使用再生龙
值得注意的是,在虚拟机VirtualBox中所测试的结果是,可以安装成功,也可以运行,但是却无法看到当前系统下的分区信息致使安装失败。
[shenzhi@archlinuxz root]$ clonezilla

[shenzhi] You need to run this script "clonezilla" as root.
[root@archlinuxz ~]# clonezilla
NCHC自由软件实验室 - 台湾                                                     
                                                                                                                                                    
                                                                               
┌────────────────────────────────┤ Clonezilla ├────────────────────────────────┐
│ *再生龙是自由(GPL)软件,但是完全没有任何保证,请自行评估风险后使用*            │
│ ///提示!                                                                     │
│ 往后如果有复选的选项让您选择,您必须使用空白键来标示您的选择,被标示选到的部 │
│ 分会出现星号(*)///                                                           │
│ 两种模式可以使用,您可以选择                                                 │
│ (1) 硬盘/分区存成镜像文件或者镜像文件还原到硬盘/分区,                       │
│ (2) 硬盘对拷或者分区对拷.                                                    │
│                                                                              │
│                  device-image  硬盘/分区[存到/来自]镜像文件                  │
│                  device-device 硬盘/分区复制到硬盘/分区                      │
│                                                                              │
│                                                                              │
│                     <确定>                       <取消>                      │
│                                                                              │
└──────────────────────────────────────────────────────────────────────────────┘
                                                     
32.安装Docky
安装完成后,所有的动态效果全部都有了。
pacman -S docky

目标 (15): dbus-sharp-0.7.0-4  dbus-sharp-glib-0.5.0-4  gconf-3.2.5-2
            gconf-sharp-2.24.2-2  gnome-desktop2-2.32.1-2
            gnome-keyring-sharp-1.0.2-4  gtk-sharp-2-2.12.11-1
            libgdiplus-2.10-2  libgnome-desktop-sharp-2.26.0-8  mono-2.10.8-1
            mono-addins-0.6.2-2  notify-sharp-0.4.0.3032-2
            rsvg2-sharp-2.26.0-8  wnck-sharp-2.26.0-8  docky-2.1.4-1

全部下载大小:36.68 MiB

33.安装桌面壁纸
pacman -S archlinux-wallpaper
壁纸安装后目录:/usr/share/archlinux/wallpaper

34.安装VirtualBox
pacman -S virtualbox
目标 (3): libvncserver-0.9.9-1  virtualbox-modules-4.1.20-3
           virtualbox-4.1.20-2
===> You must load vboxdrv module before starting VirtualBox:
===> # modprobe vboxdrv

35.安装图形化分区工具
pacman -S gparted
gparted 的可选依赖
    dosfstools: for FAT16 and FAT32 partitions
    jfsutils: for jfs partitions
    ntfsprogs: for ntfs partitions
    reiserfsprogs: for reiser partitions
    xfsprogs: for xfs partitions
    nilfs-utils: for nilfs2 support
    polkit: to run gparted directly from menu
    gpart: for recovering corrupt partition tables
    mtools
安装依赖:pacman -S dosfstools jfsutils ntfsprogs

36.寻找丢失的分区
通过gparted无法找回,DiskGenius依然无果,无奈中看到了testdisk。安装后尝试,分区回归!!!
安装testdisk:pacman -S testdisk
目标 (2): progsreiserfs-0.3.0.5-7  testdisk-6.13-2
[root@zllinux ~]# testdisk
选择Create,开始进行分析。
Use arrow keys to select, then press Enter key:
>[ Create ] Create a new log file
 [ Append ] Append information to log file
 [ No Log ] Don't record anything

选择对应磁盘,因我的只有一个,故不用选择,直接Proceed
Select a media (use Arrow keys, then press Enter):
>Disk /dev/sda - 250 GB / 232 GiB - ST3250318AS

>[Proceed ]  [  Quit  ]

显示关于当前磁盘的详细信息,Continue
Disk /dev/sda - 250 GB / 232 GiB - ST3250318AS

Hidden sectors are present.

size       488395055 sectors
user_max   488395055 sectors
native_max 488397168 sectors
dco        488397168 sectors
Host Protected Area (HPA) present.

>[ Continue ] Continue even if there are hidden data

如果和我的一样为普通PC机,选择Intel,若是苹果机选择MAC,其它自行思考
Please select the partition table type, press Enter when done.
>[Intel  ] Intel/PC partition
 [EFI GPT] EFI GPT partition map (Mac i386, some x86_64...)
 [Humax  ] Humax partition table
 [Mac    ] Apple partition map
 [None   ] Non partitioned media
 [Sun    ] Sun Solaris partition
 [XBox   ] XBox partition
 [Return ] Return to disk selection

选择Analyse,开始搜索分区
>[ Analyse  ] Analyse current partition structure and search for lost partitions
 [ Advanced ] Filesystem Utils
 [ Geometry ] Change disk geometry
 [ Options  ] Modify options
 [ MBR Code ] Write TestDisk MBR code to first sector
 [ Delete   ] Delete all data in the partition table
 [ Quit     ] Return to disk selection

显示搜索前,即当前磁盘信息,选择Quick Search
Current partition structure:
     Partition                  Start        End    Size in sectors

 1 * HPFS - NTFS              0   1  1   130 254 63    2104452
Invalid FAT boot sector
 2 P FAT32 LBA              131   0  1  1213 254 63   17398395
 2 P FAT32 LBA              131   0  1  1213 254 63   17398395
 3 P Linux Swap            1214   0  1  1298 254 63    1365525
 3 P Linux Swap            1214   0  1  1298 254 63    1365525
 4 E extended              1299  74 57 30401  42 41  467521599
*=Primary bootable  P=Primary  L=Logical  E=Extended  D=Deleted
>[Quick Search]  [ Backup ]

询问磁盘中的分区是否是在Windows系统下划分,如果不知道则可选择Y无妨,这里我选择Y
Should TestDisk search for partition created under Vista or later ? [Y/N]
(answer Yes if unsure)

Disk /dev/sda - 250 GB / 232 GiB - CHS 30402 255 63
     Partition               Start        End    Size in sectors
 * HPFS - NTFS              0   1  1   130 254 63    2104452
 P Linux                  131   0  1  1213 254 60   17398392
>P Linux                 1299  75 57 30401  42 41  467521536 [vmos]

Structure: Ok.  Use Up/Down Arrow keys to select partition.
Use Left/Right Arrow keys to CHANGE partition characteristics:
*=Primary bootable  P=Primary  L=Logical  E=Extended  D=Deleted
Keys A: add partition, L: load backup, T: change type, P: list files,
     Enter: to continue

选中>P Linux                 1299  75 57 30401  42 41  467521536 [vmos]行
选择Enter键,继续。
选择Write保存
Disk /dev/sda - 250 GB / 232 GiB - CHS 30402 255 63

     Partition                  Start        End    Size in sectors

 1 * HPFS - NTFS              0   1  1   130 254 63    2104452
 2 P Linux                  131   0  1  1213 254 60   17398392
 3 P Linux                 1299  75 57 30401  42 41  467521536 [vmos]

 [  Quit  ]  [Deeper Search] >[ Write  ]

再次确定保存分区的更改。输入Y
Write partition table, confirm ? (Y/N)

需要重启系统才可生效
You will have to reboot for the change to take effect.

TestDisk 6.13, Data Recovery Utility, November 2011
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org
TestDisk exited normally.
You have to reboot for the change to take effect.

37.远程登录Windows桌面
pacman -S rdesktop
rdesktop -u administrator -p [password] -g 1024*768 [ip]
rdesktop -u administrator -p tcyhljc -g 1024*768 192.168.0.102

38.安装下载工具
pacman -S uget aria2

linux
相关资讯       Arch Linux 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款