NotePublic/Software/OperatingSystem/Linux/Ubuntu/Ubuntu_初始配置.md

104 lines
3.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Ubuntu 初始配置
## 使用清华源
Ubuntu 的软件源配置文件是 /etc/apt/sources.list。将系统自带的该文件做个备份将该文件替换为清华的软件源配置文件即可使用 TUNA 的软件源镜像。
适用于 Ubuntu 18.04 LTS 的清华源配置文件如下:
```sh
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
```
其他版本 Ubuntu 系统清华源配置文件可参考 <https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/>
## 安装 Gnome3
sudo apt-get install gnome gnome-audio gnome-shell gnome-terminal gnome-themes-extra gnome-tweaks gnome-tweak-tool gnome-icon-theme gnome-control-center gnome-colors gnome-color-chooser gnome-color-manager gnome-calendar gnome-calculator gnome-backgrounds gnome-alsamixer gnome-screensaver
### 安装主题
示例如下:
sudo apt-get install breeze-icon-theme breeze-cursor-theme breeze-gtk-theme
之后在 gnome tweak tool 中可更换主题。
### 安装中文输入法
Gnome3 默认支持 ibus 输入法,安装方法如下:
sudo apt-get install ibus-pinyin ibus-sunpinyin ibus-gtk ibus-gtk3 ibus-qt4
不安装 ibus-gtk、ibus-gtk3 和 ibus-qt4 的话将不会产生光标跟随效果,输入法待选字都在左下角。
之后在 system settings -> Region & Language 里面增加输入法,重启后生效。
### 切换登陆管理器
默认在安装 Gnome3 时会弹出登陆管理器切换界面,如需自行修改的话可使用如下命令:
sudo dpkg-reconfigure gdm
sudo dpkg-reconfigure lightdm
### 切换主目录中文件夹名
中文系统默认主目录下文件夹名为中文,在 shell 下访问太过费事,最好改为英文。方法是修改 ~/.config/user-dirs.dirs 文件内容如下,之后将各目录修改为对应的英文名,然后重新登陆该账户即可:
```sh
XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_VIDEOS_DIR="$HOME/Videos"
```
之后:
gsettings set org.blueman.transfer shared-path '/home/<user name>/Downloads'
或通过:
sudo blueman-services
重新配置,否则重启会提示:
Configured directory for incoming files does not exist
## 查看已安装工具包
dpkg -l
可配合 grep 工具使用。
## 安装开发工具
$ sudo apt-get install build-essential
$ sudo apt-get install global openssl gcc git make gnu-efi libssl-dev libpciaccess-dev uuid-dev libsystemd-dev libevent-dev libxml2-dev libusb-1.0-0-dev python3 python3-pip libblkid-dev e2fslibs-dev minicom gtkterm parted gparted tmux
$ sudo pip3 install kconfiglib
## 提升权限
普通用户可能无法访问某些设备,需要提升权限:
gpasswd --add <user name> dialout
groups <user name>