我在 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,它會自動選擇另一個替代方案。