DEV Community

nullity
nullity

Posted on • Edited on

3

Install or uninstall gcc 13 on Ubuntu 20.04

Testing date: Mar 14, 2024

Install gcc-13, g++-13

sudo apt update
sudo apt install software-properties-common

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install gcc-13 g++-13
Enter fullscreen mode Exit fullscreen mode

Add gcc-13 to gcc's alternatives

並設定 "切換 gcc 版本時會同時切換 g++, gcov 的版本"
At the time, the latest gcc provided by this ppa is 13.1

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 131 --slave /usr/bin/g++ g++ /usr/bin/g++-13 --slave /usr/bin/gcov gcov /usr/bin/gcov-13
Enter fullscreen mode Exit fullscreen mode

若之前沒有設定過 priority 大於 131 的 gcc 版本,則此時的 gcc 版本會自動切換至 gcc-13

Check gcc's version

At the time, the latest gcc provided by this ppa is 13.1

gcc -v
Enter fullscreen mode Exit fullscreen mode

Uninstall gcc 13

sudo update-alternatives --remove gcc /usr/bin/gcc-13
sudo apt purge gcc-13 g++-13
Enter fullscreen mode Exit fullscreen mode

ref

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more