Ubuntu一些装机用到的指令
修改分辨率
1 | sudo gedit /etc/default/grub |
找到以下行: 1
2
3
4# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command 'vbeinfo'
# GRUB_GFXMODE=640×480
下面添加一行: 1
GRUB_GFXMODE=1920×1080 #这里分辨率自行设置
然后保存返回终端: 1
sudo update-grub
固件刷入
1 | sudo dpkg -i linux-xxx.deb 重启 |
修改更新源
在系统设置里,清华的源速度蛮快的。
小键盘开机启动
安装numlockx: 1
sudo apt-get install numlockx
编辑: 1
sudo gedit /usr/share/lightdm/lightdm.conf.d/50-unity-greeter.conf
1
greeter-setup-script=/usr/bin/numlockx on
设置root密码并进入root
1 | sudo passwd root |
安装SSR(Python)
打开一键安装脚本,按照里面的步骤来。在ssr start
的时候会缺少chacha20的库,使用root安装即可。(提前把它指定的vi改为gedit) 1
2sudo cp ssr /usr/local/bin
sudo chmod a=rwx /usr/local/bin/ssr
安装git: 1
sudo apt-get install git
安装tsocks: 1
2sudo apt-get install tsocks
sudo gedit /etc/tsocks.conf
添加: 1
2
3server = 127.0.0.1
server_type = 5
server_port = 1080
安装libsodium获得chacha20: 1
2
3
4
5
6
7# 使用root运行
# 先cd到一个临时目录
sudo apt-get install build-essential
wget https://github.com/jedisct1/libsodium/releases/download/1.0.16/libsodium-1.0.16.tar.gz
tar xf libsodium-1.0.16.tar.gz && cd libsodium-1.0.16
./configure && make -j4 && make install
ldconfig
然后sudo ssr install
。 然后ssr config
编辑配置文件。 最后ssr start
。
运行 apt-get update 报错
错误信息: 1
2E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/cache/app-info -a -e /usr/bin/appstreamcli; then appstreamcli refresh > /dev/null; fi'
E: Sub-process returned an error code
解决方案: 1
2
3
4
5sudo pkill -KILL appstreamcli
wget -P /tmp https://launchpad.net/ubuntu/+archive/primary/+files/appstream_0.9.4-1ubuntu1_amd64.deb https://launchpad.net/ubuntu/+archive/primary/+files/libappstream3_0.9.4-1ubuntu1_amd64.deb
sudo dpkg -i /tmp/appstream_0.9.4-1ubuntu1_amd64.deb /tmp/libappstream3_0.9.4-1ubuntu1_amd64.deb
卸载Amazon等Web Apps
要卸载干净,不然装Unity Tweak Tool的时候又会回来 1
2sudo apt-get purge unity-webapps-common
sudo apt-get autoremove
安装deb软件时被替换成Amazon
1 | sudo apt-get install -f |
安装Unity Tweak Tool
1 | sudo add-apt-repository ppa:freyja-dev/unity-tweak-tool-daily |
切换Python版本
1 | sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1 |
Flatabulous主题与Numix图标
1 | sudo add-apt-repository ppa:noobslab/themes |
1 | sudo add-apt-repository ppa:numix/ppa |
Java配置
sudo gedit /etc/profile
里添加: 1
2
3
4
5export JAVA_HOME=/usr/lib/jdk/jdk1.8.0_161
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
1 | sudo update-alternatives --install /usr/bin/java java /usr/lib/jdk/jdk1.8.0_161/bin/java 300 |