title: How to install libstdc++6 debug symbols on Ubuntu 20.04?
body: <p>For example, take the following minimal example:</p>
  <pre class="lang-c++ prettyprint-override"><code>#include &lt;cstdio&gt;
  #include &lt;stdexcept&gt;
  
  int main(int argc, char* argv[]){
  #ifdef __GLIBCPP__
      std::printf(&quot;GLIBCPP: %d\n&quot;,__GLIBCPP__);
  #endif
  #ifdef __GLIBCXX__
      std::printf(&quot;GLIBCXX: %d\n&quot;,__GLIBCXX__);
  #endif
      throw std::runtime_error(&quot;Were are libstdc++.so.6 debug symbols?&quot;);
      return 0;
  }
  </code></pre>
  <p>When running it inside my <code>gdb</code>, it does not show the debug symbols for <code>libstdc++.so.6</code>:</p>
  <pre><code>$ g++ -o testmain test.cpp -ggdb --std=c++98 &amp;&amp; gdb ./testmain
  GNU gdb (Ubuntu 9.1-0ubuntu1) 9.1
  Copyright (C) 2020 Free Software Foundation, Inc.
  ...
  For help, type &quot;help&quot;.
  Type &quot;apropos word&quot; to search for commands related to &quot;word&quot;...
  Reading symbols from ./testmain...
  (gdb) r
  Starting program: /home/user/Downloads/testmain 
  GLIBCXX: 20200408
  terminate called after throwing an instance of 'std::runtime_error'
    what():  Were are libstdc++.so.6 debug symbols?
  </code></pre>
  <pre><code>Program received signal SIGABRT, Aborted.
  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
  50  ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
  (gdb) bt f
  #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
          set = {__val = {0, 0, 0, 0, 0, 0, 0, 0, 29295, 0, 0, 0, 0, 0, 0, 0}}
          pid = &lt;optimized out&gt;
          tid = &lt;optimized out&gt;
          ret = &lt;optimized out&gt;
  #1  0x00007ffff7be1859 in __GI_abort () at abort.c:79
          save_stage = 1
          act = {__sigaction_handler = {sa_handler = ... &lt;stderr&gt;}
          sigs = {__val = {32, 0 &lt;repeats 15 times&gt;}}
  #2  0x00007ffff7e67951 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
  No symbol table info available.
  #3  0x00007ffff7e7347c in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
  No symbol table info available.
  #4  0x00007ffff7e734e7 in std::terminate() () from /lib/x86_64-linux-gnu/libstdc++.so.6
  No symbol table info available.
  #5  0x00007ffff7e73799 in __cxa_throw () from /lib/x86_64-linux-gnu/libstdc++.so.6
  No symbol table info available.
  #6  0x000055555555524a in main (argc=1, argv=0x7fffffffdef8) at test.cpp:11
  No locals.
  (gdb) 
  </code></pre>
  <p>It just shows <code>No symbol table info available</code> for the <code>libstdc++.so.6</code> frames.</p>
  <p>How can I show the symbols for the <code>libstdc++.so.6</code>?</p>
  <p>Searching on this list <a href="https://packages.ubuntu.com/search?keywords=libstdc%2B%2B6" rel="nofollow noreferrer">https://packages.ubuntu.com/search?keywords=libstdc%2B%2B6</a>, I already tried installing the following packages, but none of them fixed the problem:</p>
  <ol>
  <li><code>libgcc-10-dev:amd64 &lt;none&gt; 10.2.0-5ubuntu1~20.0</code></li>
  <li><code>libstdc++-10-dev:amd64 &lt;none&gt; 10.2.0-5ubuntu1~20.0</code></li>
  <li><code>libstdc++6-10-dbg:amd64 &lt;none&gt; 10.2.0-5ubuntu1~20.0</code></li>
  <li><code>libc6-amd64-cross:all &lt;none&gt; 2.31-0ubuntu7cross</code></li>
  <li><code>linux-libc-dev-amd64-cross:all &lt;none&gt; 5.4.0-21.25cross</code></li>
  <li><code>libc6-dev-amd64-cross:all &lt;none&gt; 2.31-0ubuntu7cross</code></li>
  <li><code>libstdc++6-amd64-cross:all &lt;none&gt; 10.2.0-5ubuntu1~20.04cross</code></li>
  <li><code>libgcc-10-dev-amd64-cross:all &lt;none&gt; 10.2.0-5ubuntu1~20.04cross</code></li>
  <li><code>libstdc++-10-dev-amd64-cross:all &lt;none&gt; 10.2.0-5ubuntu1~20.04cross</code></li>
  <li><code>libstdc++6-10-dbg-amd64-cross:all &lt;none&gt; 10.2.0-5ubuntu1~20.04cross</code></li>
  <li><code>libx32stdc++6-10-dbg:amd64 &lt;none&gt; 10.2.0-5ubuntu1~20.0</code></li>
  </ol>
  <p>Related questions:</p>
  <ol>
  <li><a href="https://stackoverflow.com/questions/10354636/how-do-you-find-what-version-of-libstdc-library-is-installed-on-your-linux-mac">How do you find what version of libstdc++ library is installed on your linux machine?</a></li>
  <li><a href="https://stackoverflow.com/questions/5216399/usr-lib-libstdc-so-6-version-glibcxx-3-4-15-not-found">/usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.15&#39; not found</a></li>
  </ol>
  <pre><code>$ cat /etc/os-release 
  NAME=&quot;Ubuntu&quot;
  VERSION=&quot;20.04.1 LTS (Focal Fossa)&quot;
  ID=ubuntu
  ID_LIKE=debian
  PRETTY_NAME=&quot;Ubuntu 20.04.1 LTS&quot;
  VERSION_ID=&quot;20.04&quot;
  </code></pre>
  <hr />
  <h3>Update 1</h3>
  <pre><code>$ dpkg --list | grep libstdc++6
  ii  libstdc++6:amd64                              10.2.0-5ubuntu1~20.04                 amd64        GNU Standard C++ Library v3
  ii  libstdc++6-10-dbg-amd64-cross                 10.2.0-5ubuntu1~20.04cross1           all          GNU Standard C++ Library v3 (debug build) (amd64)
  ii  libstdc++6-7-dbg:amd64                        7.5.0-6ubuntu2                        amd64        GNU Standard C++ Library v3 (debug build)
  ii  libstdc++6-amd64-cross                        10.2.0-5ubuntu1~20.04cross1           all          GNU Standard C++ Library v3 (amd64)
  </code></pre>
  <h3>Update 2</h3>
  <pre><code>$ dpkg --list | grep libstdc++6
  ii  libstdc++6:amd64                              10.2.0-5ubuntu1~20.04                 amd64        GNU Standard C++ Library v3
  ii  libstdc++6-10-dbg:amd64                       10.2.0-5ubuntu1~20.04                 amd64        GNU Standard C++ Library v3 (debug build)
  ii  libstdc++6-10-dbg-amd64-cross                 10.2.0-5ubuntu1~20.04cross1           all          GNU Standard C++ Library v3 (debug build) (amd64)
  ii  libstdc++6-amd64-cross                        10.2.0-5ubuntu1~20.04cross1           all          GNU Standard C++ Library v3 (amd64)
  </code></pre>