Skip to content

Instantly share code, notes, and snippets.

@alexandreelise
Last active October 25, 2024 00:12
Show Gist options
  • Save alexandreelise/192a63e287018ddfc896bbcb70b219d4 to your computer and use it in GitHub Desktop.
Save alexandreelise/192a63e287018ddfc896bbcb70b219d4 to your computer and use it in GitHub Desktop.
Install gcc 9 on Ubuntu LTS 12.04,14.04,16.04 and 18.04
#!/usr/bin/env sh
sudo apt-get update -y && \
sudo apt-get upgrade -y && \
sudo apt-get dist-upgrade -y && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
sudo apt-get update -y && \
sudo apt-get install gcc-9 g++-9 -y && \
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9 && \
sudo update-alternatives --config gcc
select gcc-9
@Marietto2008
Copy link

Marietto2008 commented Jun 16, 2023

I've learnt docker several years ago. Yeah,it's a nice tool. I can say for sure that after docker you will learn how to use the jails for FreeBSD. This has been my recent goal. Anyway,soon I will try to follow your docker tutorial and I will keep you updated because I know that you will learn something more from what will happen. (and me too).

@alexandreelise
Copy link
Author

Thanks for your feedback @Marietto2008 . Will be happy to learn more about networks, blue team defensive security (not so much offensive because too many people already do that and it is not my "taste". I prefer defensive security. Learning how to protect a system rather than "attack" it. I know one cannot exists without the other side of the coin, but again, my focus is on defensive cyber security. jails system might be something to consider will have a look when I get a chance to.

@Marietto2008
Copy link

Marietto2008 commented Jun 17, 2023 via email

@Pomax
Copy link

Pomax commented Oct 25, 2024

Trying this today on an "ancient" EC2 instance running ubuntu 16.04.7 (kernel 4.4.0-generic) I get:

install-gcc-9.sh: 13: install-gcc-9.sh : select: not found

@alexandreelise
Copy link
Author

Hi @Pomax,

Trying this today on an "ancient" EC2 instance running ubuntu 16.04.7 (kernel 4.4.0-generic) I get:

install-gcc-9.sh: 13: install-gcc-9.sh : select: not found

My original gist is posted on my old GitHub account https://gist.github.com/application2000/73fd6f4bf1be6600a2cf9f56315a2d91 there you will find many contributors that might have stumble upon the same issue for your use case. Unfortunately I cannot help you more than this at the moment. Have a great day and a nice weekend. Take care.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment