ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

安装CentOS Stream8 最小安装并且编译内核有感

2022-08-30 01:01:31  阅读:185  来源: 互联网

标签:dnf CentOS sudo 内核 install 安装 Stream8


今天在清华源上下载CentOS Stream8镜像后,在Windows10系统上安装的VirtualBox内最小安装。具体的安装流程选择的是最小安装。大体安装流程可查看这个链接。因为对于CentOS的自己觉得并不需要图形化界面,因为安装很多依赖包其实也挺占硬盘的。但是终于解开了内心的一个疑惑:就是安装软件包的时候软件安装源(Installation Source)路径下载的具体地址(这里以清华源为例):https:// mirrors.tuna.tsinghua.edu.cn/centos/8-stream/BaseOS/x86_64/os。很长一段时间内我都曾经以为GNU+Linux会继承UNIX的KISS(keep it simple and stupid)的精神,没想到Systemd的出现让幻想破灭。最终在高性能台式机上编译了两个小时,最终成功安装了Linux 5.19.3内核。

具体流程如下:1.安装好系统之后以root权限登录,因为我是自己设置了Roger用户的,所以自己改了/etc/sudores文件内容(以root用户)

        root  ALL(ALL)   ALL

        roger  ALL(ALL)   ALL

       2.之后修改CentOS Stream8的仓库文件在/etc/yum.repos.d文件夹下。

        具体的情况可以就是将/etc/yum.repos.d/CentOS-Stream-BaseOS.repo修改为如下所示     

# CentOS-Stream-BaseOS.repo
#
# The mirrorlist system uses the connecting IP address of the client and the
# update status of each mirror to pick current mirrors that are geographically
# close to the client.  You should use this for CentOS updates unless you are
# manually picking other mirrors.
#
# If the mirrorlist does not work for you, you can try the commented out
# baseurl line instead.

[baseos]
name=CentOS Stream $releasever - BaseOS
#mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo=BaseOS&infra=$infra
baseurl=https://mirrors.ustc.edu.cn/centos/$stream/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

 具体链接

之后的命令我就直接敲在下面了。

sudo yum clean all

sudo yum makecache

// 请确保以下命令都是在联网环境下运行

ping -c https://mirrors.ustc.edu.cn

// 安装neofetch,就是为了好玩

sudo dnf install epel-release -y

sudo dnf install neofetch -y

// 需要正式安装编译内核环境了

sudo dnf install gcc -y

sudo dnf install make -y

// 下载网络文件下载工具

sudo dnf install wget -y

// 将内核从中科大源上下载下来

wget https://mirrors.ustc.edu.cn/kernel.org/linux/kernel/v5.x/linux-5.19.3.tar.xz

// 安装解压的包

sudo dnf install tar -y

// 解压内核

tar xvf linux-5.19.3.tar.xz

// 进入解压好的文件夹

cd linux-5.19.3

// 开始进行编译前期配置工作的准备

// 安装好环境

sudo dnf install ncurses-devel -y

sudo dnf install flex -y

sudo dnf install bison -y

// 这个命令是用来统计程序运行时间的

sudo dnf install time -y

// 开始编译配置文件

sudo make menuconfig

编译内核过程之中,有很多模块,不知道怎么选就右键Exit

//开始安装编译内核环境

sudo dnf install openssl-devel -y

sudo dnf install bc -y

sudo dnf install elfutils-libelf-devel -y

sudo dnf install python3 -y

// 安装好vim编辑器(在下使用Vim习惯了,vi实在用着不顺手)

sudo dnf install vim -y

vim .config(config左边有个点别忘了)

// 这两部非常重要,最好是设置一下,不然到时候可能会出问题。

置CONFIG_SYSTEM_TRUSTED_KEY=""

置CONFIG_DEBUG_INFO_BTF=n

// 最后开始编译

sudo time make

// 安装编译生成的模块

sudo time make modules_install

// 最后安装

sudo time make install

// 若果你喜欢,可以重启查看是否安装成功

sudo shutdown -r now

// 查看当前内核版本号

uname -r

附上视频链接: https://www.bilibili.com/video/BV1bV411C7x2

今天编译的内核最后还是出现了一些问题

SELinux : CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE is non-zero.

This is deprecated and will be rejected in a future kernel release.

SELinux : https://github.com/SELinuxProject/selinux-kernel/wiki/DEPRECATE-checkreqport

RETBleed: WARNIING: Spectre V2 mitigation leaves CPU vulnerable to RETBleed attacks, data leaks possible!

drm : vmw_host_printf [vmwgfx]*ERROR* Failed to send host long message.

最新的内核版本不一定是最好的。

联系方式:sunsan2021@163.com

标签:dnf,CentOS,sudo,内核,install,安装,Stream8
来源: https://www.cnblogs.com/rainbowsea26/p/16637929.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有