我在linux上更新了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.发布于 2020-04-11 10:01:50
基于Debian的发行版可以有相同软件的多个版本。
检查一下/usr/bin/gcc。您将看到,它是指向/etc/alternatives/gcc的符号链接,也是指向/usr/bin/gcc-7的符号链接。
命令update-alternatives --config gcc将为您提供选择正确版本的选项。
如果你删除gcc-7,它将自动选择另一种选择。
https://unix.stackexchange.com/questions/579515
复制相似问题