Last active
July 19, 2026 16:29
-
-
Save zuyu/7d5682a5c75282c596449758d21db5ed to your computer and use it in GitHub Desktop.
Install gcc 6 on Ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt update && \ | |
| sudo apt install build-essential software-properties-common -y && \ | |
| sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \ | |
| sudo apt update && \ | |
| sudo apt install gcc-6 g++-6 -y && \ | |
| sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6 && \ | |
| gcc -v |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you SOOOOO much! This is just what I needed. Before I found this I was considering installing Fedora in Docker. Thank goodness I was spared that chore.
Note: on 26.04 (Resolute), you need to replace '6' with '16' and the procedure works perfectly.