Thursday, May 16, 2024
 Popular · Latest · Hot · Upcoming
7
rated 0 times [  7] [ 0]  / answers: 1 / hits: 1888  / 1 Year ago, fri, february 17, 2023, 1:22:59

I'm using Ubuntu 18.04 LTS, when I try to install g++-10:


sudo apt install g++-10

it installs clang-10, but I don't need clang-10, I strictly need a g++-10


More From » 18.04

 Answers
4

The issue here is that the default Ubuntu 18.04 repositories don't contain g++-10 (but do contain clang-10)


On 18.04, if apt fails to match an exact package name, it expands the name as a regular expression1. In this context, the + character means "one or more of the preceding character" so g++-10 matches clang-10 (it's just coincidental that they're both compilers).


If you want gcc-10 / g++-10 on 18.04 you can do so by adding the toolchain-r PPA to your repositories:


sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt install g++-10

See also





Notes:



  1. it no longer does that - see for example Problem using wildcard with apt


[#1525] Saturday, February 18, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rstride

Total Points: 305
Total Questions: 112
Total Answers: 118

Location: Mali
Member since Sat, Dec 26, 2020
3 Years ago
;