Score:0

After installing c-compiler, it is not set as the default

cn flag

If I have a clean OS image (in my case created with multipass) and I want to install a c-compiler, why is it not set as default after installing?

$ sudo apt install clang-15
...
$ cc
cc: command not found

What do I need to do, so that /etc/alternatives/cc exists? Surely I am not expected to create a symlink manually?

$ update-alternatives --list cc
update-alternatives: error: no alternatives for cc

Shouldn't clang-15 show up in here?

UPDATE

$ sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-15 60
$ sudo update-alternatives --install /usr/bin/cc cc /usr/bin/clang-15 60
cc flag
Read all the answers to the question. Better set a link in your ~/bin or .local/bin than pull the rug from under a system update expecting a specific compiler.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.