我在 Ubuntu 22.04 上安装了 Windows 11 的双启动系统。一切都运行顺利,但是当我尝试使用推荐的脚本安装 Heroku CLI,我看到以下错误:-
curl https://cli-assets.heroku.com/install-ubuntu.sh | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1232 100 1232 0 0 8898 0 --:--:-- --:--:-- --:--:-- 8927
This script requires superuser access to install apt packages.
You will be prompted for your password by sudo.
[sudo] password for user:
+ dpkg -s apt-transport-https
+ echo deb https://cli-assets.heroku.com/apt ./
+ dpkg -s heroku-toolbelt
+ true
+ curl https://cli-assets.heroku.com/apt/release.key
+ apt-key add -
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
100 1753 100 1753 0 0 19408 0 --:--:-- --:--:-- --:--:-- 19477
OK
+ apt-get update
Hit:1 https://download.docker.com/linux/ubuntu jammy InRelease
Hit:2 https://cli-assets.heroku.com/apt ./ InRelease
Hit:3 http://in.archive.ubuntu.com/ubuntu jammy InRelease
Hit:4 https://dl.google.com/linux/chrome/deb stable InRelease
Hit:5 http://in.archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:6 http://in.archive.ubuntu.com/ubuntu jammy-backports InRelease
Hit:7 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:8 https://ppa.launchpadcontent.net/danielrichter2007/grub-customizer/ubuntu jammy InRelease
Hit:9 https://ppa.launchpadcontent.net/git-core/ppa/ubuntu jammy InRelease
Hit:10 https://ppa.launchpadcontent.net/rodsmith/refind/ubuntu jammy InRelease
Hit:11 https://ppa.launchpadcontent.net/yannubuntu/boot-repair/ubuntu jammy InRelease
Reading package lists... Done
W: https://download.docker.com/linux/ubuntu/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: https://cli-assets.heroku.com/apt/./InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
+ apt-get install -y heroku
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
linux-modules-5.15.0-25-generic : Depends: linux-image-5.15.0-25-generic but it is not going to be installed or
linux-image-unsigned-5.15.0-25-generic but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
~/code [ master ] $
sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
chromium-codecs-ffmpeg-extra cmake-data dh-elpa-helper gcc gcc-11 gstreamer1.0-vaapi icu-devtools libasan6 libatomic1 libatomic1:i386 libbrotli-dev
libbsd0:i386 libc-dev-bin libc-devtools libcc1-0 libcrypt-dev libdatrie-dev libdbus-1-dev libdeflate-dev libdpkg-perl libdrm-amdgpu1:i386
libdrm-nouveau2:i386 libdrm-radeon1:i386 libdrm2:i386 libedit2:i386 libegl-dev libegl1-mesa-dev libelf1:i386 libepoxy-dev libexpat1:i386 libffi-dev
libffi8:i386 libfile-fcntllock-perl libfribidi-dev libgcc-11-dev libgl-dev libglapi-mesa:i386 libgles-dev libgles1 libglib2.0-dev-bin
libglvnd-core-dev libglvnd-dev libglvnd0:i386 libglx-dev libgraphite2-dev libgstreamer-plugins-bad1.0-0 libharfbuzz-gobject0 libice-dev
libicu70:i386 libitm1 libjbig-dev libjsoncpp25 libllvm13:i386 liblsan0 liblzma-dev libmd0:i386 libnsl-dev libnvidia-cfg1-510 libnvidia-common-510
libnvidia-compute-510:i386 libnvidia-decode-510 libnvidia-decode-510:i386 libnvidia-egl-wayland1 libnvidia-encode-510 libnvidia-encode-510:i386
libnvidia-extra-510 libnvidia-fbc1-510 libnvidia-gl-510 libnvidia-gl-510:i386 libopengl-dev libpcre16-3 libpcre2-16-0 libpcre2-posix3 libpcre32-3
libpcrecpp0v5 libpixman-1-dev libpng-tools libpthread-stubs0-dev librhash0 libsensors5:i386 libsepol-dev libsigc++-2.0-dev libsm-dev libstdc++6:i386
libthai-dev libtiffxx5 libtirpc-dev libtsan0 libubsan1 libva-wayland2 libvulkan1:i386 libwayland-bin libwayland-client0:i386 libwayland-dev
libx11-6:i386 libx11-dev libx11-xcb1:i386 libxau-dev libxau6:i386 libxcb-dri2-0:i386 libxcb-dri3-0:i386 libxcb-glx0:i386 libxcb-present0:i386
libxcb-randr0:i386 libxcb-render0-dev libxcb-shm0:i386 libxcb-shm0-dev libxcb-sync1:i386 libxcb-xfixes0:i386 libxcb1:i386 libxcb1-dev
libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxdmcp6:i386 libxext-dev libxext6:i386 libxfixes-dev libxfixes3:i386 libxi-dev
libxinerama-dev libxkbcommon-dev libxml2:i386 libxnvctrl0 libxrandr-dev libxrender-dev libxshmfence1:i386 libxtst-dev libxxf86vm1:i386 manpages-dev
mesa-vulkan-drivers:i386 nvidia-compute-utils-510 nvidia-settings nvidia-utils-510 pango1.0-tools pkg-config rpcsvc-proto screen-resolution-extra
wayland-protocols x11proto-dev xorg-sgml-doctools xserver-xorg-video-nvidia-510 xtrans-dev
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
linux-image-unsigned-5.15.0-25-generic
Suggested packages:
fdutils linux-doc | linux-source-5.15.0 linux-tools linux-headers-5.15.0-25-generic linux-modules-extra-5.15.0-25-generic
The following packages will be REMOVED:
linux-image-5.15.0-25-generic
The following NEW packages will be installed:
linux-image-unsigned-5.15.0-25-generic
0 upgraded, 1 newly installed, 1 to remove and 1 not upgraded.
2 not fully installed or removed.
Need to get 0 B/11.2 MB of archives.
After this operation, 268 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
dpkg: linux-image-5.15.0-25-generic: dependency problems, but removing anyway as you requested:
linux-modules-5.15.0-25-generic depends on linux-image-5.15.0-25-generic | linux-image-unsigned-5.15.0-25-generic; however:
Package linux-image-5.15.0-25-generic is to be removed.
Package linux-image-unsigned-5.15.0-25-generic is not installed.
(Reading database ... 208769 files and directories currently installed.)
Removing linux-image-5.15.0-25-generic (5.15.0-25.25) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.15.0-25-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 ...
/usr/sbin/grub-probe: error: failed to get canonical path of `/boot/grub/unicode.pf2GRUB_DISABLE_OS_PROBER=false'.
No path or device is specified.
Usage: grub-probe [OPTION...] [OPTION]... [PATH|DEVICE]
Try 'grub-probe --help' or 'grub-probe --usage' for more information.
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 64
dpkg: error processing package linux-image-5.15.0-25-generic (--remove):
installed linux-image-5.15.0-25-generic package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
linux-image-5.15.0-25-generic
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
我想这里的关键错误是这样的:-
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
/usr/sbin/grub-probe: error: failed to get canonical path of `/boot/grub/unicode.pf2GRUB_DISABLE_OS_PROBER=false'.
No path or device is specified.
我发现在尝试创建 grub 配置文件时出现了一些问题。
我只是不确定如何解决这个问题,甚至不知道这个问题到底是什么。
我的双启动工作正常。我的 grub2 菜单在启动时加载,我可以从那里转到 Windows 和 Ubuntu。一切都正常。但我看到了这个。
可能出了什么问题?
答案1
/etc/default/grub
您的文件中可能缺少一个新行。
我的猜测是,该命令update-grub
正在尝试解析/etc/default/grub
文件并发现不一致的 fint 路径,因为两条单独的行合并了。
检查是否有包含以下内容的行,并在和之间/boot/grub/unicode.pf2GRUB_DISABLE_OS_PROBER=false
放置一个ENTER.pf2
GRUB_DISABLE_OS_PROBER