Hanjie's Blog

一只有理想的羊驼

在/home/目录下建立文件.Xmodmap文件,填入:

1
2
3
4
5
6
remove Mod4 = Super_L
remove Control = Control_L
keysym Control_L = Super_L
keysym Super_L = Control_L
add Mod4 = Super_L
add Control = Control_L

如果想将左ctrl和左alt交换位置,则为:

1
2
3
4
5
6
remove mod1 = Alt_L 
remove control = Control_L
keysym Control_L = Alt_L
keysym Alt_L = Control_L
add mod1 = Alt_L
add control = Control_L

然后在Startup Applications Preferences中添加项目,指令填

1
/usr/bin/xmodmap /home/.Xmodmap

备份:

1
2
3
4
5
6
7
sudo apt-get autoclean
sudo apt-get clean
sudo apt-get autoremove

su - root

tar -czvPf ubuntu_`date +%Y%m%d_%H`.tar.gz --exclude=/proc --exclude=/mnt --exclude=/media --exclude=/lost+found --exclude=/cdrom --exclude=/sys --exclude=/home/luohanjie/Documents --exclude=/run --exclude=/tmp / > /dev/null

恢复:

1
2
su - root
tar -xzvPf ubuntu*.tar.gz -C /

Ubuntu系统默认的是gcc 4.8版本:

1
gcc -v

安装4.9, 6.2版本:

1
2
3
4
5
6
7
8
9
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.9 g++-4.9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9

sudo apt-get install gcc-6 g++-6
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 100 --slave /usr/bin/g++ g++ /usr/bin/g++-6

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8

显示和选择使用版本:

1
sudo update-alternatives --config gcc
0%