当前位置: 首页 > news >正文

ubuntu在线直接升级

        前几天VMware上安装了ubuntu,当时的内核版本支持(ipguard,加密软件),后来ubuntu自动升级了linux内核,导致加入软件不支持,无法访问加密文件了。后来加密软件商更新了软件,但还是赶不上linux内核更新速度,还是不能用。

        之前我写过手动升级内核的方法,实在有些复杂,所以借助chatgpt的提示和摸索,直接命令很快就升级内核到老版本了,就是几条命令的事情。

  步骤1:查找内核

    找到想要升级的内核,命令如下

cegncn@cegncn-virtual-machine:~$ apt search linux-image | grep 6.2.0-31WARNING: apt does not have a stable CLI interface. Use with caution in scripts.linux-image-6.2.0-31-generic/jammy-updates,jammy-security,now 6.2.0-31.31~22.04.1 amd64 [installed]
linux-image-unsigned-6.2.0-31-generic/jammy-updates,jammy-security 6.2.0-31.31~22.04.1 amd64
cegncn@cegncn-virtual-machine:~$ 

    直接找到内核版本完整名字就是:linux-image-6.2.0-31-generic

步骤2:升级内核

由于我电脑内核就是从6.2.0-31升级上来的,所以本地就有,不用升级,直接就可以看到

sudo apt install linux-image-6.2.0-31-generic
[sudo] password for cegncn: 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
linux-image-6.2.0-31-generic is already the newest version (6.2.0-31.31~22.04.1).
0 upgraded, 0 newly installed, 0 to remove and 31 not upgraded.

步骤3:启动内核

        虚拟机启动后,需要进入到grub去选择启动内核,启动的时候,需要长按shift键,进入:

注意,不要选择-recovery版本。这个就类似windows的安全模式了。选择好合适的版本后,就可以直接启动了。

步骤4:删除无用内核

cegncn@cegncn-virtual-machine:~$ sudo apt remove linux-image-6.2.0-32-generic
[sudo] password for cegncn: 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:amd64-microcode intel-microcode iucode-tool linux-headers-generic-hwe-22.04thermald
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:linux-generic-hwe-22.04 linux-image-6.2.0-32-genericlinux-image-generic-hwe-22.04
0 upgraded, 0 newly installed, 3 to remove and 40 not upgraded.
After this operation, 13.9 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 244718 files and directories currently installed.)
Removing linux-generic-hwe-22.04 (6.2.0.32.32~22.04.9) ...
Removing linux-image-generic-hwe-22.04 (6.2.0.32.32~22.04.9) ...
Removing linux-image-6.2.0-32-generic (6.2.0-32.32~22.04.1) ...
I: /boot/vmlinuz.old is now a symlink to vmlinuz-6.2.0-26-generic
I: /boot/initrd.img.old is now a symlink to initrd.img-6.2.0-26-generic
I: /boot/vmlinuz is now a symlink to vmlinuz-6.2.0-31-generic
I: /boot/initrd.img is now a symlink to initrd.img-6.2.0-31-generic
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-6.2.0-32-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.2.0-31-generic
Found initrd image: /boot/initrd.img-6.2.0-31-generic
Found linux image: /boot/vmlinuz-6.2.0-26-generic
Found initrd image: /boot/initrd.img-6.2.0-26-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
done

如上,能通过命令便利实现Ubuntu内核升级,方便快捷。

http://www.lryc.cn/news/167142.html

相关文章:

  • 学习笔记:卸载nav2 navigation2导航
  • 觉非科技数据闭环系列 | BEV感知研发实践
  • 程序员情绪把控
  • 弱监督目标检测:ALWOD: Active Learning for Weakly-Supervised Object Detection
  • 驱动开发 day3
  • 许可license分析 第一章
  • Goby 漏洞发布|管家婆订货易在线商城 SelectImage.aspx 文件上传漏洞
  • Android屏幕录制
  • 实在智能牵手埃林哲,“TARS-RPA-Agent+云时通”双剑合璧共推企业数字化转型
  • 拥有这个中文版CustomGPT,你也能定制自己的AI问答机器人
  • fastadmin 基本使用配置
  • netty 线程组
  • Reactor 第十二篇 WebFlux集成PostgreSQL
  • 红队打靶:Me and My Girlfriend打靶思路详解(vulnhub)
  • Mysql高级——索引(2)
  • 【史上最硬核分享】Docker+jenkinsPipeline 运行实现 python 自动化(超详细)
  • leetcode 3. 无重复字符的最长子串
  • doccano 文本标注工具使用
  • 快速排序算法的递归和非递归
  • Maven无法拉取SNAPSHOT依赖的解决办法
  • day16-面向对象综合练习(上)
  • 在Windos 10专业版搭建Fyne(Go 跨平台GUI)开发环境
  • 漫谈:C、C++字符串的困局
  • 基于python+selenium的自动批量添加
  • gdb监视
  • STM32基础知识点总结
  • Python vs C#:首先学习哪种编程语言最好?
  • 代理IP和Socks5代理:跨界电商与全球爬虫的关键技术
  • CentOS 7 调优之周期性的访问中断
  • SpringBoot表现层数据一致性