• ubuntu在线直接升级


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

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

      步骤1:查找内核

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

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

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

    步骤2:升级内核

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

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

    步骤3:启动内核

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

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

    步骤4:删除无用内核

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

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

  • 相关阅读:
    企业微信+SCRM的整体营销工作要如何形成合力?
    由交通银行卡被盗42万元谈网络应用安全攻防
    Linux【搭建环境与基本指令】
    2013款别克凯越危险警告灯不亮故障诊断方案设计
    排障:记录一次NFS无法共享
    尚硅谷大数据项目《在线教育之离线数仓》笔记007
    Windows 11 如何同步文件到OneDrive ?
    CPP 获取数组元素个数的问题
    Python入门教程 | Python3 元组(tuple)
    AI人工智能外呼机器人测试项目经历
  • 原文地址:https://blog.csdn.net/weixin_45119096/article/details/132901801