Ubuntu 16.10 优化

OpenAI ChatGPT3.5
Pre-generated by ChatGPT 3.5
这篇文章介绍了对Ubuntu 16.10进行优化的操作。包括更换阿里云软件源、更新系统、安装vim和Guake、进行系统设置、安装输入法、删除Libreoffice和Amazon、解决显示错误、调整Unity显示位置和图标最小化等操作。同时还介绍了安装优化工具、禁用房客Guest、禁用ipv6、设置鼠标加速度和自动挂载硬盘的方法。还推荐了安装openssh-server、Shadownsocks Qt5、状态栏指示器和其他软件的步骤。最后还提及了主题图标推荐和一些其他的操作提示。

阿里云:http://mirrors.aliyun.com
系统设置 - 软件和更新 - 下载自 - 选择下载服务器 - 中国 - mirrors.aliyun.com 选择
或者直接编辑:

1
2
sudo mv /etc/apt/sources.list/etc/apt/sources.list.bak #备份系统默认的软件源
sudo vim /etc/apt/sources.list

添加:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
deb http://mirrors.aliyun.com/ubuntu/yakkety main restricted
deb http://mirrors.aliyun.com/ubuntu/yakkety-updates main restricted
deb http://mirrors.aliyun.com/ubuntu/yakkety universe
deb http://mirrors.aliyun.com/ubuntu/yakkety-updates universe
deb http://mirrors.aliyun.com/ubuntu/yakkety multiverse
deb http://mirrors.aliyun.com/ubuntu/yakkety-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/yakkety-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/yakkety-security main restricted
deb http://mirrors.aliyun.com/ubuntu/yakkety-security universe
deb http://mirrors.aliyun.com/ubuntu/yakkety-security multiverse
1
2
sudo apt update
sudo apt upgrade
1
sudo apt install vim

Guake 是一个比较酷的终端,除了可以用来装 B,其实也挺实用的。

1
sudo apt install guake

系统设置 里进行一些必要的设置,如:壁纸、电源、显示、亮度、隐私

我用的是 fcitx 的五笔拼音

1
sudo apt install fcitx-table-wbpy

如果需要搜狗拼音:

1
sudo vim /etc/apt/sources.list.d/ubuntukylin.list

加入 ubuntu kylin 的 apt 源:

1
deb http://archive.ubuntukylin.com:10006/ubuntukylin trusty main  

安装搜狗拼音:

1
2
sudo apt update  
sudo apt install sogoupinyin 

直接下载 deb 安装包:http://pinyin.sogou.com/linux/

如果有需求,可以安装 WPS,从官网下载 deb 包即可

1
sudo apt remove libreoffice-common  
1
sudo apt remove unity-webapps-common  

时间和日期 设置里,选择年份和星期同时显示,月份则会出现 “月月” 两个月字。
解决方法:
1)、不要选择显示星期或者年份
2)、手动设置显示格式:

1
2
gsettings set com.canonical.indicator.datetime time-format 'custom'
gsettings set com.canonical.indicator.datetime custom-time-format '% Y 年 % m 月 % d 日 % A% H:% M:% S'

下方显示:

1
gsettings set com.canonical.Unity.Launcher launcher-position Bottom

左方显示:

1
gsettings set com.canonical.Unity.Launcher launcher-position Left
1
gsettings set org.compiz.unityshell:/org/compiz/profiles/unity/plugins/unityshell/launcher-minimize-window true

Tweak tool 有两个,一个是 unity-tweak-tool,一个是 gnome-tweak-tool
安装 unity-tweak-tool 后,Amazon 图标会回来,我选择的是安装 gnome-tweak-tool

1
sudo apt install gnome-tweak-tool

编辑:

1
sudo vim /usr/share/lightdm/lightdm.conf.d/50-guest-wrapper.conf

把里面的内容修改为:

1
2
3
[Seat:*]
#guest-wrapper=/usr/lib/lightdm/lightdm-guest-session
allow-guest=false

1)、先查看你的网卡信息,并非所有网卡都叫 eth0

1
ifconfig

记录下网卡名字,比如我的,有 enp4s0f2lowlp9s0b1 三个
2)、编辑文件:

1
sudo vim /etc/sysctl.conf

在末尾添加:

1
2
3
4
5
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.`lo`.disable_ipv6 = 1 #需跟网卡信息对应
net.ipv6.conf.`enp4s0f2`.disable_ipv6 = 1 #需跟网卡信息对应
net.ipv6.conf.`wlp9s0b1`.disable_ipv6 = 1 #需跟网卡信息对应

3)、重启生效:

1
sudo sysctl -p

注:鼠标加速度鼠标速度 是两个不同的概念
1)、命令:

1
xset m 0 0

或者把它写入开机启动。
2)、我现在用的是另外一个方法,在 Ubuntu 软件 里搜索 Mouse,结果中选择 Keyboard and Mouse 安装,用这个 GUI 设置。这个方法更简便,重启或休眠后也不会失效。

我一共有 3 块硬盘,除了系统盘,还有 2 块数据盘,因工作娱乐原因,需要自动挂载。
1)、查看硬盘的 UUID 和 Type

1
sudo blkid

结果会显示:

1
2
/dev/sda2: ...
/dev/sdb5: LABEL="files" UUID="a1eaf999-b7dc-41e2-9314-5f4dec421db5" TYPE="ext4"

记录下 UUID 和 Type。
2)、我会选择挂载到 Home 的 Files 文件夹下
新建一个 Files 文件夹

1
2
3
cd ~
sudo mkdir Files
sudo chown -R eallion:eallion Files

3)、编辑文件:

1
sudo vim /etc/fstab

按格式添加:

1
UUID=a1eaf999-b7dc-41e2-9314-5f4dec421db5    /home/eallion/Files    ext4    defaults    0    0
1
sudo apt install openssh-server

配置 Google Authenticator:(非必须,可选)

1
sudo apt install libpam-google-authenticator

启动:

1
google-authenticator

修改配置:

1
sudo vim /etc/pam.d/sshd

添加:

1
auth required pam_google_authenticator.so

修改:

1
sudo vim /etc/ssh/sshd_config

no 改为 yes

1
2
ChallengeResponseAuthentication yes
Port 22222 #修改 SSH 端口
1
2
3
sudo add-apt-repository ppa:hzwhuang/ss-qt5
sudo apt update
sudo apt install shadowsocks-qt5

启动 Shadowsocks Qt5 的命令:

1
ss-qt5

我用的是:indicator-sysmonitor,Ubuntu 16.04 / 16.10 确认可用。

1
2
3
sudo add-apt-repository ppa:fossfreedom/indicator-sysmonitor
sudo apt update
sudo apt install indicator-sysmonitor
1
2
cd ~
sudo apt install git curl zsh
1
sh -c "$(curl -fsSL https://raw.GitHubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

修改一下配置:

1
sudo vim .zshrc
1
2
3
4
5
...
ZSH_THEME="ys" #主题
...
plugins=(git sudo cp fasd ...) #插件
...
1
sudo apt install virtualbox

也可以从官网下载最新版

如果喜欢 Chromium,可以从软件中心安装
但是我更喜欢 Chrome,到 https://chrome.google.com 可以下载最新版。

安装 deb 软件包时,可以用 GDebi 替换 Ubuntu 软件中心。

1
sudo apt install gdebi

可以直接在 Chrome app 里安装微信应用;

也可以安装 geeeeeeeeek 提供的微信,这实质上跟 Chrome 应用是一回事。
https://github.com/geeeeeeeeek/electronic-wechat
前提是已经安装 gitNode.jsnpm

1
2
3
git clone https://github.com/geeeeeeeeek/electronic-wechat.git
cd electronic-wechat
npm install && npm start

也可直接下载一个 release 版本:electronic-wechat

1
sudo vim /usr/share/indicator-application/ordering-override.keyfile

修改:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
[Ordering Index Overrides]
nm-applet=1 #系统图标
gnome-power-manager=2 #电池图标
ibus=3 #ibus 输入法
gst-keyboard-xkb=4 
gsd-keyboard-xkb=5
netease-cloud-music=6 #网易云音乐
electronic-wechat1=7 #微信
Shadowsocks-Qt5=8 #SS
fcitx-qimpanel=9 #fcitx 输入法
Nylas N11=10 #N1 邮件客户端
chrome_app_indicator_3=11 #Chrome 图标
indicator-sysmonitor=20 #网速指示器

具体参考:https://eallion.com/ubuntu-system-icon

提高电池的寿命并且减少过热

1
2
3
4
sudo add-apt-repository ppa:linrunner/tlp
sudo apt update
sudo apt install tlp tlp-rdw
sudo tlp start

Numix:https://numixproject.org
通过 PPA 安装:

1
2
3
4
sudo add-apt-repository ppa:numix/ppa
sudo apt update
sudo apt install numix-gtk-theme
sudo apt install numix-icon-theme-circle

安装好之后,通过 Tweak tool 设置。