Arch Linux 硬盘引导-联网安装

Arch Linux 硬盘引导-联网安装

============
https://www.archlinux.org/

https://wiki.archlinux.org/
https://wiki.archlinux.org/index.php/Installation_guide
https://wiki.archlinux.org/index.php/Main_page_(简体中文)
============
主要步骤 

完全的离线安装可参考如下:

https://wiki.archlinux.org/index.php/Offline_installation

完全的联网安装:

https://www.archlinux.org/releng/netboot/

说明:本文仅通过硬盘引导启动,还需要联网安装,与以上官方教程主要区别是跳过U盘制作的过程。

当前电脑仅支持BIOS的MBR分区,所以这里不考虑UEFI的GPT分区。

提前规划好分区,(/根分区,/home分区,/swap交换区,等)

01. 文件准备,下载并验证

02. 添加启动项目(或者制作启动U盘)

03. 重启进入rootfs 挂载iso

04. 重启进入root(zsh) 磁盘管理

05. 网络设置

06. 安装 base,生成分区表

07. 转换到已安装系统的root权限下

08. 安装网络必要组建

09. 安装grub

10. 基本设置

11. 安装桌面环境

12. 安装其他

13. 重启登录桌面

14. 安装输入法,字体

15. 桌面下安装其他

16. 桌面的选择 

17. 软件列表

18. 防火墙

=======

01. 文件准备,下载并验证

https://www.archlinux.org/download/
当前版本: 2019.03.01
包含的内核: 4.20.13
ISO尺寸: 602.0 MB

PGP签名: https://www.archlinux.org/iso/2019.03.01/archlinux-2019.03.01-x86_64.iso.sig
MD5: 8164667750c46cf297720b21145e1e27
SHA1: e32acb5a7b7cfb2bdba10697cce48ab69e13c186


$ ls
archlinux-2019.03.01-x86_64.iso 
archlinux-2019.03.01-x86_64.iso.sig
$
md5sum archlinux-2019.03.01-x86_64.iso
8164667750c46cf297720b21145e1e27 archlinux-2019.03.01-x86_64.iso
sha1sum archlinux-2019.03.01-x86_64.iso
e32acb5a7b7cfb2bdba10697cce48ab69e13c186 archlinux-2019.03.01-x86_64.iso

现有Arch Linux系统下验证 

$ pacman-key -v archlinux-2019.03.01-x86_64.iso.sig
==> Checking archlinux-2019.03.01-x86_64.iso.sig...
gpg: assuming signed data in 'archlinux-2019.03.01-x86_64.iso'
gpg: Signature made Fri 01 Mar 2019 11:57:55 PM CST
gpg: using RSA key 4AA4767BBC9C4B1D18AE28B77F2D434B9741E8AC
gpg: Note: trustdb not writable
gpg: Good signature from "Pierre Schmitz <[email protected]>" [full]
$

其他Linux系统下验证

$ gpg --keyserver pgp.mit.edu --keyserver-options auto-key-retrieve --verify archlinux-2019.03.01-x86_64.iso.sig
gpg: assuming signed data in 'archlinux-2019.03.01-x86_64.iso'
gpg: Signature made Fri 01 Mar 2019 11:57:55 PM CST
gpg: using RSA key 4AA4767BBC9C4B1D18AE28B77F2D434B9741E8AC
gpg: requesting key 7F2D434B9741E8AC from hkp server pgp.mit.edu
gpg: key 7F2D434B9741E8AC: 32 signatures not checked due to missing keys
gpg: key 7F2D434B9741E8AC: public key "Pierre Schmitz <[email protected]>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg: imported: 1
gpg: Good signature from "Pierre Schmitz <[email protected]>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: 4AA4 767B BC9C 4B1D 18AE 28B7 7F2D 434B 9741 E8AC
$

(可选步骤)镜像文件准备,这个步骤可以适当加快后续安装过程中,联网下载的速度。

https://www.archlinux.org/mirrorlist/    这里可以生成并下载最新的 pacman 镜像列表

https://www.archlinux.org/mirrors/status/    这里可以查看镜像状态 部分站点未同步

https://wiki.archlinux.org/index.php/Mirrors   更多镜像内容 

参考以上编辑自己的镜像文件,锅内将china放在最前面. 注意:生成的文件里,去掉站点前面的#号。

mirrorlist 文件,后续复制到 /etc/pacman.d/ 目录下

02. 添加启动项目(或者制作启动U盘)

title Install Arch3
root (hd0,2)
kernel /arch20190301/vmlinuz archisolabel=ARCH_201903
initrd /arch20190301/archiso.img

可参考:硬盘安装Linux 系统

https://www.cnblogs.com/sztom/p/10292522.html

03. 重启进入rootfs 挂载iso

启动过程提示找不到,得到一个 Shell [rootfs]状态,手动挂载iso

通过df, lsblk, blkid, fdisk -l, mount等命令再次确认磁盘状态,

我这里的状态是:要挂载的archlinux-2019.03.01-x86_64.iso文件在 sdb3分区的arch文件夹里

添加2个目录,先挂载sdb3分区到目录/sb3下,再挂在iso镜像文件到/iso目录下.
# mkdir /sb3

# mkdir /iso
# mount /dev/sdb3 /sb3
# mount /sb3/arch/archlinux-2019.03.01-x86_64.iso
# exit

04. 重启进入root(zsh) 磁盘管理

blkid
/dev/sda6: TYPE="ext4" //用于根目录
/dev/sda7: TYPE="ext4" //用于home目录
/dev/sda9: TYPE="swap" //用于交换区

# mkfs.ext4 /dev/sda6
# mount /dev/sda6 /mnt

# mkdir /mnt/home
# mount /dev/sda7 /mnt/home

mkswap /dev/sda9
# swapon /dev/sda9

05. 网络设置

若是有线DHCP网络直接自动获取ip,ping测试一下链接即可。

dhcpcd

若是无线wifi网络

wifi-menu  //选择wifi联网

ip link  //查看本机的无线网卡名称

iw dev 无线网卡名称 link   //查看链接状态

ping archlinux.org  //测试网络

更新系统时钟
# timedatectl set-ntp true
timedatectl status    //To check the service status

06. 安装 base,生成分区表

(可选步骤)检查镜像列表文件,适当调整,比如把china的站点放在最前面。

步骤1若有准备,这里可以直接使用,复制过来即可。/etc/pacman.d/mirrorlist

通过 pacstrap 安装基本系统
# pacstrap /mnt base
pacstrap -i /mnt base base-devel

https://git.archlinux.org/arch-install-scripts.git/tree/pacstrap.in
Options: -C config Use an alternate config file for pacman -c Use the package cache on the host, rather than the target -G Avoid copying the host's pacman keyring to the target -i Prompt for package confirmation when needed (run interactively) -M Avoid copying the host's mirrorlist to the target -h Print this help message

生成 fstab 配置
# genfstab -U -p /mnt >> /mnt/etc/fstab

07. 转换到已安装系统的root权限下

arch-chroot /mnt

已进入新装的系统命令行下,是默认的 /bin/bash

alias ls='ls --color'    //增加列表颜色显示

08. 无线wifi安装网络必要组建

pacman -S dialog

pacman -S wpa_supplicant

pacman -S iw

09. 安装grub

10. 基本设置

11. 安装桌面环境

12. 安装其他

13. 重启登录桌面

14. 安装输入法,字体

15. 桌面下安装其他

一切没有问题将会自动以 root 登录,目前 Arch Linux 的安装方式和 Gentoo 差不多,
都通过 Change Root。

-----------

安装系统

chroot 到刚安装的新系统
# arch-chroot /mnt
现在已经根目录已经切换到刚安装的系统,所进行的一切操作也即是对新系统的。
arch-chroot /mnt /bin/bash
alias ls='ls --color'

安装 Grub
# pacman —U /path/to/fuse<version>.pkg.tar.xz /path/to/freetype2<version>.pkg.tar.xz
pacman -Sy fuse2

# pacman -S grub-bios
# grub-install --recheck /dev/sda
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo
# grub-mkconfig -o /boot/grub/grub.cfg

-------------
配置系统
修改 Locale,定义用户所使用的语言及字符集。
/etc/locale.gen
en_US.UTF-8 UTF-8
zh_CN.GB18030 GB18030
zh_CN.GBK GBK
zh_CN.UTF-8 UTF-8
zh_CN GB2312
# locale-gen
$ cat /etc/locale.conf
LANG="en_US.UTF-8"
# echo LANG=en_US.UTF-8 > /etc/locale.conf
# export LANG=en_US.UTF-8
注意:不要在这里把系统全局设置成中文,因为终端无法显示中文,请单独将桌面环境设置为中文。

终端字体(可选)
编辑 /etc/vconsole.conf:
KEYMAP=us
FONT=Lat2-Terminus16
or
FONT=

配置时区及硬件时间
# ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# hwclock --systohc --utc

设置系统时间:
$ date -s "03 23, 2019 12:23:04"
或利用 ntp 自动校时:
$ pacman -S ntp
$ ntpdate time.nist.gov
将系统时间写入硬件时钟:
$ hwclock --systohc --utc
注意:
Linux 的硬件时钟使用 UTC,而 Windows 则使用本地时间。
如果要和 Windows 进行双系统启动,可以将 Windows 设置为使用 UTC 硬件时钟,参见这里。
同时关闭 Windows 上的自动校时功能,只用 Linux 上的 ntp。
https://wiki.archlinux.org/index.php/System_time
https://linux.cn/lfs/LFS-BOOK-7.7-systemd/chapter07/clock.html

设置 hostname
# echo tompc > /etc/hostname
你还得修改/etc/hosts文件的内容
nano /etc/hosts
你会看到如下内容:
127.0.0.1 localhost.localdomain localhost 主机名
::1 localhost.localdomain localhost 主机名
这里面的主机名也需要修改

配置网络
# pacman -S wireless_tools wpa_supplicant wpa_actiond dialog
# wifi-menu wlan0
# systemctl enable net-auto-wireless.service

配置 pacman,启用 multilib 源,此源可在 Arch Linux 64 位系统上运行 32 位的程序
/etc/pacman.conf
[multilib]
SigLevel = PackageRequired
Include = /etc/pacman.d/mirrorlist

修改 root 密码
# passwd
创建用户,并设置密码
# useradd -m -g users -s /bin/bash tom
# passwd tom
安装并配置顺手的 Sudo
# pacman -S sudo
/etc/sudoers
root ALL=(ALL)ALL
tom ALL=(ALL)ALL
至此完成基本的配置,重启继续折腾
先退出 chroot 环境:
exit
然后,卸载分区并重启系统:
umount -R /mnt
/mnt/home
reboot
-------------
1.安装ALSA(声卡)
pacman -S alsa-utils
2.安装显卡驱动
由于我使用的是Intel核显,因此如下是核显驱动的安装,如果你使用的是其他显卡,请参考官方wiki,点击进入。
pacman -S mesa xf86-video-intel
3.安装触摸板驱动
pacman -S xf86-input-synaptics

4. 安装显示服务器
这里可选wayland和xorg-server,gnome对于前者已经支持的比较完善了,当然大家亦可选择全装。
# xorg及其utils
pacman -S xorg-server xorg-xinit
# wayland
pacman -S wayland

安装桌面环境
这里以 GNOME 为例:
$ pacman -S gnome
要启用图形界面登录和锁屏等功能,可启用 gdm:
$ systemctl enable gdm.service
安装 GNOME 的一些常用工具(更多工具和扩展请参见这里):
$ pacman -S gnome-tweak-tool gnome-packagekit gnome-settings-daemon-updates
pacman -S file-roller gedit cheese
pacman -S unrar unzip p7zip
安装中文输入法,GNOME 集成了 iBus,所以只需安装合适的输入法引擎,然后在 GNOME 系统设置中启用即可,参见这里:
$ pacman -S ibus-libpinyin

3.安装浏览器
这里我们使用chromium,至于为什么不是firefox,原因有二,其一,我觉得它更快;其二,它能用最近的flash插件。
pacman -S chromium
最新的flash插件需要到AUR上去下,这里提供下载地址,点击下载。
下载完成后,解压,进入相关目录。
makepkg
pacman -U 生成的文件名,以.xz结尾

5.注册相关服务
务必记得安装networkmanager,不然无法开启网络的自动探测。
pacman -S networkmanager
开启网络服务
systemctl enable NetworkManager
如果你安装的是Gnome,你需要开启gdm。
systemctl enable gdm

https://wiki.archlinux.org/index.php/Systemd-boot#Configuration


bash-4.4$ dnf list installed *zip*
Installed Packages
bzip2.x86_64 1.0.6-28.fc29 @anaconda
bzip2-libs.x86_64 1.0.6-28.fc29 @anaconda
gzip.x86_64 1.9-7.fc29 @anaconda
perl-Archive-Zip.noarch 1.64-1.fc29 @fedora 
perl-Compress-Bzip2.x86_64 2.26-9.fc29 @fedora 
perl-Compress-Raw-Bzip2.x86_64 2.081-5.fc29 @anaconda
unzip.x86_64 6.0-42.fc29 @updates 
zip.x86_64 3.0-23.fc29 @anaconda
bash-4.4$
bash-4.4$ dnf list installed *pinyin*
Installed Packages
ibus-libpinyin.x86_64 1.11.0-1.fc29 @updates
libpinyin.x86_64 2.2.2-1.fc29 @updates
libpinyin-data.x86_64 2.2.2-1.fc29 @updates
bash-4.4$


========================
https://wiki.archlinux.org/index.php/GnuPG
https://www.gnupg.org/
https://www.openpgp.org/
https://wiki.archlinux.org/index.php/List_of_applications/Security#Encryption,_signing,_steganography

GnuPG是RFC4880(也称为PGP)定义的OpenPGP标准的完整且免费的实现。GnuPG允许您加密和签署您的数据和通信。
它具有通用的密钥管理系统以及各种公钥目录的访问模块。GnuPG,也称为GPG,是一个命令行工具,具有与其他应用程序轻松集成的功能。
提供丰富的前端应用程序和库。GnuPG的第2版还提供对S / MIME和Secure Shell(ssh)的支持。

Verify a signature
To verify a signature use the --verify flag: 使用--verify验证签名
$ gpg --verify doc.sig
where doc.sig is the signed file containing the signature you wish to verify.

If you are verifying a detached signature, both the signed data file and the signature file must be present when verifying. For example, to verify Arch Linux's latest iso you would do:
如果要验证分离的签名,则验证时必须存在(签名数据文件)和(签名文件)。且位于同一目录下
$ gpg --verify archlinux-version.iso.sig
$ gpg --verify archlinux-2019.03.01-x86_64.iso.sig

You can also specify the signed data file with a second argument:
不在同一目录下,需要指定路径
$ gpg --verify archlinux-version.iso.sig /path/to/archlinux-version.iso


===================
创建密钥对
通过键入终端生成密钥对:

$ gpg --full-gen-key

===========
http://pgp.mit.edu/
MIT PGP公钥服务器

提交密钥 Submitting a key
1. 将公钥的ASCII装甲版本剪切并粘贴到文本框中。
2. 按“提交”。
就这么简单!密钥服务器将立即处理您的请求。
如果您愿意,可以使用提取过程检查您的密钥是否存在。

提取密钥
在“搜索字符串”框中键入要搜索的文本。如果要通过其十六进制KeyID查找密钥,则必须在ID前面加上0x
选中“索引”或“详细索引”复选框。“详细”选项将在键上显示签名。
按“执行搜索!”按钮。
服务器将返回与搜索文本匹配的键列表。该页面将包含每个KeyID和每个括号分隔标识符(即< [email protected] >)的链接。
单击超文本链接将显示公钥的ASCII装甲版本。

提取警告
搜索引擎与pgp程序使用的搜索引擎不同。它将返回包含搜索字符串中所有单词的所有键的信息。
在此上下文中的“单词”是一串连续的字母字符。例如,在字符串[email protected]中,单词是marc, mit和edu。
这意味着您可能不会返回某些键。如果数据库中存在Marc Edu <mit.foo.com>的密钥,则上述查询将返回此密钥。
如果您不想查看所有这些额外匹配,可以选择“仅返回完全匹配”,并且只返回包含指定搜索字符串的键。
在任何情况下, 该算法都不匹配部分单词。因此,如果您习惯只指定长名称的一部分,则此名称将不再有效。
目前,仅为KeyID和在匹配括号之间找到的文本生成超文本链接。(将您的电子邮件地址放在密钥ID字符串中的括号内是一种常见的惯例。)

===========

------------
https://blog.fooleap.org/hard-disk-installation-for-archlinux.html
https://vsxen.github.io/2016/11/08/install-arch-with-win7/
https://hyjk2000.github.io/2014/01/23/arch-linux-install-guide/
http://blog.lucode.net/linux/archlinux-install-tutorial.html
==================
https://wiki.archlinux.org/index.php/List_of_applications/Security#Encryption,_signing,_steganography
网络安全
另见维基百科:数据包分析器的比较。
https://en.wikipedia.org/wiki/Comparison_of_packet_analyzers
=====================

============
https://www.archlinux.org/

https://wiki.archlinux.org/
https://wiki.archlinux.org/index.php/Installation_guide
https://wiki.archlinux.org/index.php/Main_page_(简体中文)
============
主要步骤 

完全的离线安装可参考如下:

https://wiki.archlinux.org/index.php/Offline_installation

完全的联网安装:

https://www.archlinux.org/releng/netboot/

说明:本文仅通过硬盘引导启动,还需要联网安装,与以上官方教程主要区别是跳过U盘制作的过程。

当前电脑仅支持BIOS的MBR分区,所以这里不考虑UEFI的GPT分区。

提前规划好分区,(/根分区,/home分区,/swap交换区,等)

01. 文件准备,下载并验证

02. 添加启动项目(或者制作启动U盘)

03. 重启进入rootfs 挂载iso

04. 重启进入root(zsh) 磁盘管理

05. 网络设置

06. 安装 base,生成分区表

07. 转换到已安装系统的root权限下

08. 安装网络必要组建

09. 安装grub

10. 基本设置

11. 安装桌面环境

12. 安装其他

13. 重启登录桌面

14. 安装输入法,字体

15. 桌面下安装其他

16. 桌面的选择 

17. 软件列表

18. 防火墙

=======

01. 文件准备,下载并验证

https://www.archlinux.org/download/
当前版本: 2019.03.01
包含的内核: 4.20.13
ISO尺寸: 602.0 MB

PGP签名: https://www.archlinux.org/iso/2019.03.01/archlinux-2019.03.01-x86_64.iso.sig
MD5: 8164667750c46cf297720b21145e1e27
SHA1: e32acb5a7b7cfb2bdba10697cce48ab69e13c186


$ ls
archlinux-2019.03.01-x86_64.iso 
archlinux-2019.03.01-x86_64.iso.sig
$
md5sum archlinux-2019.03.01-x86_64.iso
8164667750c46cf297720b21145e1e27 archlinux-2019.03.01-x86_64.iso
sha1sum archlinux-2019.03.01-x86_64.iso
e32acb5a7b7cfb2bdba10697cce48ab69e13c186 archlinux-2019.03.01-x86_64.iso

现有Arch Linux系统下验证 

$ pacman-key -v archlinux-2019.03.01-x86_64.iso.sig
==> Checking archlinux-2019.03.01-x86_64.iso.sig...
gpg: assuming signed data in 'archlinux-2019.03.01-x86_64.iso'
gpg: Signature made Fri 01 Mar 2019 11:57:55 PM CST
gpg: using RSA key 4AA4767BBC9C4B1D18AE28B77F2D434B9741E8AC
gpg: Note: trustdb not writable
gpg: Good signature from "Pierre Schmitz <[email protected]>" [full]
$

其他Linux系统下验证

$ gpg --keyserver pgp.mit.edu --keyserver-options auto-key-retrieve --verify archlinux-2019.03.01-x86_64.iso.sig
gpg: assuming signed data in 'archlinux-2019.03.01-x86_64.iso'
gpg: Signature made Fri 01 Mar 2019 11:57:55 PM CST
gpg: using RSA key 4AA4767BBC9C4B1D18AE28B77F2D434B9741E8AC
gpg: requesting key 7F2D434B9741E8AC from hkp server pgp.mit.edu
gpg: key 7F2D434B9741E8AC: 32 signatures not checked due to missing keys
gpg: key 7F2D434B9741E8AC: public key "Pierre Schmitz <[email protected]>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg: imported: 1
gpg: Good signature from "Pierre Schmitz <[email protected]>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: 4AA4 767B BC9C 4B1D 18AE 28B7 7F2D 434B 9741 E8AC
$

(可选步骤)镜像文件准备,这个步骤可以适当加快后续安装过程中,联网下载的速度。

https://www.archlinux.org/mirrorlist/    这里可以生成并下载最新的 pacman 镜像列表

https://www.archlinux.org/mirrors/status/    这里可以查看镜像状态 部分站点未同步

https://wiki.archlinux.org/index.php/Mirrors   更多镜像内容 

参考以上编辑自己的镜像文件,锅内将china放在最前面. 注意:生成的文件里,去掉站点前面的#号。

mirrorlist 文件,后续复制到 /etc/pacman.d/ 目录下

02. 添加启动项目(或者制作启动U盘)

title Install Arch3
root (hd0,2)
kernel /arch20190301/vmlinuz archisolabel=ARCH_201903
initrd /arch20190301/archiso.img

可参考:硬盘安装Linux 系统

https://www.cnblogs.com/sztom/p/10292522.html

03. 重启进入rootfs 挂载iso

启动过程提示找不到,得到一个 Shell [rootfs]状态,手动挂载iso

通过df, lsblk, blkid, fdisk -l, mount等命令再次确认磁盘状态,

我这里的状态是:要挂载的archlinux-2019.03.01-x86_64.iso文件在 sdb3分区的arch文件夹里

添加2个目录,先挂载sdb3分区到目录/sb3下,再挂在iso镜像文件到/iso目录下.
# mkdir /sb3

# mkdir /iso
# mount /dev/sdb3 /sb3
# mount /sb3/arch/archlinux-2019.03.01-x86_64.iso
# exit

04. 重启进入root(zsh) 磁盘管理

blkid
/dev/sda6: TYPE="ext4" //用于根目录
/dev/sda7: TYPE="ext4" //用于home目录
/dev/sda9: TYPE="swap" //用于交换区

# mkfs.ext4 /dev/sda6
# mount /dev/sda6 /mnt

# mkdir /mnt/home
# mount /dev/sda7 /mnt/home

mkswap /dev/sda9
# swapon /dev/sda9

05. 网络设置

若是有线DHCP网络直接自动获取ip,ping测试一下链接即可。

dhcpcd

若是无线wifi网络

wifi-menu  //选择wifi联网

ip link  //查看本机的无线网卡名称

iw dev 无线网卡名称 link   //查看链接状态

ping archlinux.org  //测试网络

更新系统时钟
# timedatectl set-ntp true
timedatectl status    //To check the service status

06. 安装 base,生成分区表

(可选步骤)检查镜像列表文件,适当调整,比如把china的站点放在最前面。

步骤1若有准备,这里可以直接使用,复制过来即可。/etc/pacman.d/mirrorlist

通过 pacstrap 安装基本系统
# pacstrap /mnt base
pacstrap -i /mnt base base-devel

https://git.archlinux.org/arch-install-scripts.git/tree/pacstrap.in
Options: -C config Use an alternate config file for pacman -c Use the package cache on the host, rather than the target -G Avoid copying the host's pacman keyring to the target -i Prompt for package confirmation when needed (run interactively) -M Avoid copying the host's mirrorlist to the target -h Print this help message

生成 fstab 配置
# genfstab -U -p /mnt >> /mnt/etc/fstab

07. 转换到已安装系统的root权限下

arch-chroot /mnt

已进入新装的系统命令行下,是默认的 /bin/bash

alias ls='ls --color'    //增加列表颜色显示

08. 无线wifi安装网络必要组建

pacman -S dialog

pacman -S wpa_supplicant

pacman -S iw

09. 安装grub

10. 基本设置

11. 安装桌面环境

12. 安装其他

13. 重启登录桌面

14. 安装输入法,字体

15. 桌面下安装其他

一切没有问题将会自动以 root 登录,目前 Arch Linux 的安装方式和 Gentoo 差不多,
都通过 Change Root。

-----------

安装系统

chroot 到刚安装的新系统
# arch-chroot /mnt
现在已经根目录已经切换到刚安装的系统,所进行的一切操作也即是对新系统的。
arch-chroot /mnt /bin/bash
alias ls='ls --color'

安装 Grub
# pacman —U /path/to/fuse<version>.pkg.tar.xz /path/to/freetype2<version>.pkg.tar.xz
pacman -Sy fuse2

# pacman -S grub-bios
# grub-install --recheck /dev/sda
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo
# grub-mkconfig -o /boot/grub/grub.cfg

-------------
配置系统
修改 Locale,定义用户所使用的语言及字符集。
/etc/locale.gen
en_US.UTF-8 UTF-8
zh_CN.GB18030 GB18030
zh_CN.GBK GBK
zh_CN.UTF-8 UTF-8
zh_CN GB2312
# locale-gen
$ cat /etc/locale.conf
LANG="en_US.UTF-8"
# echo LANG=en_US.UTF-8 > /etc/locale.conf
# export LANG=en_US.UTF-8
注意:不要在这里把系统全局设置成中文,因为终端无法显示中文,请单独将桌面环境设置为中文。

终端字体(可选)
编辑 /etc/vconsole.conf:
KEYMAP=us
FONT=Lat2-Terminus16
or
FONT=

配置时区及硬件时间
# ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# hwclock --systohc --utc

设置系统时间:
$ date -s "03 23, 2019 12:23:04"
或利用 ntp 自动校时:
$ pacman -S ntp
$ ntpdate time.nist.gov
将系统时间写入硬件时钟:
$ hwclock --systohc --utc
注意:
Linux 的硬件时钟使用 UTC,而 Windows 则使用本地时间。
如果要和 Windows 进行双系统启动,可以将 Windows 设置为使用 UTC 硬件时钟,参见这里。
同时关闭 Windows 上的自动校时功能,只用 Linux 上的 ntp。
https://wiki.archlinux.org/index.php/System_time
https://linux.cn/lfs/LFS-BOOK-7.7-systemd/chapter07/clock.html

设置 hostname
# echo tompc > /etc/hostname
你还得修改/etc/hosts文件的内容
nano /etc/hosts
你会看到如下内容:
127.0.0.1 localhost.localdomain localhost 主机名
::1 localhost.localdomain localhost 主机名
这里面的主机名也需要修改

配置网络
# pacman -S wireless_tools wpa_supplicant wpa_actiond dialog
# wifi-menu wlan0
# systemctl enable net-auto-wireless.service

配置 pacman,启用 multilib 源,此源可在 Arch Linux 64 位系统上运行 32 位的程序
/etc/pacman.conf
[multilib]
SigLevel = PackageRequired
Include = /etc/pacman.d/mirrorlist

修改 root 密码
# passwd
创建用户,并设置密码
# useradd -m -g users -s /bin/bash tom
# passwd tom
安装并配置顺手的 Sudo
# pacman -S sudo
/etc/sudoers
root ALL=(ALL)ALL
tom ALL=(ALL)ALL
至此完成基本的配置,重启继续折腾
先退出 chroot 环境:
exit
然后,卸载分区并重启系统:
umount -R /mnt
/mnt/home
reboot
-------------
1.安装ALSA(声卡)
pacman -S alsa-utils
2.安装显卡驱动
由于我使用的是Intel核显,因此如下是核显驱动的安装,如果你使用的是其他显卡,请参考官方wiki,点击进入。
pacman -S mesa xf86-video-intel
3.安装触摸板驱动
pacman -S xf86-input-synaptics

4. 安装显示服务器
这里可选wayland和xorg-server,gnome对于前者已经支持的比较完善了,当然大家亦可选择全装。
# xorg及其utils
pacman -S xorg-server xorg-xinit
# wayland
pacman -S wayland

安装桌面环境
这里以 GNOME 为例:
$ pacman -S gnome
要启用图形界面登录和锁屏等功能,可启用 gdm:
$ systemctl enable gdm.service
安装 GNOME 的一些常用工具(更多工具和扩展请参见这里):
$ pacman -S gnome-tweak-tool gnome-packagekit gnome-settings-daemon-updates
pacman -S file-roller gedit cheese
pacman -S unrar unzip p7zip
安装中文输入法,GNOME 集成了 iBus,所以只需安装合适的输入法引擎,然后在 GNOME 系统设置中启用即可,参见这里:
$ pacman -S ibus-libpinyin

3.安装浏览器
这里我们使用chromium,至于为什么不是firefox,原因有二,其一,我觉得它更快;其二,它能用最近的flash插件。
pacman -S chromium
最新的flash插件需要到AUR上去下,这里提供下载地址,点击下载。
下载完成后,解压,进入相关目录。
makepkg
pacman -U 生成的文件名,以.xz结尾

5.注册相关服务
务必记得安装networkmanager,不然无法开启网络的自动探测。
pacman -S networkmanager
开启网络服务
systemctl enable NetworkManager
如果你安装的是Gnome,你需要开启gdm。
systemctl enable gdm

https://wiki.archlinux.org/index.php/Systemd-boot#Configuration


bash-4.4$ dnf list installed *zip*
Installed Packages
bzip2.x86_64 1.0.6-28.fc29 @anaconda
bzip2-libs.x86_64 1.0.6-28.fc29 @anaconda
gzip.x86_64 1.9-7.fc29 @anaconda
perl-Archive-Zip.noarch 1.64-1.fc29 @fedora 
perl-Compress-Bzip2.x86_64 2.26-9.fc29 @fedora 
perl-Compress-Raw-Bzip2.x86_64 2.081-5.fc29 @anaconda
unzip.x86_64 6.0-42.fc29 @updates 
zip.x86_64 3.0-23.fc29 @anaconda
bash-4.4$
bash-4.4$ dnf list installed *pinyin*
Installed Packages
ibus-libpinyin.x86_64 1.11.0-1.fc29 @updates
libpinyin.x86_64 2.2.2-1.fc29 @updates
libpinyin-data.x86_64 2.2.2-1.fc29 @updates
bash-4.4$


========================
https://wiki.archlinux.org/index.php/GnuPG
https://www.gnupg.org/
https://www.openpgp.org/
https://wiki.archlinux.org/index.php/List_of_applications/Security#Encryption,_signing,_steganography

GnuPG是RFC4880(也称为PGP)定义的OpenPGP标准的完整且免费的实现。GnuPG允许您加密和签署您的数据和通信。
它具有通用的密钥管理系统以及各种公钥目录的访问模块。GnuPG,也称为GPG,是一个命令行工具,具有与其他应用程序轻松集成的功能。
提供丰富的前端应用程序和库。GnuPG的第2版还提供对S / MIME和Secure Shell(ssh)的支持。

Verify a signature
To verify a signature use the --verify flag: 使用--verify验证签名
$ gpg --verify doc.sig
where doc.sig is the signed file containing the signature you wish to verify.

If you are verifying a detached signature, both the signed data file and the signature file must be present when verifying. For example, to verify Arch Linux's latest iso you would do:
如果要验证分离的签名,则验证时必须存在(签名数据文件)和(签名文件)。且位于同一目录下
$ gpg --verify archlinux-version.iso.sig
$ gpg --verify archlinux-2019.03.01-x86_64.iso.sig

You can also specify the signed data file with a second argument:
不在同一目录下,需要指定路径
$ gpg --verify archlinux-version.iso.sig /path/to/archlinux-version.iso


===================
创建密钥对
通过键入终端生成密钥对:

$ gpg --full-gen-key

===========
http://pgp.mit.edu/
MIT PGP公钥服务器

提交密钥 Submitting a key
1. 将公钥的ASCII装甲版本剪切并粘贴到文本框中。
2. 按“提交”。
就这么简单!密钥服务器将立即处理您的请求。
如果您愿意,可以使用提取过程检查您的密钥是否存在。

提取密钥
在“搜索字符串”框中键入要搜索的文本。如果要通过其十六进制KeyID查找密钥,则必须在ID前面加上0x
选中“索引”或“详细索引”复选框。“详细”选项将在键上显示签名。
按“执行搜索!”按钮。
服务器将返回与搜索文本匹配的键列表。该页面将包含每个KeyID和每个括号分隔标识符(即< [email protected] >)的链接。
单击超文本链接将显示公钥的ASCII装甲版本。

提取警告
搜索引擎与pgp程序使用的搜索引擎不同。它将返回包含搜索字符串中所有单词的所有键的信息。
在此上下文中的“单词”是一串连续的字母字符。例如,在字符串[email protected]中,单词是marc, mit和edu。
这意味着您可能不会返回某些键。如果数据库中存在Marc Edu <mit.foo.com>的密钥,则上述查询将返回此密钥。
如果您不想查看所有这些额外匹配,可以选择“仅返回完全匹配”,并且只返回包含指定搜索字符串的键。
在任何情况下, 该算法都不匹配部分单词。因此,如果您习惯只指定长名称的一部分,则此名称将不再有效。
目前,仅为KeyID和在匹配括号之间找到的文本生成超文本链接。(将您的电子邮件地址放在密钥ID字符串中的括号内是一种常见的惯例。)

===========

------------
https://blog.fooleap.org/hard-disk-installation-for-archlinux.html
https://vsxen.github.io/2016/11/08/install-arch-with-win7/
https://hyjk2000.github.io/2014/01/23/arch-linux-install-guide/
http://blog.lucode.net/linux/archlinux-install-tutorial.html
==================
https://wiki.archlinux.org/index.php/List_of_applications/Security#Encryption,_signing,_steganography
网络安全
另见维基百科:数据包分析器的比较。
https://en.wikipedia.org/wiki/Comparison_of_packet_analyzers
=====================

猜你喜欢

转载自www.cnblogs.com/sztom/p/10587035.html