LLVM-14, Unable to correct problems, you have held broken packages - on Ubuntu-18

Greetings,
I have installed llvm-14 following this website after adding it to the repository on ubuntu-20. After fetching the key, the following code simply installed llvm-14 on ununtu-20 machine,

sudo apt udpate
sudo apt install llvm-14 clang-14

but on ubuntu-18, following the same steps, I got this,

ubuntu-18@ubuntu18-VirtualBox:~$ sudo apt install clang-14 llvm-14
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 clang-14 : Depends: libclang-cpp14 (>= 1:14.0.6~++20220622053019+f28c006a5895) but it is not going to be installed
            Depends: libgcc-s1 (>= 3.0) but it is not installable
            Depends: libllvm14 but it is not going to be installed
            Depends: libstdc++6 (>= 11) but 8.4.0-1ubuntu1~18.04 is to be installed
            Depends: libclang-common-14-dev (= 1:14.0.6~++20220622053019+f28c006a5895-1~exp1~20220622173056.159) but it is not going to be installed
            Depends: llvm-14-linker-tools (= 1:14.0.6~++20220622053019+f28c006a5895-1~exp1~20220622173056.159) but it is not going to be installed
            Depends: libclang1-14 (= 1:14.0.6~++20220622053019+f28c006a5895-1~exp1~20220622173056.159) but it is not going to be installed
            Recommends: llvm-14-dev but it is not going to be installed
 llvm-14 : Depends: llvm-14-runtime (= 1:14.0.6~++20220622053019+f28c006a5895-1~exp1~20220622173056.159) but it is not going to be installed
           Depends: llvm-14-linker-tools (= 1:14.0.6~++20220622053019+f28c006a5895-1~exp1~20220622173056.159) but it is not going to be installed
           Depends: libgcc-s1 (>= 3.3) but it is not installable
           Depends: libllvm14 but it is not going to be installed
           Depends: libstdc++6 (>= 11) but 8.4.0-1ubuntu1~18.04 is to be installed
           Recommends: llvm-14-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Then run this,

ubuntu-18@ubuntu18-VirtualBox:~$ sudo apt install clang-14 llvm-14 llvm-14-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 clang-14 : Depends: libclang-cpp14 (>= 1:14.0.6~++20220622053019+f28c006a5895) but it is not going to be installed
            Depends: libgcc-s1 (>= 3.0) but it is not installable
            Depends: libllvm14 but it is not going to be installed
            Depends: libstdc++6 (>= 11) but 8.4.0-1ubuntu1~18.04 is to be installed
            Depends: libclang-common-14-dev (= 1:14.0.6~++20220622053019+f28c006a5895-1~exp1~20220622173056.159) but it is not going to be installed
            Depends: llvm-14-linker-tools (= 1:14.0.6~++20220622053019+f28c006a5895-1~exp1~20220622173056.159) but it is not going to be installed
            Depends: libclang1-14 (= 1:14.0.6~++20220622053019+f28c006a5895-1~exp1~20220622173056.159) but it is not going to be installed
 llvm-14 : Depends: llvm-14-runtime (= 1:14.0.6~++20220622053019+f28c006a5895-1~exp1~20220622173056.159) but it is not going to be installed
           Depends: llvm-14-linker-tools (= 1:14.0.6~++20220622053019+f28c006a5895-1~exp1~20220622173056.159) but it is not going to be installed
           Depends: libgcc-s1 (>= 3.3) but it is not installable
           Depends: libllvm14 but it is not going to be installed
           Depends: libstdc++6 (>= 11) but 8.4.0-1ubuntu1~18.04 is to be installed
 llvm-14-dev : Depends: libgcc-s1 (>= 3.0) but it is not installable
               Depends: libllvm14 (= 1:14.0.6~++20220622053019+f28c006a5895-1~exp1~20220622173056.159) but it is not going to be installed
               Depends: llvm-14-tools (= 1:14.0.6~++20220622053019+f28c006a5895-1~exp1~20220622173056.159) but it is not going to be installed
               Depends: libclang-cpp14 (= 1:14.0.6~++20220622053019+f28c006a5895-1~exp1~20220622173056.159) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

@tobiashieta @smithp35 @tstellar @rpmvig @tedwoodward, will appreciate any thoughts you have.

This is probably a question for @sylvestre

Such errors usually happen when you selected the wrong distro version

example:
using the jammy Ubuntu repo for an Ubuntu focal install

Which clearly seems to be the case here
( 8.4.0-1ubuntu1~18.04 in the log)

Many thanks @sylvestre for your reply. But I updated the repo(sources.list) just as it was written in the apt.llvm.org, like following,

deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-14 main
deb-src http://apt.llvm.org/bionic/ llvm-toolchain-bionic-14 main

Then fetch the key,

wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -

Then tried to install llvm-14 and clang-14
This is from llvm site,

I am using, ubuntu-18.04.6.
image

In my machine,
image

But some of those dependencies are previously installed on my machine like libstdc++6. I think that should not be a problem. The problem is still what you mentioned which is wrong distro but I updated the repo for ubuntu-18 not for 20, or 22.

I did you do as the doc said ?
Needs 'sudo add-apt-repository ppa:ubuntu-toolchain-r/test' for libstdc++ with C++20 support

I am very thankful to you for assisting me in solving this.