我在 linux mint 上更新了 gcc,但是当我检查时它似乎没有安装。问题是什么?
joseph@joseph:~$ sudo apt install gcc-9
Reading package lists... Done
Building dependency tree
Reading state information... Done
gcc-9 is already the newest version (9.2.1-17ubuntu1~18.04.1).
The following packages were automatically installed and are no longer required:
codeblocks-common libcodeblocks0 libwxbase3.0-0v5 libwxgtk3.0-0v5
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 240 not upgraded.
joseph@joseph:~$ gcc --version
gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
答案1
基于 Debian 的发行版可以拥有同一软件的多个版本。
检查/usr/bin/gcc
。您将看到,它是 的符号链接/etc/alternatives/gcc
,这是 的符号链接/usr/bin/gcc-7
。
该命令update-alternatives --config gcc
将为您提供选择正确版本的选项。
如果删除 gcc-7,它会自动选择另一个替代方案。