ubuntu 更新 gcc、 g++:
命令:
1 2 3 4
| sudo apt install build-essential manpages-dev software-properties-common sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo add-apt-repository 'deb http://mirrors.kernel.org/ubuntu hirsute main universe' sudo apt update && sudo apt install gcc-11 g++-11
|
多版本管理:
1 2 3 4
| sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 50 --slave /usr/bin/g++ g++ /usr/bin/g++-11
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 10 --slave /usr/bin/g++ g++ /usr/bin/g++-9
|
设置默认gcc版本:
1
| sudo update-alternatives --config gcc
|
更新gdb-11
1 2 3 4 5 6 7
| sudo apt-get update sudo apt-get upgrade sudo apt-get install libgmp-dev wget http://ftp.gnu.org/gnu/gdb/gdb-11.1.tar.gz tar -xvzf gdb-11.1.tar.gz ./configure sudo make && sudo make install
|
可能要安装textinfo
替换老版本,新生成的gdb二进制文件会在编译目录gdb-10.2/gdb/gdb ,将其拷贝到/usr/bin/,替换原来的,也可以将原来的做个备份,以防出问题:
1 2
| mv /usr/local/bin/gdb /usr/local/bin/gdb_bak cp ~/gdb-11.1/gdb/gdb /usr/local/bin/
|
其他
mysql 8 修改密码
1
| ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456'
|