AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-53782

zabumba's questions

Martin Hope
zabumba
Asked: 2022-06-22 15:45:38 +0800 CST

如何在 CentOS Stream 上升级和设置默认内核

  • 1

这是 vCenter 上的虚拟机 (vmware)

当前内核3.10.0-862.el7.x86_64

[root@stage ~]# uname -a
Linux stage.dsr.FILTERED.net 3.10.0-862.el7.x86_64 #1 SMP Fri Apr 20 16:44:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
[root@stage ~]# hostnamectl
   Static hostname: stage.dsr.FILTERED.net
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 4121FILTERED1663
           Boot ID: b264FILTEREDa2dc
    Virtualization: vmware
  Operating System: CentOS Stream 8
       CPE OS Name: cpe:/o:centos:centos:8
            Kernel: Linux 3.10.0-862.el7.x86_64
      Architecture: x86-64

安装最新内核

sudo dnf --enablerepo=elrepo-kernel install kernel-ml kernel-ml-devel kernel-ml-headers
[root@stage ~]# sudo dnf --enablerepo=elrepo-kernel install kernel-ml kernel-ml-devel kernel-ml-headers
Last metadata expiration check: 0:36:34 ago on Tue 21 Jun 2022 23:59:55 BST.
Package kernel-ml-5.18.5-1.el8.elrepo.x86_64 is already installed.
Package kernel-ml-devel-5.18.5-1.el8.elrepo.x86_64 is already installed.
Package kernel-ml-headers-5.18.5-1.el8.elrepo.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

检查可用的图像/boot

[root@stage boot]# ls -al
total 91212
dr-xr-xr-x.  6 root root      272 Jun 22 00:06 .
dr-xr-xr-x. 17 root root      224 Jun 22 00:01 ..
drwxr-xr-x.  3 root root       17 Aug 30  2018 efi
drwxr-xr-x.  2 root root        6 Jun 22 00:07 grub
drwx------.  5 root root      156 Jun 21 23:48 grub2
-rw-------.  1 root root 55388571 Aug 30  2018 initramfs-0-rescue-4121a368f8744621872224e7593f1663.img
-rw-------.  1 root root 12508372 Jun  7 18:44 initramfs-3.10.0-862.el7.x86_64kdump.img
-rw-------.  1 root root 19272908 Jun 22 00:06 initramfs-5.18.5-1.el8.elrepo.x86_64.img
drwxr-xr-x.  3 root root       21 Jun 21 23:48 loader
-rwxr-xr-x.  1 root root  6224704 Aug 30  2018 vmlinuz-0-rescue-4121a368f8744621872224e7593f1663

列出默认内核

[root@stage boot]# grubby --default-kernel
/boot/vmlinuz-0-rescue-4121a368f8744621872224e7593f1663

列出可用的

[root@stage boot]# ls -l /boot/vmlinuz-*
-rwxr-xr-x. 1 root root 6224704 Aug 30  2018 /boot/vmlinuz-0-rescue-4121a368f8744621872224e7593f1663

只有一个条目!

列出 RPM 内核包

[root@stage boot]# rpm -qa | grep kernel
kernel-ml-devel-5.18.5-1.el8.elrepo.x86_64
kernel-ml-headers-5.18.5-1.el8.elrepo.x86_64
kernel-ml-modules-5.18.5-1.el8.elrepo.x86_64
kernel-ml-5.18.5-1.el8.elrepo.x86_64
kernel-ml-core-5.18.5-1.el8.elrepo.x86_64

如何安装并设置5.18.5-1.el8.elrepo.x86_64为新的默认内核?

任何指针都是最受欢迎的

更新 20220622

[root@stage ~]# dracut --force
dracut: Cannot find module directory /lib/modules/3.10.0-862.el7.x86_64/
dracut: and --no-kernel was not specified

也试过

dracut --kver 5.18.5-1.el8.elrepo.x86_64 --force
dracut --regenerate-all --force

vmlinuz-但我的/boot文件夹中仍然只有一个

[root@stage boot]# ls -al
drwxr-xr-x.  3 root root       17 Aug 30  2018 efi
drwxr-xr-x.  2 root root        6 Jun 22 00:07 grub
drwx------.  5 root root      156 Jun 22 16:44 grub2
-rw-------.  1 root root 55388571 Aug 30  2018 initramfs-0-rescue-4121a368f8744621872224e7593f1663.img
-rw-------.  1 root root 12508372 Jun  7 18:44 initramfs-3.10.0-862.el7.x86_64kdump.img
-rw-------.  1 root root 19457348 Jun 22 17:32 initramfs-5.18.5-1.el8.elrepo.x86_64.img
drwxr-xr-x.  3 root root       21 Jun 21 23:48 loader
-rwxr-xr-x.  1 root root  6224704 Aug 30  2018 vmlinuz-0-rescue-4121a368f8744621872224e7593f1663
centos vmware
  • 2 个回答
  • 274 Views
Martin Hope
zabumba
Asked: 2018-01-18 14:41:13 +0800 CST

如何在我信任的 docker 容器上安装缺少的 /lib/modules/$(uname -r)

  • 6

在 Mac 上运行docker

docker pull ubuntu:14.04
docker run -i -t ubuntu:14.04 /bin/bash

Linux 标准库

root@d112db1e835e:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.5 LTS
Release:    14.04
Codename:   trusty

我的目标是淘汰用于构建一些好的旧 C 代码的专用笔记本电脑,并改用 docker 容器。

为了编译我的代码,我Makefile正在寻找运行

Makefile:       /usr/bin/make -C /lib/modules/$(shell uname -r)/build M=$(PWD)/linux/$* modules

不幸的是modules文件夹是空的

mysuer@d112db1e835e:~/robot$ ls -al /lib/modules/
ls: cannot access /lib/modules/: No such file or directory

在我的 linux 机器上,我可以找到模块

$ ls -al /lib/modules/
total 28
drwxr-xr-x  7 root root 4096 Dez 13  2016 .
drwxr-xr-x 24 root root 4096 Apr 24  2017 ..
drwxr-xr-x  5 root root 4096 Dez 13  2016 3.13.0-105-generic
drwxr-xr-x  5 root root 4096 Jun 23  2015 3.13.0-55-generic
drwxr-xr-x  5 root root 4096 Jul 10  2015 3.13.0-57-generic
drwxr-xr-x  5 root root 4096 Nov  3  2015 3.13.0-65-generic
drwxr-xr-x  5 root root 4096 Nov 24  2015 3.13.0-68-generic

但我的 docker 中没有模块。

在我的码头上

uname -r
4.9.60-linuxkit-aufs

因此

/usr/bin/make -C /lib/modules/4.9.60-linuxkit-aufs/build .... FAILS

/lib/modules/4.9.60-linuxkit-aufs不在这里。

我该如何解决这个问题?

尝试安装标头

apt-cache search linux-headers-4
linux-headers-4.2.0-18 - Header files related to Linux kernel version 4.2.0
linux-headers-4.2.0-18-generic - Linux kernel headers for version 4.2.0 on 64 bit x86 SMP
linux-headers-4.2.0-18-lowlatency - Linux kernel headers for version 4.2.0 on 64 bit x86 SMP
linux-headers-4.2.0-19 - Header files related to Linux kernel version 4.2.0
linux-headers-4.2.0-19-generic - Linux kernel headers for version 4.2.0 on 64 bit x86 SMP
linux-headers-4.2.0-19-lowlatency - Linux kernel headers for version 4.2.0 on 64 bit x86 SMP
linux-headers-4.2.0-21 - Header files related to Linux kernel version 4.2.0
linux-headers-4.2.0-21-generic - Linux kernel headers for version 4.2.0 on 64 bit x86 SMP
linux-headers-4.2.0-21-lowlatency - Linux kernel headers for version 4.2.0 on 64 bit x86 SMP
linux-headers-4.2.0-22 - Header files related to Linux kernel version 4.2.0
...

我找不到 4.9.60 的标题

root@d112db1e835e:~#  apt-get install linux-headers-$(uname -r)
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package linux-headers-4.9.60-linuxkit-aufs
E: Couldn't find any package by regex 'linux-headers-4.9.60-linuxkit-aufs'

或者

root@d112db1e835e:~# apt-cache search linux-headers-4.9
root@d112db1e835e:~# 

没有候选人

root@d112db1e835e:~# apt-get install linux-headers 
Reading package lists... Done
Building dependency tree        
Reading state information... Done
Package linux-headers is a virtual package provided by:
  linux-headers-4.4.0-1010-aws 4.4.0-1010.10
  linux-headers-4.4.0-1009-aws 4.4.0-1009.9
... FILTERED ...
  linux-headers-3.13.0-100-lowlatency 3.13.0-100.147
  linux-headers-3.13.0-100-generic 3.13.0-100.147
You should explicitly select one to install.

E: Package 'linux-headers' has no installation candidate
root@d112db1e835e:~# 

不返回任何包裹

root@d112db1e835e:~# apt-cache search linux-source     
linux-source - Linux kernel source with Ubuntu patches
linux-source-3.13.0 - Linux kernel source for version 3.13.0 with Ubuntu patches
ubuntu docker
  • 1 个回答
  • 13045 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve