我曾尝试按照页面中的说明在我的系统中安装 Java:Java 安装指南 Oracle
现在,当我输入 java -version 时,它会显示以下消息:
The program 'java' can be found in the following packages:
* default-jre
* gcj-5-jre-headless
* openjdk-8-jre-headless
* gcj-4.8-jre-headless
* gcj-4.9-jre-headless
* openjdk-9-jre-headless
Try: sudo apt install <selected package>
意识到我可能没有正确配置路径变量,因此我在 /etc/environment 中添加了以下几行:
JAVA_HOME="/usr/Java/jre1.8.0_161"
export JAVA_HOME
现在,/etc/environment文件的内容变成了:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" JAVA_HOME="/usr/Java/jre1.8.0_161" 导出 JAVA_HOME
尽管更改了上述文件,它仍然显示The program 'java' can be found in the following packages:
错误。
因此,我决定使用
sudo apt-get purge openjdk-\*
我收到了以下消息:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'openjdk-9-jre-headless' for glob 'openjdk-*'
Note, selecting 'openjdk-8-jdk' for glob 'openjdk-*'
Note, selecting 'openjdk-8-jre' for glob 'openjdk-*'
Note, selecting 'openjdk-6-jdk' for glob 'openjdk-*'
Note, selecting 'openjdk-6-jre' for glob 'openjdk-*'
Note, selecting 'openjdk-9-demo' for glob 'openjdk-*'
Note, selecting 'openjdk-6-jre-headless' for glob 'openjdk-*'
Note, selecting 'openjdk-8-demo' for glob 'openjdk-*'
Note, selecting 'openjdk-8-jre-dcevm' for glob 'openjdk-*'
Note, selecting 'openjdk-8-jdk-headless' for glob 'openjdk-*'
Note, selecting 'openjdk-9-dbg' for glob 'openjdk-*'
Note, selecting 'openjdk-7-jre-headless' for glob 'openjdk-*'
Note, selecting 'openjdk-9-doc' for glob 'openjdk-*'
Note, selecting 'openjdk-8-jre-zero' for glob 'openjdk-*'
Note, selecting 'openjdk-8-source' for glob 'openjdk-*'
Note, selecting 'openjdk-jre' for glob 'openjdk-*'
Note, selecting 'openjdk-9-jdk' for glob 'openjdk-*'
Note, selecting 'openjdk-9-jre' for glob 'openjdk-*'
Note, selecting 'openjdk-7-jdk' for glob 'openjdk-*'
Note, selecting 'openjdk-7-jre' for glob 'openjdk-*'
Note, selecting 'openjdk-9-jdk-headless' for glob 'openjdk-*'
Note, selecting 'openjdk-8-jre-headless' for glob 'openjdk-*'
Note, selecting 'openjdk-9-source' for glob 'openjdk-*'
Note, selecting 'openjdk-8-jre-jamvm' for glob 'openjdk-*'
Note, selecting 'openjdk-8-dbg' for glob 'openjdk-*'
Note, selecting 'openjdk-8-doc' for glob 'openjdk-*'
Package 'openjdk-6-jdk' is not installed, so not removed
Package 'openjdk-7-jre-headless' is not installed, so not removed
Package 'openjdk-6-jre-headless' is not installed, so not removed
Package 'openjdk-7-jre' is not installed, so not removed
Package 'openjdk-6-jre' is not installed, so not removed
Package 'openjdk-7-jdk' is not installed, so not removed
Package 'openjdk-jre' is not installed, so not removed
Package 'openjdk-8-jre-dcevm' is not installed, so not removed
Package 'openjdk-9-dbg' is not installed, so not removed
Package 'openjdk-9-demo' is not installed, so not removed
Package 'openjdk-9-doc' is not installed, so not removed
Package 'openjdk-9-jdk' is not installed, so not removed
Package 'openjdk-9-jdk-headless' is not installed, so not removed
Package 'openjdk-9-jre' is not installed, so not removed
Package 'openjdk-9-jre-headless' is not installed, so not removed
Package 'openjdk-9-source' is not installed, so not removed
Package 'openjdk-8-dbg' is not installed, so not removed
Package 'openjdk-8-demo' is not installed, so not removed
Package 'openjdk-8-doc' is not installed, so not removed
Package 'openjdk-8-jdk' is not installed, so not removed
Package 'openjdk-8-jdk-headless' is not installed, so not removed
Package 'openjdk-8-jre' is not installed, so not removed
Package 'openjdk-8-jre-headless' is not installed, so not removed
Package 'openjdk-8-jre-jamvm' is not installed, so not removed
Package 'openjdk-8-source' is not installed, so not removed
Package 'openjdk-8-jre-zero' is not installed, so not removed
The following packages were automatically installed and are no longer required:
linux-headers-4.10.0-28 linux-headers-4.10.0-28-generic
linux-headers-4.13.0-31 linux-headers-4.13.0-31-generic
linux-headers-4.13.0-32 linux-headers-4.13.0-32-generic
linux-headers-4.13.0-36 linux-headers-4.13.0-36-generic
linux-image-4.10.0-28-generic linux-image-4.13.0-31-generic
linux-image-4.13.0-32-generic linux-image-4.13.0-36-generic
linux-image-extra-4.10.0-28-generic linux-image-extra-4.13.0-31-generic
linux-image-extra-4.13.0-32-generic linux-image-extra-4.13.0-36-generic
linux-signed-image-4.10.0-28-generic linux-signed-image-4.13.0-31-generic
linux-signed-image-4.13.0-32-generic linux-signed-image-4.13.0-36-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 144 not upgraded.
现在我决定继续使用:
sudo apt autoremove openjdk-\*
我得到了以下结果:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'openjdk-9-jre-headless' for glob 'openjdk-*'
Note, selecting 'openjdk-8-jdk' for glob 'openjdk-*'
Note, selecting 'openjdk-8-jre' for glob 'openjdk-*'
Note, selecting 'openjdk-6-jdk' for glob 'openjdk-*'
Note, selecting 'openjdk-6-jre' for glob 'openjdk-*'
Note, selecting 'openjdk-9-demo' for glob 'openjdk-*'
Note, selecting 'openjdk-6-jre-headless' for glob 'openjdk-*'
Note, selecting 'openjdk-8-demo' for glob 'openjdk-*'
Note, selecting 'openjdk-8-jre-dcevm' for glob 'openjdk-*'
Note, selecting 'openjdk-8-jdk-headless' for glob 'openjdk-*'
Note, selecting 'openjdk-9-dbg' for glob 'openjdk-*'
Note, selecting 'openjdk-7-jre-headless' for glob 'openjdk-*'
Note, selecting 'openjdk-9-doc' for glob 'openjdk-*'
Note, selecting 'openjdk-8-jre-zero' for glob 'openjdk-*'
Note, selecting 'openjdk-8-source' for glob 'openjdk-*'
Note, selecting 'openjdk-jre' for glob 'openjdk-*'
Note, selecting 'openjdk-9-jdk' for glob 'openjdk-*'
Note, selecting 'openjdk-9-jre' for glob 'openjdk-*'
Note, selecting 'openjdk-7-jdk' for glob 'openjdk-*'
Note, selecting 'openjdk-7-jre' for glob 'openjdk-*'
Note, selecting 'openjdk-9-jdk-headless' for glob 'openjdk-*'
Note, selecting 'openjdk-8-jre-headless' for glob 'openjdk-*'
Note, selecting 'openjdk-9-source' for glob 'openjdk-*'
Note, selecting 'openjdk-8-jre-jamvm' for glob 'openjdk-*'
Note, selecting 'openjdk-8-dbg' for glob 'openjdk-*'
Note, selecting 'openjdk-8-doc' for glob 'openjdk-*'
Package 'openjdk-6-jdk' is not installed, so not removed
Package 'openjdk-7-jre-headless' is not installed, so not removed
Package 'openjdk-6-jre-headless' is not installed, so not removed
Package 'openjdk-7-jre' is not installed, so not removed
Package 'openjdk-6-jre' is not installed, so not removed
Package 'openjdk-7-jdk' is not installed, so not removed
Package 'openjdk-jre' is not installed, so not removed
Package 'openjdk-8-jre-dcevm' is not installed, so not removed
Package 'openjdk-9-dbg' is not installed, so not removed
Package 'openjdk-9-demo' is not installed, so not removed
Package 'openjdk-9-doc' is not installed, so not removed
Package 'openjdk-9-jdk' is not installed, so not removed
Package 'openjdk-9-jdk-headless' is not installed, so not removed
Package 'openjdk-9-jre' is not installed, so not removed
Package 'openjdk-9-jre-headless' is not installed, so not removed
Package 'openjdk-9-source' is not installed, so not removed
Package 'openjdk-8-dbg' is not installed, so not removed
Package 'openjdk-8-demo' is not installed, so not removed
Package 'openjdk-8-doc' is not installed, so not removed
Package 'openjdk-8-jdk' is not installed, so not removed
Package 'openjdk-8-jdk-headless' is not installed, so not removed
Package 'openjdk-8-jre' is not installed, so not removed
Package 'openjdk-8-jre-headless' is not installed, so not removed
Package 'openjdk-8-jre-jamvm' is not installed, so not removed
Package 'openjdk-8-source' is not installed, so not removed
Package 'openjdk-8-jre-zero' is not installed, so not removed
The following packages will be REMOVED:
linux-headers-4.10.0-28 linux-headers-4.10.0-28-generic
linux-headers-4.13.0-31 linux-headers-4.13.0-31-generic
linux-headers-4.13.0-32 linux-headers-4.13.0-32-generic
linux-headers-4.13.0-36 linux-headers-4.13.0-36-generic
linux-image-4.10.0-28-generic linux-image-4.13.0-31-generic
linux-image-4.13.0-32-generic linux-image-4.13.0-36-generic
linux-image-extra-4.10.0-28-generic linux-image-extra-4.13.0-31-generic
linux-image-extra-4.13.0-32-generic linux-image-extra-4.13.0-36-generic
linux-signed-image-4.10.0-28-generic linux-signed-image-4.13.0-31-generic
linux-signed-image-4.13.0-32-generic linux-signed-image-4.13.0-36-generic
0 upgraded, 0 newly installed, 20 to remove and 144 not upgraded.
After this operation, 1,269 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 364130 files and directories currently installed.)
Removing linux-headers-4.10.0-28-generic (4.10.0-28.32~16.04.2) ...
Removing linux-headers-4.10.0-28 (4.10.0-28.32~16.04.2) ...
Removing linux-headers-4.13.0-31-generic (4.13.0-31.34~16.04.1) ...
Removing linux-headers-4.13.0-31 (4.13.0-31.34~16.04.1) ...
Removing linux-headers-4.13.0-32-generic (4.13.0-32.35~16.04.1) ...
Removing linux-headers-4.13.0-32 (4.13.0-32.35~16.04.1) ...
Removing linux-headers-4.13.0-36-generic (4.13.0-36.40~16.04.1) ...
Removing linux-headers-4.13.0-36 (4.13.0-36.40~16.04.1) ...
Removing linux-signed-image-4.10.0-28-generic (4.10.0-28.32~16.04.2) ...
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.13.0-38-generic
Found initrd image: /boot/initrd.img-4.13.0-38-generic
Found linux image: /boot/vmlinuz-4.13.0-37-generic
Found initrd image: /boot/initrd.img-4.13.0-37-generic
Found linux image: /boot/vmlinuz-4.13.0-36-generic
Found initrd image: /boot/initrd.img-4.13.0-36-generic
Found linux image: /boot/vmlinuz-4.13.0-32-generic
Found initrd image: /boot/initrd.img-4.13.0-32-generic
Found linux image: /boot/vmlinuz-4.13.0-31-generic
Found initrd image: /boot/initrd.img-4.13.0-31-generic
Found linux image: /boot/vmlinuz-4.10.0-28-generic
Found initrd image: /boot/initrd.img-4.10.0-28-generic
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
done
Removing linux-image-extra-4.10.0-28-generic (4.10.0-28.32~16.04.2) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.10.0-28-generic /boot/vmlinuz-4.10.0-28-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.10.0-28-generic /boot/vmlinuz-4.10.0-28-generic
update-initramfs: Generating /boot/initrd.img-4.10.0-28-generic
Adding /lib/firmware/i915/kbl_dmc_ver1_01.bin
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.10.0-28-generic /boot/vmlinuz-4.10.0-28-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.10.0-28-generic /boot/vmlinuz-4.10.0-28-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.10.0-28-generic /boot/vmlinuz-4.10.0-28-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.10.0-28-generic /boot/vmlinuz-4.10.0-28-generic
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.13.0-38-generic
Found initrd image: /boot/initrd.img-4.13.0-38-generic
Found linux image: /boot/vmlinuz-4.13.0-37-generic
Found initrd image: /boot/initrd.img-4.13.0-37-generic
Found linux image: /boot/vmlinuz-4.13.0-36-generic
Found initrd image: /boot/initrd.img-4.13.0-36-generic
Found linux image: /boot/vmlinuz-4.13.0-32-generic
Found initrd image: /boot/initrd.img-4.13.0-32-generic
Found linux image: /boot/vmlinuz-4.13.0-31-generic
Found initrd image: /boot/initrd.img-4.13.0-31-generic
Found linux image: /boot/vmlinuz-4.10.0-28-generic
Found initrd image: /boot/initrd.img-4.10.0-28-generic
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
done
Removing linux-image-4.10.0-28-generic (4.10.0-28.32~16.04.2) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.10.0-28-generic /boot/vmlinuz-4.10.0-28-generic
update-initramfs: Deleting /boot/initrd.img-4.10.0-28-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.10.0-28-generic /boot/vmlinuz-4.10.0-28-generic
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.13.0-38-generic
Found initrd image: /boot/initrd.img-4.13.0-38-generic
Found linux image: /boot/vmlinuz-4.13.0-37-generic
Found initrd image: /boot/initrd.img-4.13.0-37-generic
Found linux image: /boot/vmlinuz-4.13.0-36-generic
Found initrd image: /boot/initrd.img-4.13.0-36-generic
Found linux image: /boot/vmlinuz-4.13.0-32-generic
Found initrd image: /boot/initrd.img-4.13.0-32-generic
Found linux image: /boot/vmlinuz-4.13.0-31-generic
Found initrd image: /boot/initrd.img-4.13.0-31-generic
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
done
Removing linux-signed-image-4.13.0-31-generic (4.13.0-31.34~16.04.1) ...
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.13.0-38-generic
Found initrd image: /boot/initrd.img-4.13.0-38-generic
Found linux image: /boot/vmlinuz-4.13.0-37-generic
Found initrd image: /boot/initrd.img-4.13.0-37-generic
Found linux image: /boot/vmlinuz-4.13.0-36-generic
Found initrd image: /boot/initrd.img-4.13.0-36-generic
Found linux image: /boot/vmlinuz-4.13.0-32-generic
Found initrd image: /boot/initrd.img-4.13.0-32-generic
Found linux image: /boot/vmlinuz-4.13.0-31-generic
Found initrd image: /boot/initrd.img-4.13.0-31-generic
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
done
Removing linux-image-extra-4.13.0-31-generic (4.13.0-31.34~16.04.1) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.13.0-31-generic /boot/vmlinuz-4.13.0-31-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.13.0-31-generic /boot/vmlinuz-4.13.0-31-generic
update-initramfs: Generating /boot/initrd.img-4.13.0-31-generic
Adding /lib/firmware/i915/kbl_dmc_ver1_01.bin
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.13.0-31-generic /boot/vmlinuz-4.13.0-31-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.13.0-31-generic /boot/vmlinuz-4.13.0-31-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.13.0-31-generic /boot/vmlinuz-4.13.0-31-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.13.0-31-generic /boot/vmlinuz-4.13.0-31-generic
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.13.0-38-generic
Found initrd image: /boot/initrd.img-4.13.0-38-generic
Found linux image: /boot/vmlinuz-4.13.0-37-generic
Found initrd image: /boot/initrd.img-4.13.0-37-generic
Found linux image: /boot/vmlinuz-4.13.0-36-generic
Found initrd image: /boot/initrd.img-4.13.0-36-generic
Found linux image: /boot/vmlinuz-4.13.0-32-generic
Found initrd image: /boot/initrd.img-4.13.0-32-generic
Found linux image: /boot/vmlinuz-4.13.0-31-generic
Found initrd image: /boot/initrd.img-4.13.0-31-generic
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
done
Removing linux-image-4.13.0-31-generic (4.13.0-31.34~16.04.1) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.13.0-31-generic /boot/vmlinuz-4.13.0-31-generic
update-initramfs: Deleting /boot/initrd.img-4.13.0-31-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.13.0-31-generic /boot/vmlinuz-4.13.0-31-generic
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.13.0-38-generic
Found initrd image: /boot/initrd.img-4.13.0-38-generic
Found linux image: /boot/vmlinuz-4.13.0-37-generic
Found initrd image: /boot/initrd.img-4.13.0-37-generic
Found linux image: /boot/vmlinuz-4.13.0-36-generic
Found initrd image: /boot/initrd.img-4.13.0-36-generic
Found linux image: /boot/vmlinuz-4.13.0-32-generic
Found initrd image: /boot/initrd.img-4.13.0-32-generic
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
done
Removing linux-signed-image-4.13.0-32-generic (4.13.0-32.35~16.04.1) ...
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.13.0-38-generic
Found initrd image: /boot/initrd.img-4.13.0-38-generic
Found linux image: /boot/vmlinuz-4.13.0-37-generic
Found initrd image: /boot/initrd.img-4.13.0-37-generic
Found linux image: /boot/vmlinuz-4.13.0-36-generic
Found initrd image: /boot/initrd.img-4.13.0-36-generic
Found linux image: /boot/vmlinuz-4.13.0-32-generic
Found initrd image: /boot/initrd.img-4.13.0-32-generic
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
done
Removing linux-image-extra-4.13.0-32-generic (4.13.0-32.35~16.04.1) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.13.0-32-generic /boot/vmlinuz-4.13.0-32-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.13.0-32-generic /boot/vmlinuz-4.13.0-32-generic
update-initramfs: Generating /boot/initrd.img-4.13.0-32-generic
Adding /lib/firmware/i915/kbl_dmc_ver1_01.bin
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.13.0-32-generic /boot/vmlinuz-4.13.0-32-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.13.0-32-generic /boot/vmlinuz-4.13.0-32-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.13.0-32-generic /boot/vmlinuz-4.13.0-32-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.13.0-32-generic /boot/vmlinuz-4.13.0-32-generic
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.13.0-38-generic
Found initrd image: /boot/initrd.img-4.13.0-38-generic
Found linux image: /boot/vmlinuz-4.13.0-37-generic
Found initrd image: /boot/initrd.img-4.13.0-37-generic
Found linux image: /boot/vmlinuz-4.13.0-36-generic
Found initrd image: /boot/initrd.img-4.13.0-36-generic
Found linux image: /boot/vmlinuz-4.13.0-32-generic
Found initrd image: /boot/initrd.img-4.13.0-32-generic
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
done
Removing linux-image-4.13.0-32-generic (4.13.0-32.35~16.04.1) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.13.0-32-generic /boot/vmlinuz-4.13.0-32-generic
update-initramfs: Deleting /boot/initrd.img-4.13.0-32-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.13.0-32-generic /boot/vmlinuz-4.13.0-32-generic
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.13.0-38-generic
Found initrd image: /boot/initrd.img-4.13.0-38-generic
Found linux image: /boot/vmlinuz-4.13.0-37-generic
Found initrd image: /boot/initrd.img-4.13.0-37-generic
Found linux image: /boot/vmlinuz-4.13.0-36-generic
Found initrd image: /boot/initrd.img-4.13.0-36-generic
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
done
Removing linux-signed-image-4.13.0-36-generic (4.13.0-36.40~16.04.1) ...
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.13.0-38-generic
Found initrd image: /boot/initrd.img-4.13.0-38-generic
Found linux image: /boot/vmlinuz-4.13.0-37-generic
Found initrd image: /boot/initrd.img-4.13.0-37-generic
Found linux image: /boot/vmlinuz-4.13.0-36-generic
Found initrd image: /boot/initrd.img-4.13.0-36-generic
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
done
Removing linux-image-extra-4.13.0-36-generic (4.13.0-36.40~16.04.1) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.13.0-36-generic /boot/vmlinuz-4.13.0-36-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.13.0-36-generic /boot/vmlinuz-4.13.0-36-generic
update-initramfs: Generating /boot/initrd.img-4.13.0-36-generic
Adding /lib/firmware/i915/kbl_dmc_ver1_01.bin
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.13.0-36-generic /boot/vmlinuz-4.13.0-36-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.13.0-36-generic /boot/vmlinuz-4.13.0-36-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.13.0-36-generic /boot/vmlinuz-4.13.0-36-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.13.0-36-generic /boot/vmlinuz-4.13.0-36-generic
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.13.0-38-generic
Found initrd image: /boot/initrd.img-4.13.0-38-generic
Found linux image: /boot/vmlinuz-4.13.0-37-generic
Found initrd image: /boot/initrd.img-4.13.0-37-generic
Found linux image: /boot/vmlinuz-4.13.0-36-generic
Found initrd image: /boot/initrd.img-4.13.0-36-generic
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
done
Removing linux-image-4.13.0-36-generic (4.13.0-36.40~16.04.1) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.13.0-36-generic /boot/vmlinuz-4.13.0-36-generic
update-initramfs: Deleting /boot/initrd.img-4.13.0-36-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.13.0-36-generic /boot/vmlinuz-4.13.0-36-generic
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.13.0-38-generic
Found initrd image: /boot/initrd.img-4.13.0-38-generic
Found linux image: /boot/vmlinuz-4.13.0-37-generic
Found initrd image: /boot/initrd.img-4.13.0-37-generic
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
done
你能告诉我 sudo apt-autoremove 之后到底发生了什么吗?它是否弄乱了任何启动分区或重新配置了可能导致问题的不同的东西?我有一个双启动系统(Windows 和 Ubuntu)。我是 Linux 方面的菜鸟,盲目地按照网上的一些链接重新安装了 Java。
简单、清晰的答案将不胜感激。
答案1
尽管更改了上述文件,它仍然向我显示了可以在以下包中找到程序“java”:错误。
您忘记将 Oracle JAVA bin 文件夹添加到 $PATH 变量中。
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/Java/jre1.8.0_161/bin"
设置上述路径/etc/environment
第二,
您能告诉我 sudo apt-autoremove 之后到底发生了什么吗?它是否弄乱了任何启动分区或重新配置了可能导致麻烦的其他东西?
命令
sudo apt autoremove
还可以检测不再需要的旧 Linux 内核版本并将其删除。
目前,运行该命令后,您将拥有两个版本的内核映像:
Found linux image: /boot/vmlinuz-4.13.0-38-generic
Found initrd image: /boot/initrd.img-4.13.0-38-generic
Found linux image: /boot/vmlinuz-4.13.0-37-generic
Found initrd image: /boot/initrd.img-4.13.0-37-generic
看起来它并没有弄乱你的分区。