linuxwiki
ArchLinux Installation Guide
1 Close Reflector
#systemctl stop reflector.services
2 Connect The Internet
#iwctl --passphrase PASSPHRASE station DEVICES connect SSID
#dhcpcd
3 Select The Mirrors
#vim /etc/pacman.d/mirrorlist
#Server = https://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch
4 Update The System Clock
#timedatectl set-ntp true
#timedatectl status
5 Partition The Disks,F(xiàn)ormat The Partitions,Mount
#fdisk -l? #fdisk /dev/sda? #g
#mkfs.vfat -F 32 /dev/sda1
#mkfs.ext4 /dev/sda2
#pvcreate /dev/sda2
#vgcreate arch /dev/sda2
#lvccreate -L +8G arch -n swap
#lvcreate -l +100%FREE arch -n root
#mkfs.ext4 /dev/mapper/arch-root
#mkswap /dev/mapper/arch-swap
#swapon /dev/mapper/arch-swap
#mount /dev/mapper/arch-root /mnt
#mkdir /mnt/boot
#mount /dev/sda1 /mnt/boot
6 Install Essential Packages
#pacstrap -i /mnt base base-devel linux linux-firmware lvm2
7 Fstab
#genfstab -U /mnt >>/mnt/etc/fstab
#cat /mnt/etc/fstab
8 Chroot
#arch-chroot /mnt
9 Time Zone
#ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
10 Hwclock
#hwclock --systohc
11 Install Tools
#pacman -S iwd dhcpcd wpa_supplicant vim intel-ucode alsa-utils chromium
12 Locatization
#echo en_US.UTF-8 UTF-8 >> /etc/locale.gen
#locale-gen
#echo LANG=en_US.UTF-8 > /etc/locale.conf
13 Hostname
#echo localhost > /etc/hostname
14 Hosts
#vim /etc/hosts
127.0.0.1 localhost.localdomain localhost
::1?? localhost.localdomain localhost
127.0.0.1 localhost.localdomain localhost
15 Initramfs
#vim /etc/mkinitcpio.conf
HOOKS=(base udev ... block lvm2 filesystems)
#mkinitcpio –P
16 Boot Loader
#pacman -S dosfstools grub efibootmgr
#grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
#grub-mkconfig -o /boot/grub/grub.cfg
17 Root Password
#passwd root
18 Useradd
#useradd -m username
#passwd username
19 Reboot
#reboot
20 Install Desktop,Desktop Configuration,Close Screensaver
#pacman -S xorg xorg-xinit
#git clone https://git.suckless.org/dwm
#git clone https://git.suckless.org/st
#make clean install
#vim .xinitrc
while true;do
????? xsetroot -name "$(date +"%F %T %B %A")"
????? sleep 1s
done &
fcitx5 -d
exec dwm
#pacman -S fcitx5-im fcitx5-chinese-addons adobe-source-han-sans-cn-fonts
#vim /etc/environment
GTK_IM_MODULE=fcitx
QT_IM_MODULE=fcitx
XMODIFIERS=@im=fcitx
INPUT_METHOD=fcitx
SDL_IM_MODULE=fcitx
GLFW_IM_MODULE=ibus
#fcitx5-configtool
#vim /etc/X11/xorg.conf.d/xorg.conf
#”ServerLayout”
?Option "BlankTime" "0"
?Option "StandbyTime" "0"
?Option "SuspendTime" "0"
?Option "OffTime" "0"
#pacman -S clamav
#freshclam
#clamscan -r /
==================================================
ArchLinux Installation Guide Wiki
第1章? 工欲善其事,必先利其器
1.1? 下載鏡像
https://mirrors.tuna.tsinghua.edu.cn/archlinux/iso/2022.02.01/archlinux-2022.02.01-x86_64.iso
1.2? 啟動(dòng)U盤制作
1.2.1 “rufus”
https://github.com/pbatard/rufus/releases/download/v3.20/rufus-3.20.exe
1.2.2 “dd”
#dd if=/aaa.iso of=/dev/sdb bs=2M conv=fsync status=progress
1.2.3 “ventoy”U盤制作工具,可以安裝多個(gè)鏡像
1.3? 驗(yàn)證引導(dǎo)模式
# ls? /sys/firmware/efi/efivars
1.4 關(guān)閉reflector服務(wù)
#systemctl stop reflector.services
第2章? 安裝
2.1? 連接網(wǎng)絡(luò)
2.1.1? iwd
#命令行參數(shù)形式
#iwctl --passphrase passphrase station device connect SSID
#dhcpcd
#交互提示符形式
#iwctl
#device list (列出可用設(shè)備)
#station device scan(掃描網(wǎng)卡可用設(shè)備)
#station device get-networks(列取可用無線網(wǎng))
#station device connect SSID(連接)
#station device disconnect(斷開連接)
#dhcpcd
2.1.2? netctl
#pacman -S wpa_supplicant dialog netctl
#wifi-menu
#ls /etc/netctl
#systemctl enable netclt-auto@wls1.service(開機(jī)啟動(dòng))
#systemctl start netclt-auto@wls1.service
2.1.3? wpa_supplicant
#lspci -k
#lsusb -v
#ip link
#ip link set wls1 up(如果沒有激活,則激活接口)
#iw dev wls1 scan | grep ssid(需要安裝iw工具包)
#wpa_passpshrase wls1 123 > /etc/wpa_passpshrase/wpa_supplicant-wls1.conf
#wpa_supplicant -B -i wls1 -c /etc/wpa_supplicant/wpa_supplicant-wls1.conf
#dhcpcd wls1
2.1.4? 網(wǎng)卡直連
#cp /etc/netctl/examples/ethernet-dhcp /etc/netctl
#vim /etc/netctl/ethernet-dhcp
Description=” ”
Interface=enp7s0
Connection=Ethernet
IP=dhcp
#systemctl start ethernet-dhcp?? //啟動(dòng)有線網(wǎng)絡(luò)連接
#systemctl enable ethernet-dhcp //需要?jiǎng)t開機(jī)啟動(dòng)
2.1.5? PPPOE
2.1.5.1? ppp聯(lián)網(wǎng)
#pacman –S ppp ry-pppoe
#ip link set your_interfce down/up
#pppoe-setup(配置)
#vim /etc/ppp/pppoe.conf(撥號(hào)配置文件)
#vim /etc/ppp/pap-secrets(撥號(hào)賬號(hào)密碼配置文件)
#pppoe-start
#dhcpcd device
#pppoe-stop
#systemctl enable adsl
#systemctl start adsl
2.1.5.2? netctl,pppoe
#cp /etc/netctl/examples/pppoe /etc/netctl/adsl
#vim /etc/netctl/adsl(只需要修改下面兩行,用戶和密碼)
USER=’? ’
PASSWORD=’? ’
#netctl enable adsl(啟用配置文件)
#netctl reenable adsl(創(chuàng)建開機(jī)systemd啟動(dòng)服務(wù))
#systemctl enable netctl@adsl.service (開機(jī)啟動(dòng)撥號(hào)服務(wù))
#netctl list(列出可以連接的網(wǎng)絡(luò))
#netctl start adsl
#netctl stop adsl
第3章? 選擇鏡像
3.1? 主倉庫
#vim /etc/pacman.d/mirrorlist
#Server = https://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch
#pacman -Syy
3.2? reflector獲取倉庫地址
#reflector --verbose --country ‘China’ -p https -l 30 --sort rate --save /etc/pacman.d/mirrorlist
#pacman -Syy
3.3? 中國社區(qū)倉庫
#vim /etc/pacman.conf
[archlinuxcn]
Server = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch
#pacman -S archlinuxcn-keyring
#pacman -Syy
第4章? 更新系統(tǒng)時(shí)間
#timedatectl set-ntp true
#timedatectl status
第5章? 硬盤分區(qū),掛載
#linux kernel 5.15后的內(nèi)核已經(jīng)原生支持ntfs格式了,用帶參數(shù)的#mount -t ntfs3 /dev/sdb2
5.1? LVM(邏輯分卷管理器)
# fdisk -l
# fdisk /dev/sda
# g (改成gpt分區(qū))
# mkfs.vfat -F 32 /dev/sda1 (efi分區(qū))
# mkfs.ext4 /dev/sda2(根分區(qū))
#pvcreate /dev/sda2(物理卷)
#vgcreate arch /dev/sda2(卷組)
#lvccreate -L +8G arch -n swap(邏輯卷)
#lvcreate -l +100%FREE arch -n root
#mkfs.ext4 /dev/mapper/arch-root
#mkswap /dev/mapper/arch-swap
#swapon /dev/mapper/arch-swap
#mount /dev/mapper/arch-root /mnt
#mkdir /mnt/boot
#mount /dev/sda1 /mnt/boot
5.2? BIOS(基本輸入輸出系統(tǒng))
#fdisk -l
#fdisk /de/sda
#mkfs.ext4 /dev/sda1 (boot分區(qū))
#mkfs.ext4 /dev/sda3 (/ 分區(qū))
#mkswap /dev/sda2 (swap分區(qū))
#swapon /dev/sda2
#mount /dev/sda3 /mnt
#mkdir /mnt/boot
#mount /dev/sda1 /mnt/boot
5.3? systemd(統(tǒng)一可擴(kuò)展固件接口,需要改標(biāo)簽)
# fdisk -l
# fdisk /de/sda
# g (改成gpt分區(qū))
# mkfs.vfat -F 32 /dev/sda1 (efi分區(qū))
# mkfs.ext4 /dev/sda2(/分區(qū))
#mkswap /dev/sda2 (swap分區(qū))
#swapon /dev/sda2
#mount /dev/sda3 /mnt
#mkdir /mnt/boot
#mkdir /mnt/boot/efi
#mount /dev/sda1 /mnt/boot/efi
第6章? 安裝系統(tǒng)基礎(chǔ)包
#pacstrap -i /mnt base base-devel linux linux-firmware
第7章? 配置系統(tǒng)
7.1? Fstab
#genfstab -U /mnt >>/mnt/etc/fstab
#cat /mnt/etc/fstab
7.2? 換到新安裝的系統(tǒng)
#arch-chroot /mnt
7.3? 時(shí)區(qū)
#ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
7.4? 同步硬件時(shí)間
#hwclock --systohc
7.5? 安裝系統(tǒng)配置軟件包
#pacman -S vim wpa_supplicant dialog netctl dhcpcd intel-ucode os-prober alsa-utils git pulseaudio ntfs-3g smplayer player aria2 wget curl udftools vlc lvm2 iwd lxterminal lynx w3m links
7.6? 本地化
7.6.1? /etc/locale.gen
#vim /etc/locale.gen
en_US.UTF-8 UTF-8
#locale-gen(配置后生效)
7.6.2? /etc/locale.conf
#echo.UTF-8 > /etc/locale.conf
或
#vim /etc/locale.conf
LANG=en_US.UTF-8
7.7? 主機(jī)名
#vim /etc/hostname? 或? echo localhost >/etc/hostname
7.8? hosts
#vim /etc/hosts
127.0.0.1 localhost.localdomain localhost
::1?? localhost.localdomain localhost
127.0.0.1 localhost.localdomain localhost
7.9? 創(chuàng)建引導(dǎo)文件,重新創(chuàng)建一個(gè)initramfs
7.9.1 創(chuàng)建引導(dǎo)文件
7.9.1.1 grub
#vim /etc/mkinitcpio.conf
HOOKS=(base udev ... block lvm2 filesystems)
#mkinitcpio –P
7.9.1.2 systemd
#vim /etc/mkinitcpio.conf
HOOKS=(base systemd ... block lvm2 filesystems)
#mkinitcpio –p linux
7.9.2 安裝引導(dǎo)
7.9.2.1? systemd-boot
1 systemd-boot必須為uefi啟動(dòng)
2 安裝systemd-root到EFI分區(qū)中
#bootctl --path=/boot$esp install
3 配置/boot/loader/loader.conf
default arch.conf
timeout 4
console-mode auto
editor no
4 配置/boot/loader/entries/arch.conf
title Arch linux(LVM)
linux /vmlinuz-linux
initrd /intel-ucode.img(如果是AMD則改成amd-ucode.img)
initrd /initramfs-linux.img
options root=UUID=4124654364163431641432(計(jì)算/dev/mapper/arch-root) rw
# blkid -s UUID -o value /dev/mapper/arch-root
7.9.2.2? UEFI引導(dǎo)程序
#pacman -S dosfstools grub efibootmgr
#grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
#grub-mkconfig -o /boot/grub/grub.cfg
7.9.2.3 BIOS-GRUB引導(dǎo)程序
#pacman -S grub
#grub-install --target=i386-pc /dev/sda
#grub-mkconfig -o /boot/grub/grub.cfg
7.10? 配置root密碼
#passwd root
7.11? 用戶管理
#useradd -m username
#passwd username
第8章? 重新引導(dǎo)
#reboot
第9章? 安裝圖形界面,個(gè)性化配置
#pacman -S xorg xorg-xinit
9.1? i3WM
9.1.1
#pacman -S i3wm lxterminal
#pacman -S lightdm lightdm-gtk-greeter
pacman -S lightdm-gtk-greeter-settings
#systemctl enable lightdm
#systemctl start lightdm
#vim /etc/lightdm/lightdm-gtk-greeter.conf
[greeter]
indicators=
#vim .config/i3/config
#default_border pixel 1
9.1.2 i3status配置目錄
#cp /etc/i3status.conf ~/.config/i3status/config
9.2? GNOME
#pacman -S gnome gdm gnome-extra
#systemctl enable gdm
#systemctl enable NetworkManager
#systemctl start NetworkManager
#systemctl start gdm
9.3? KDE
#pacman -S sddm sddm-kcm plasma konsole dolphin ark kate packagekit-qt5 konqueror sweeper
#systemctl enable sddm
#systemctl enable NetworkManager
#systemctl start NetworkManager
#systemctl start sddm
9.4?? DWM(dynamic window manager)、ST(simple terminal)
#git clone https://git.suckless.org/dwm
#git clone https://git.suckless.org/st
#make clean install(在安裝前先安裝chromium這樣字體設(shè)置好了)
#vim .xinitrc
while true;do
?? ?xsetroot -name "$(date +"%F %T %B %A")"
?? ?sleep 1s
done &
#exec --no-startup-id fcitx5 -d(i3用)
fcitx5 -d
exec dwm
第10章? 安裝軟件包
10.1? 中文輸入法
#pacman -S fcitx5-im fcitx5-chinese-addons wqy-microhei
#vim /etc/environment
GTK_IM_MODULE=fcitx
QT_IM_MODULE=fcitx
XMODIFIERS=@im=fcitx
INPUT_METHOD=fcitx
SDL_IM_MODULE=fcitx
#GLFW_IM_MODULE=ibus
#fcitx5-configtool
10.2? 辦公軟件
#pacman -S libreoffice-fresh,libreoffice-fresh-zh-cn
#pacman -S mousepad leafpad
#pacman -S zathura zathura-pdf-poppler
#pacman -S unarchiver,unrar,p7zip
#unar -e GBK *.zip
#unrar -e *.rar
#7z e *.7z
10.3? WEB瀏覽器
#pacman -S firefox firefox-i18n-zh-cn
#pacman -S chromium
10.4? 關(guān)閉屏幕保護(hù)時(shí)間
#vim /etc/X11/xorg.conf.d/xorg.conf
#找到”ServerLayout”字段加入下面4行
?Option "BlankTime" "0"
?Option "StandbyTime" "0"
?Option "SuspendTime" "0"
?Option "OffTime" "0"
10.5 終端復(fù)制粘貼
#ctrl+insert? 復(fù)制
#shift+insert 粘貼
======================================================
Debian make linuxkernel
#swap:8G? ?
#/boot:8G
#storge:50G ?
#apt-get update && apt-get upgrade
#package:
gcc,make,g++,libncurses5-dev,libncurses-dev,libssl-dev,flex,libelf-dev,bc,bison,fakeroot,build-esential,gdb,dpkg-dev,pkg-config,rsync,kmod,cpio
#make menuconfig
#cp /boot/config-4.2.1 /root/config-5.19.cofig
#CONFIG_MODULE_SIG_ALL
#CONFIG_MODULE_SIG_KEY
#CONFIG_SYSTEM_TRUSTED_KEYS="”
#CONFIG_DEBUG_INFO
#CONFIG_SYSTEM_REVOCATION_KEYS=""
#make olddefconfig
# make -j8 ?
#make modules_install
#make install
#update-grub
#reboot
#apt-get remove --purge linux-image-4.4.4
#make -j8 deb-pkg
#dpkg -i linux* or #apt-get install ./linux*.deb
==============================================
Debian GNOME3.38可卸載軟件包名
#apt-get remove gnome-2048,gnome-chess,gnome-games,five-ro-more,hitori,gnome-klotski,lightoff,gnome-mahjongg,gnome-mines,gnome-nibbles,gnome-robots,gnome-sudoku,swell-foop,gnome-taquin,gnome-tetraves,gnome-calendar,gnome-clocks,gnome-contacts,gnome-maps,gnome-music,quadrapassel,rhythmobx,gnome-todo,transmission-gtk,transmission-common,malcontent-gui,evolution,synaptic,network-manager-gnome,gnome-sound-recorder,software-properties-gtk,software-properties-common,cheese,cheese-common,libreoffice-*,libreoffice-common,gnome-shell-extensions,gnome-shell-extensions-prefs,eog,yelp,gnome-logs,gnome-weather,baobab,gnome-disks,simple-scan,gnome-screenshot,gnome-documents,seahorse,totem,totem-common,totem-plugins
Debian Gnome3.38背景配置
#默認(rèn)背景名:homeworld-theme
#默認(rèn)配置文件:/usr/share/desktop-base
#鏈接目錄:/usr/share/image/desktop-base/
#鏈接目錄:/etc/altematives
#清理鏈接文件:/usr/share/wallpapers
Debain清理dpkg的列表中有rc狀態(tài)的包:
##dpkg -l | grep ^rc | awk ‘{print $2}’| xargs dpkg -P
#dpkg -l | grep ^rc | cut -d ‘’-f3 | xargs dpkg --purge
debian中GDM會(huì)話框
#/usr/share/gdm/BuiltlnSessions
#/usr/share/xsessions
debian登錄語言配置
#/etc/locale.gen
#/etc/default/locale
#locale-gen
debian時(shí)區(qū)
#ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
debian安裝頭文件
#apt-get install linux-header-$(uname -r)
debian關(guān)閉睡眠
#systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
debian networkmanager配置文件
#/etc/NetworkManager/system-connections/
=====================================================
Fedora make linuxkernel
#swap:8G
#/boot:8G
#storge:50G
#package:
#dnf install gcc,g++,make,bc,flex,bison,openssl-devel,gdb,openssl,ncurse-devel,zstd,ncurse,elfutils-libelf-devel,dwarves,perl
#make menuconfig? or? #cp /boot/config-4.4.config /boot/config-6.1.config
#CONFIG_MODULE_SIG_ALL
#CONFIG_MODULE_SIG_KEY
#CONFIG_SYSTEM_TRUSTED_KEY=""
#CONFIG_DEBUG_INFO
#make all
#make modules_install
#make install
#reboot
#dnf remove kernel-core-4.4
====================================================
linux連接手機(jī)
1 apt-get install mtp-tools mtpfs
2 mkdir /media/mtp
3 chmod 755 /media/mtp
4 mtpfs -o allow_other /media/mtp
5 umount /media/mtp
==================================================
ffplay -x 800 -y 700 -volume 15 ****.mp3 -autoexit -nodisp -vn
ffplay -x 800 -y 700 -volume 15 ****.mp4 -autoexit -sn
ffplay -x 800 -y 700 -volume 15 ****.mp3 -autoexit -nodisp -loop 0 -an -vn -sn
==================================================
HTTP Address:
https://lctt.github.io/LFS-BOOK
https://nuwen.net/mingw.html
https://pkgs.org/download/syslinux
https://distrowatch.com
https://blog.51cto.com/u_12148962/5871569(debian編譯安裝linux kernel)
===================================================
android軟件清理
1 安裝驅(qū)動(dòng)
2 手機(jī)上安裝pachage names viewer
3 adb devices
4 adb shell pm uninstall --user 0 com.vivo.brower
5 恢復(fù)adb shell cmd package install-existing com.vivo.accounts
==================================================