op2-Install ArchLinux
来源:互联网 发布:淘宝违禁品有哪些 编辑:程序博客网 时间:2024/06/08 03:07
op2-Install ArchLinux
下载镜像
选择一个最近的镜像站点下载比如:http://mirrors.hust.edu.cn/archlinux/iso/,此处下载的为2015.12.01版本
新建虚拟机
Linux 3.x kernel 64bitsNAT启动之前选择镜像文件
启动
Boot Arch Linux (X86_64)
查看是否是ELF方式主板
root@archiso~ # ls /sys/fireware/efi/efivars #存在则会有内容
查看是否存在网络连接
ping www.google.com
更新系统时间
timedatectl set-ntp true
磁盘分区(以MBR方式为例,使用parted工具,磁盘大小120G)
\#确认存储类型root@archiso~ # lsblk\#parted分区root@archiso~ # parted /dev/sda\#设置分区表,msdos代表MBR类型(parted) mklabal msdos\#分区mkpart part-type(primary|extended|logical) fs-type(ext4,fat,reiserfs,linux-swap) start end(parted) mkpart primary ext4 1MiB 100MiB #boot(parted) mkpart primary ext4 100MiB 30GiB #home(parted) mkpart primary linux-swap 30GiB 33GiB #swap(parted) mkpart primary ext4 33GiB 100% #/\#设置boot分区 set partition(use print to identify) boot on(parted) set 1 boot on(parted) quit
创建文件系统(mkfs工具)
root@archiso~ # mkfs.ext4 /dev/sda1root@archiso~ # mkfs.ext4 /dev/sda2root@archiso~ # mkfs.ext4 /dev/sda4root@archiso~ # mkswap /dev/sda3root@archiso~ # swapon /dev/sda3
挂载硬盘到当前“假根”中的/mnt目录
root@archiso~ # mount /dev/sda4 /mnt
创建boot目录供Linux启动
root@archiso~ # mkdir -pv /mnt/bootroot@archiso~ # mkdir -pv /mnt/home
把启动分区/dev/sda1挂载至/mnt/boot目录
mount /dev/sda1 /mnt/boot# root@archiso~ # mount /dev/sda3 /mnt# linux会自动挂载swap分区,因此不需要在这里挂载root@archiso~ # mount /dev/sda2 /mnt
参考资料:http://unix.stackexchange.com/questions/103205/error-no-such-device-after-installing-arch-linux
在根分区安装base|base-devel
\#修改国内源root@archiso~ # nano /etc/pacman.d/mirrorlist ## Score: 0.3, China Server = http://mirror.hust.edu.cn/archlinux/$repo/os/$archroot@archiso~ # pacstrap -i /mnt base base-devel
创建fstab用于开机挂载各个分区(使用各种文件系统)
root@archiso~ # genfstab -U /mnt > /mnt/etc/fstab #U表示以UUID方式标识
根切换至“真正的根”,并指定先启动/bin/bash
root@archiso~ # arch-chroot /mnt /bin/bash
安装vim
[root@archiso /]# pacman -S vim
语言配置
1、编辑/etc/locale.gen,并去掉对应语言前的注释
[root@archiso /]# vim /etc/locale.gen en_US.UTF-8 UTF-8 zh_CN.UTF-8 UTF-8
2、根据/etc/locale.gen配置生成语言
[root@archiso /]# locale-gen
3、编辑(创建)系统语言配置/etc/locale.conf
[root@archiso /]# vim /etc/locale.conf LANG=en_US.UTF-8
配置时区
[root@archiso /]# tzselect 按照提示选择对应区域[root@archiso /]# ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime[root@archiso /]# hwclock --systohc --utc #设置格林尼治时间?
initramfs
[root@archiso /]# mkinitcpio -p linux
bootloader
[root@archiso /]# pacman -S grub os-prober[root@archiso /]# grub-install --recheck /dev/sda #把bootloader安装在整个sda上而不是根所在的分区如果这一步报错出现can't find EFI directory,就使用grub-install --target=i386-pc --recheck /dev/sda[root@archiso /]# grub-mkconfig -o /boot/grub/grub.cfg #创建grub的配置文件
hostname
[root@archiso /]# vim /etc/hostname ArchLinux-husa
添加用户
[root@archiso /]# useradd -m -g users -G wheel,power -s /bin/bash husa[root@archiso /]# passwd husa
安装sudo
[root@archiso /]# pacman -S sudo[root@archiso /]# visudo #uncomment to allow group wheel to execute any command
umount|reboot
root@archiso~ # umount -R /mntroot@archiso~ # reboot
登陆后切换到husa用户
[root@ArchLinux-husa ~]# su - husa
确保网络连接顺畅
[husa@ArchLinux-husa ~]# ip addr 发现没有IP地址,接口名称为eno16777736[husa@ArchLinux-husa ~]# sudo systemctl enable dhcpcd@eno16777736.service#这一步中可能因为环境差异导致无法开启dhcp服务,其实只要在在/usr/lib/systemd/system目录下找一找dhcp名称的服务就可以了。进一步如果dhcpd没有启动失败,查一下日志,如果是要绑定网卡的话,就要使用enabled@IFACE格式设置了,这个在service脚本中有说明的[husa@ArchLinux-husa ~]# sudo dhcpcd[husa@ArchLinux-husa ~]# ip addr 发现接口eno16777736已经有IP地址
安装plasma
\#安装X Window Server用于图形界面的显示[husa@ArchLinux-husa ~]# sudo pacman -S xorg xorg-xinit\#安装KDE Frameworks 5[husa@ArchLinux-husa ~]# sudo pacman -S kf5 kf5-aids\#安装KDE桌面环境Plasma以及相关应用[husa@ArchLinux-husa ~]# sudo pacman -S plasma kdebase gwenview\#安装字体,没有字体plasma桌面无法完整显示[husa@ArchLinux-husa ~]# sudo pacman -S ttf-freefont\#安装显示管理器,用于在启动脚本最后启动X会话,此处为sddm[husa@ArchLinux-husa ~]# sudo pacman -S sddm sddm-kcm[husa@ArchLinux-husa ~]# sudo systemctl enable sddm\#配置sddm[root@ArchLinux-husa ~]# sddm --example-config /etc/sddm.conf 生成例子配置[husa@ArchLinux-husa ~]# su - husa[husa@ArchLinux-husa ~]# sudo vim /etc/sddm.conf Session=plasma.desktop User=husa Current=breeze CursorTheme=breeze_cursors\#安装必要的包[husa@ArchLinux-husa ~]# sudo pacman -S gtk-engines gtk2 gtk3 gnome-themes-standard gnome-icon-theme[husa@ArchLinux-husa ~]# sudo pacman -S ntp[husa@ArchLinux-husa ~]# sudo systemctl enable ntpd\#安装网络管理器[husa@ArchLinux-husa ~]# sudo pacman -S networkmanager net-toolss[husa@ArchLinux-husa ~]# sudo systemctl enable NetworkManager dhcpcd\#安装声音管理工具[husa@ArchLinux-husa ~]# sudo pacman -S alsa-utils pulseaudio pulseaudio-alsa libcanberra-pulse libcanberra-gstreamer jack2-dbus kmix\#重启[husa@ArchLinux-husa ~]# sudo reboot
安装chrome
[husa@ArchLinux-husa ~]# sudo pacman -S chromium
安装VMWare Tools
[husa@ArchLinux-husa ~]# sudo pacman -S open-vm-tools[husa@ArchLinux-husa ~]# sudo vim /usr/lib/systemd/system/vntoolsd.service 在Service中添加 KillSignal=SIGKILL[husa@ArchLinux-husa ~]# sudo systemctl enable vmtoolsd.service
中文乱码
[husa@ArchLinux-husa ~]# sudo pacman -S hannom[husa@ArchLinux-husa ~]# sudo reboot
搜狗输入法
\#安装fcitx[husa@ArchLinux-husa ~]# sudo pacman -S fcitx-im kcm-fcitx\配置fcitx[husa@ArchLinux-husa ~]# qtconfig-qt4 interface default input method fcitx\#安装yaourt[husa@ArchLinux-husa ~]# sudo vim /etc/pacman.conf 添加以下内容 [archlinuxcn] #The Chinese Arch Linux communities packages. SigLevel = Optional TrustedOnly Server = http://repo.archlinuxcn.org/$arch[husa@ArchLinux-husa ~]# sudo pacman -Sy yaourt #同步并安装yaourt\#安装搜狗输入法[husa@ArchLinux-husa ~]# yaourt fcitx-sogoupinyin[husa@ArchLinux-husa ~]# reboot\#配置输入法KDE Computer System Settings Regional Settings Input Method Addon Config Apply SogouPinyin[husa@ArchLinux-husa ~]# reboot\#chrome测试sogouOkay\#KWrite测试sogouNot Okay\#配置xprofile[husa@ArchLinux-husa ~]# sudo vim ~/.xprofile 输入以下内容 export GTK_IM_MODULE=fcitx export QT_IM_MODULE=fcitx export XMODIFIERS="@im=fcitx"[husa@ArchLinux-husa ~]# sudo reboot\#KWrite测试sogouOkay
中文字体
(Mainly) Chineseadobe-source-han-sans-cn-fonts - Simplified Chinese OpenType/CFF fontsadobe-source-han-sans-tw-fonts - Traditional Chinese OpenType/CFF fontswqy-microhei - A Sans-Serif style high quality CJKV outline font.wqy-zenhei - Hei Ti Style (sans-serif) Chinese Outline font embedded with bitmapped Song Ti (also supporting Japanese (partial) and Korean characters).ttf-arphic-ukai - Kaiti (brush stroke) Unicode font (enabling anti-aliasing is suggested)ttf-arphic-uming - Mingti (printed) Unicode fontopendesktop-fonts - New Sung font, previously is ttf-fireflysung packagewqy-bitmapfont - Bitmapped Song Ti (serif) Chinese fontttf-hannom - Chinese and Vietnamese TrueType fontttf-i.bmingAUR - CJK serif font that emphasis on an old-style typefacettf-twAUR - Kai and Song traditional Chinese font from the Ministry of Education of Taiwan
Done
参考资料:
1、https://wiki.archlinux.org/index.php/SDDM
2、https://wiki.archlinux.org/index.php/Yaourt_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)
3、http://www.techrapid.co.uk/linux/arch-linux/install-kde-plasma-on-arch-linux/
4、https://wiki.archlinux.org/index.php/Beginners%27_guide
- op2-Install ArchLinux
- install archlinux
- install Archlinux
- archlinux install tigervnc
- install archlinux LOG
- VMware 12 Install Archlinux
- ArchLinux install AAA by wine
- Install Android Studio On Archlinux
- raspberry Pi on Archlinux, Install wiringPi , GPIO
- ArchLinux
- install mpd (music player daemon) mpc --backup--archlinux
- Install Archlinux on Raspberry Pi as you wish!
- Archlinux MySQL PHP phpmyadmin Apache PHP-Apache Install
- 达尔文OP2音频播放
- ArchLinux install virtualbox error libQtCore.so.4: cannot open shared object file: No such file..
- 达尔文OP2官方demo解读(一)
- about archLinux
- ArchLinux使用手记
- Android 开发资源
- 2015年总结
- 用angularJS的ng-model绑定到select上,会自动增加一个value为空的option,去掉此空格
- Block、委托、回调函数原理剖析
- Ehcache和MemCached区别及应用
- op2-Install ArchLinux
- 12306验证码太难,试着用php自己做一个验证码吧!
- 利用Servlet实现表单回填
- Python程序员最常犯的十个错误
- 重要数据的加密处理,比如密码的加密,需要用盐多次加密
- check server port
- java 初始化过程
- sql trim()函数去掉两头空格
- 杨辉三角