kk Blog —— 通用基础


date [-d @int|str] [+%s|"+%F %T"]
netstat -ltunp
sar -n DEV 1

Centos8安装PHP8

https://zhuanlan.zhihu.com/p/615971837

1
2
3
4
5
6
7
$ sudo dnf install -y epel-release
$ sudo dnf install -y  http://rpms.remirepo.net/enterprise/remi-release-8.5.rpm  # remi-release-8.rpm 要求更高版本centos
$ sudo dnf install -y dnf-utils
$ sudo dnf module list php
$ sudo dnf module reset php
$ sudo dnf module install -y php:remi-8.0
yum install php php-xml php-zip php-mbstring php-gd php-devel php-mysqlnd

sudo dnf install -y php-fpm

systemctl status php-fpm

systemctl restart php-fpm

CentOS8 编译内核错误

https://koji.mbox.centos.org/koji/buildinfo?buildID=20542

https://zhuanlan.zhihu.com/p/535853460

1. fatal error: openssl/opensslv.h: No such file or directory

fatal error: openssl/bio.h: No such file or directory

1
A:缺少包,直接yum -y install openssl-devel即可(apt-get install libssl-dev)

2. 其余类似的报错,缺少文件可依次安装:

1
A:yum -y install flex, bison, openssl-devel, elfutils-libelf-devel

3.

1
2
3
4
5
6
7
8
make[1]: *** No rule to make target 'certs/rhel.pem', needed by 'certs/x509_certificate_list'. Stop.
make: *** [Makefile:1729: certs] Error 2

A: => 打开 .config,注释掉这两行

CONFIG_MODULE_SIG_KEY=""

CONFIG_SYSTEM_TRUSTED_KEYS=""

4.

1
2
3
4
5
6
7
BTF: .tmp_vmlinux.btf: pahole (pahole) is not available

Failed to generate BTF for vmlinux
Try to disable CONFIG_DEBUG_INFO_BTF
make: *** [Makefile:1113: vmlinux] Error 1

A: => 修改CONFIG_DEBUG_INFO_BTF=n

CentOS8.5 安装

dracut-initqueue timeout错误

USB3.0 的U盘可能识别不了,可能需要USB2.0的U盘

dracut-initqueue timeout错误

1
2
3
dracut:/# ls -l /dev/disk/by-label/

lrwxrwxrwx 1 root root 11 May 24 14:25 CentOS-8-5- -> ../../sdd4

重启,按e,修改启动参数

将 hd:LABEL=CentOS-8-5-2111-x86_64-dvd 改成上面显示的 hd:LABEL=CentOS-8-5-

installation source

需要将ISO放到另一个U盘或者硬盘,可以将硬盘尾部格出一块来放

efi

可能需要efi模式,但efi模式好像没法用grub2-install。

目前用另一块盘的centos7 : grub2-mkconfig -o /boot/grub2/grub.cfg 来启动centos8


https://www.cnblogs.com/shaoyishi/p/17270213.html

yum

1
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist
  1. 首先,进入到 yum 的 repos 目录
1
cd /etc/yum.repos.d/
  1. 其次,修改 centos 文件内容
1
2
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
  1. 然后,生成缓存更新
1
yum makecache