archlinux-小米pro15_2020款使用archlinux(MX350显卡驱动安装)
阅读原文时间:2023年07月10日阅读:1

1.官网下载archlinux ISO镜像

https://archlinux.org/download/   使用磁力链接下载

2.使用软碟通将镜像写入U盘,制作成U盘启动盘

3.进入BIOS 关掉 安全启动,并将启动方式设置为 UEFI

4.插入U盘 开机按F12,进入启动顺序列表 选择自己的U盘

5.进入 archlinux 安装系统之后,先连上网

有线会自动连上,无线需要自己手动用命令 链接

iwctl #进入一个新的交互命令行

device list #查看网卡叫什么

station wlan0 scan #扫描环境里的wifi

station wlan0 get-networks #显示扫描到的wifi

station wlan0 connect cmcc-a3pr #回车输入密码

exit退出

6.使用archlinuxinstall 安装脚本安装linux

linux内核:用于Arch Linux的不同类型的内核以及如何使用它们

如果需要保存该安装配置,需要实现 挂在一块硬盘 或 U盘

7.重启,进入系统后

更新pacman

pacman -Sy pacman

pacman -Syu

配置sudo命令

# vim /etc/sudoers

%wheel ALL=(ALL) ALL注释去掉

## User privilege specification
##
root ALL=(ALL:ALL) ALL

## Uncomment to allow members of group wheel to execute any command
%wheel ALL=(ALL:ALL) ALL

32位支持
/etc/pacman.conf
[multillib]
include = /etc/pacman.d/mirrorlist

archlinuxcn库
/etc/pacman.conf 添加
[archlinuxcn]

Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch

更新软件包缓存:

sudo pacman -Syy
sudo pacman -Syu

安装 archlinuxcn-keyring 包以导入 GPG key

pacman -S archlinuxcn-keyring

AUR

安装yaourt

pacman -Syu yaourt

安装完成后以后可以用yaourt来更新系统,或者仅仅更新aur包,命令分别为
$ yaourt -Syua
$ yaourt -Sbu –aur

安装yay

可以安装用户上传的包

# pacman -S yay

Octopi
https://github.com/aarnt/octopi
yaor pacman -S octopi

安装中文字体

ttf-dejavu
wqy-microhei
adobe-source-han-sans-cn-fonts 思源黑体

开源字体
pacman -S adobe-source-han-serif-cn-fonts wqy-zenhei
pacman -S noto-fonts noto-fonts-cjk noto-fonts-emoji noto-fonts-extra

安装中文输入法

[root@archlinux zbf]# pacman -S fcitx5-chinese-addons

fcitx5 fcitx5-gtk fcitx5-qt fcitx5-chinese-addons

fcitx5-configtool

fcitx5-material-color

环境变量:开机自启动(当前用户)

[zbf@archlinux ~]$ cat .bash_profile
#
# ~/.bash_profile
#

[[ -f ~/.bashrc ]] && . ~/.bashrc

export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx

[zbf@archlinux ~]$ 

设置中添加输入法,pinyin

输入法 上右键 重启输入法。

设置系统语言为中文

vim /etc/locale.gen
开启下列配置
en_US.UTF-8
zh_CN.UTF-8
然后使用 locale-gen 使配置生效,生成 locale。
设定默认locale
echo 'LANG=zh_CN.UTF-8' > /etc/locale.conf
输入locale查看一下配置  locale -a`列出所有启用的Locale

在设置的区域设置中,语言 添加 简体中文 并置顶,

并在格式中选择 中国 (五星红旗) zh_CN.UTF-8

安装显卡驱动

查看显卡驱动

lspci -k | grep -A 2 -E "(VGA|3D)"
lspci | grep VGA
lspci | grep NVIDIA

安装intel核显驱动

pacman -S mesa lib32-mesa vulkan-intel lib32-vulkan-intel
# xf86-video-intel 不用装

安装nvidia独显驱动(MX350)

去NVIDIA官网下载 64位linux版驱动,下载之后 添加权限后直接运行。

https://www.nvidia.cn/Download/index.aspx?lang=cn

https://www.nvidia.cn/geforce/drivers/

下载好的驱动

安装过程中遇到的问题

1.使用x11模式 登陆

You appear to be running an X server; please exit X before installing.  For further details, please see the section INSTALLING THE NVIDIA DRIVER in the README available on the Linux driver download page at www.nvidia.com.

查看当前是什么模式
echo $XDG_SESSION_TYPE

2.找不到内核5.17.9-arch1-1的内核头,安装 linux-headers

Your kernel headers for kernel 5.17.9-arch1-1 cannot be found at /usr/lib/modules/5.17.9-arch1-1/build or /usr/lib/modules/5.17.9-arch1-1/source.
Pleasr install the linux-headers-5.17.9-arch1-1 package or use the --kernelsourcedir option to tell DKMS where it's located.

3.内核自带的显卡驱动 Nouveau 和 nvidia驱动 不兼容,要禁用 或 卸载 nouveau

The Nouveau kernel driver is currently in use by your system.  This driver is incompatible with the NVIDIA driver, and must be disabled before proceeding.  Please consult the NVIDIA driver README and your Linux distribution's documentation for details on how to correctly disable the Nouveau kernel driver.

这里直接 下一步 会提示 是否禁用 点yes

For some distributions, Nouveau can be disabled by adding a file in the modprobe configuration directory.  Would you like nvidia-installer to attempt to create this modprobe file for you?

点yes

One or more modprobe configuration files to disable Nouveau have been written.  For some distributions, this may be sufficient to disable Nouveau; other distributions may require modification of the initial ramdisk.  Please reboot your system and attempt NVIDIA driver installation again.  Note if you later wish to re-enable Nouveau, you will need to delete these files: /usr/lib/modprobe.d/nvidia-installer-disable-nouveau.conf, /etc/modprobe.d/nvidia-installer-disable-nouveau.conf

然后重启系统,重新运行NVIDIA显卡驱动安装脚本。

安装NVIDIA的32位兼容性库?选yes

Install NVIDIA's 32-bit compatibility libraries?

是否要向DKMS注册内核模块源代码

would you like to register the kernel module source with DKMS?This will allow DKMS to automatically build a new,if you install a different kernel later.

是否要向DKMS注册内核模块源代码?如果以后安装不同的内核,这将允许DKMS自动构建新内核。

报错日志

Installation has failed.  Please see the file '/var/log/nvidia-installer.log' for details.  You may find suggestions on fixing installation problems in the README available on the Linux driver download page at www.nvidia.com.

安装失败。请参阅文件“/var/log/nvidia安装程序”。详细信息,请登录。你可以在Linux驱动程序的自述文件中查找有关修复安装问题的建议 下载页面:www.nvidia。com。

关于显卡的其他命令

验证 NVIDIA 独立显卡是否被禁用:
lspci | grep NVIDIA #若有 rev ff 字样,则表示独显已经成功禁用。

查看N卡是否正常运作
# nvidia-smi

使用glxinfo命令可以查看当前正在使用的显卡

[zbf@zbfarch ~]$ glxinfo | grep "OpenGL renderer"
OpenGL renderer string: Mesa Intel(R) UHD Graphics (CML GT2)

网上其他安装显卡教程

。。。自己电脑装了 optimus-manager-qt 或者 optimus-manager-qt-kde 重启之后 都会卡着进不了登陆页面,只能 用 U盘 进 pe 卸载

开源驱动:
pacman -S mesa lib32-mesa xf86-video-nouveau

闭源驱动
pacman -S nvidia nvidia-prime nvidia-settings nvidia-utils opencl-nvidia lib32-nvidia-utils lib32-opencl-nvidia

安装双显卡切换工具
通过该程序可以在核芯显卡和独立显卡间轻松切换。
optimus-manager 提供三种模式 —— 分别为仅用独显、仅用核显以及 hybrid 动态切换模式。

安装optimus-manager

安装图形化切换工具
yay -S optimus-manager-qt

安装完成以后控制台直接说输入optimus-manager-qt启动,此时kde右下角会出现intel图标。

安装完成以后应该已经可以进行显卡切换了,在导航栏的intel图标上右键切换要使用的显卡类型,切换后需要注销并重新登录才会生效。

服务自启动
systemctl enable optimus-manager.service
systemctl start optimus-manager.service

也可以在终端使用命令切换显卡
# 切换为英伟达显卡
optimus-manager --switch nvidia
# 切换为intel核显
optimus-manager --switch intel

解决屏幕撕裂
在内核选项中添加参数
# sudo vim /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="nvidia-drm.modeset=1"
编辑/etc/mkinitcpio.conf

MODULES=(nouveau nvidia nvidia_modeset nvidia_uvm nvidia_drm)
运行下面mkinit命令
# sudo mkinitcpio -p linux

安装蓝牙驱动

https://blog.csdn.net/qq_36390239/article/details/123118489

pacman -S bluez bluez-utils

pacman -S pulseaudio-bluetooth #安装蓝牙音频

systemctl start bluetooth.service #启动蓝牙服务

Bluetoothctl 通过该命令控制蓝牙

图形化界面不用装

安装其他软件

图片查看器  gthumb

截图工具  flameshot

视频播放器 vlc , smplayer

网易云音乐 netease-cloud-music

安装wps    wps-office-cn , wps-office-mui-zh-cn ,ttf-wps-fonts,ttf-ms-fonts

wps-office-cn 的可选依赖
    cups: for printing support
    libjpeg-turbo: JPEG image codec support [已安装]
    pango: for complex (right-to-left) text support [已安装]
    curl: An URL retrieval utility and library [已安装]
    ttf-wps-fonts: Symbol fonts required by wps-office [已安装]
    ttf-ms-fonts: Microsft Fonts recommended for wps-office
    wps-office-fonts: FZ TTF fonts provided by wps community
    wps-office-mime-cn: Use mime files provided by Kingsoft
    wps-office-mui-zh-cn: zh_CN support for WPS Office [已安装]

浏览器 chromium

防火墙 firewalld

ntfs-3g

安装百度网盘 baidunetdisk-electron (baidunetdisk-bin闪退,使用deb安装包转换 成 .pkg.tar.zst 包 安装也闪退 )

选择 electron9-bin

vm16forlinux ZF3R0-FHED2-M80TY-8QYGC-NPKYF

分区工具 文件管理器 右下角 选择安装分区工具

应用商店中安装 edge vscode idea 迅雷

应用商店discover未找到应用程序后端解决办法

[root@archlinux zbf]# pacman -S archlinux-appstream-data packagekit-qt5 flatpak fwupd

安装neofetch

使用习惯修改

美化

开机登陆界面

欢迎界面