1

I had tried to install java in my system by following the instructions in the page: Java Installation Instr Oracle

Now, when I typed java -version, it gave me the following messages:

 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>

Realizing that I may not have configured the path var correctly, I added the following lines to /etc/environment:

JAVA_HOME="/usr/Java/jre1.8.0_161"
export JAVA_HOME

Now, the content of the /etc/environment file has become:

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" export JAVA_HOME

Despite changing the above file, it still showed me The program 'java' can be found in the following packages: error.

Hence, I decided to use

sudo apt-get purge openjdk-\*

And I got the following messages:

    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.

Now I decided to go ahead and use:

sudo apt autoremove  openjdk-\*

For which I got the following result:

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

Could you please tell me what exactly has happened after sudo apt-autoremove. Has it messed up with any of the boot partitions or reconfigured something differently that might cause trouble? I have a dual booted system (Windows and Ubuntu). I am a complete noob in linux and had blindly followed some links online to freshly install java.

Simple, Clear answers will be much apprecitated.

3
  • Do not use export in the /etc/environment file. It is not a shell script. The syntax is key=value, nothing else, except for comments.
    – PerlDuck
    Apr 11, 2018 at 14:26
  • Okay. Thank you. Should I type the export command in the terminal? Or should i add it somewhere else? Apr 11, 2018 at 14:28
  • you can use export if you are setting it in .bash_profile or .profile etc.. something like stackoverflow.com/a/18972665/4826457
    – Suraj Rao
    Apr 11, 2018 at 14:36

1 Answer 1

2

Despite changing the above file, it still showed me The program 'java' can be found in the following packages: error.

You forgot to add your Oracle JAVA bin folder to your $PATH variable.

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"

Set the above path in /etc/environment

Secondly,

Could you please tell me what exactly has happened after sudo apt-autoremove. Has it messed up with any of the boot partitions or reconfigured something differently that might cause trouble?

The command

sudo apt autoremove

also detects old linux kernel versions which are no longer necessary and deletes those as well.

Currently, you have two versions of the kernel images after the command has run:

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

It does not look like it messed up your partition.

For more : Is it safe to use the command apt-get autoremove in this particular scenario?

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .