October 05, 2021

set default gcc, cpp, clang versions in Debian 11, Debian 12 Linux

edit: updated this for Debian 12 / gcc 12, but essentially same solution(s).
see also: https://apt.llvm.org/

Problem: cpp-10 is default in Debian 11

Need: cpp-9 or gcc-9 as default

Solution:


sudo apt install build-essential cpp-12 cpp-11 cpp-10 cpp-9 gcc-12 gcc-11 gcc-10 gcc-9 

sudo update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-9 10
sudo update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-10 20
sudo update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-11 30
sudo update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-12 40

update-alternatives --query cpp
sudo update-alternatives --config cpp

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 20
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 30
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 40

update-alternatives --query gcc
sudo update-alternatives --config gcc

Resource: https://stackoverflow.com/questions/7832892/how-to-change-the-default-gcc-compiler-in-ubuntu

Potential problems:
If you get something like update-alternatives: error: cannot stat file '/usr/bin/cpp': Too many levels of symbolic links, then sudo rm /etc/alternatives/cpp. BUT be sure to reinstall cpp-* to get the /user/bin links recreated.




And you may do similarly with Clang/Clang++

sudo apt install clang-14 clang-13 clang-12 clang-11

sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-11 10
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-12 20
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-13 30
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-14 40

update-alternatives --query clang
sudo update-alternatives --config clang

sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-11 10
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-12 20
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-13 30
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-14 40

update-alternatives --query clang++
sudo update-alternatives --config clang++


If you prefer non-interactive config, then you may

sudo update-alternatives --set clang /usr/bin/clang-12
sudo update-alternatives --set clang++ /usr/bin/clang++-12
and do so silimarly for any other alternatives



One could compile and install newer GCC as well: https://gcc.gnu.org/install/









~~
good luck!

Written with StackEdit.

SEO:
cpp gcc 9 10 default Debian Linux Ubuntu RHEL CentOS Fedora Arch Mint


Please consider crypto tipping:
  

September 21, 2021

YouTube search sort newest first

Problem:
Youtube search sorts by relevance, whereas one often prefers sorting by newest results.

Solution:
Firefox or Chrome extension prerequisite: “Redirector” by Einar Eglisson.
Note: It required browser restart to function properly.
Settings:


example:
 https://www.youtube.com/results?search_query=test

include pattern:
 https://www.youtube.com/results?search_query=*

redirect to:
 https://www.youtube.com/results?sp=CAI%253D&search_query=$1

pattern type:
 wildcard

SEO: youtube search latest first youtube search latest on top youtube search newest first youtube search newest on top youtube search by date youtube search by upload date

Written with StackEdit.


Please consider crypto tipping:
  

August 10, 2021

Xubuntu XFCE Display brightness Fn keys not working not changing brightness

 Problem:

Fn Brightness not changing backlight on XFCE.


Tentative Solution:
Power Manager>General>Handle display brightness keys>Enable.



SEO:
XFCE XFCE4 backlight brightness Fn function key not working failing does nothing does not change brightness

Please consider crypto tipping: