目录
使用 update-alternatives 命令更新默认版本
ubuntu 安装gcc 10
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
ok: apt install gcc-10 g++-10
apt install gcc-12 g++-12
使用 update-alternatives
命令更新默认版本
在 Debian 或 Ubuntu 系统中,update-alternatives
可以方便地管理多个版本的软件。
添加新版本
运行以下命令,将 gcc-10
和 g++-10
添加到 update-alternatives
系统中:
sudo update-alternatives --instal