0

When I am trying to upgrade Latest generic kernel for 18.04 because I was having issues with Ubuntu freezing while I am doing my development works, when lot of tabs open etc. So i found a solution in stackoverflow requesting to update generic kernal, so I did this by sudo apt install — install-recommends linux-generic-hwe-18.04 xserver-xorg-hwe-18.04 mentioned here

I got the following error how to solve this

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package —
E: Unable to locate package install-recommends
3
  • 1
    You have extra spaces in your command as I read it, and thus told it to install "install-recommends" for which there is no package, thus error is correct. When 3rd party blogs make errors, you need to correct for that yourself, or stick to official Ubuntu blogs which have been tested/reviewed by someone else in the team.
    – guiverc
    Feb 20, 2020 at 8:01
  • can you post the correct code then Feb 20, 2020 at 10:19
  • Why don't you copy it from where you found it? Sry, it is wrong there too :-)) wiki.ubuntu.com/Kernel/LTSEnablementStack
    – Pilot6
    Feb 20, 2020 at 12:34

2 Answers 2

2

You have extra spaces in your command as I read it, and thus told it to install "install-recommends" for which there is no package, thus error is correct.

When 3rd party blogs make errors, you need to correct for that yourself, or stick to official Ubuntu blogs which have been tested/reviewed by someone else in the team.

The '--' is the GNU way of writing the option, and the 'install-recommends' is the option and connected to the '--', ie. the space between them shouldn't be there.

The --install-recommends will install the packages for Xorg (https://packages.ubuntu.com/bionic/linux-generic-hwe-18.04, https://packages.ubuntu.com/bionic-updates/xserver-xorg-hwe-18.04)

I haven't provided the command by choice; as the command refers to HWE (hardware enablement kernel) and not GA (general availability) kernel I tend to think of as generic (or what originally ships). You'll also note official documentation has different commands for desktop & server, the OPs unofficial post ignores (thus it would be poor for Ubuntu 18.04 Servers)

The official documentation is https://wiki.ubuntu.com/Kernel/LTSEnablementStack

2
  • Apart from extra whitespace, it seems OP is using dash () before install-recommends instead of double hyphens(--)
    – Kulfy
    Feb 20, 2020 at 10:41
  • I didn't notice that; just it looked wrong and saw the to me obvious space, but you're right @Kulfy
    – guiverc
    Feb 20, 2020 at 10:44
1

The correct command is

sudo apt-get install --install-recommends linux-generic-hwe-18.04 xserver-xorg-hwe-18.04

You must log in to answer this question.

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