关于ubuntu:Ubuntu-18-刚安装该初始配置什么呢

43次阅读

共计 4102 个字符,预计需要花费 11 分钟才能阅读完成。

倡议最小化装置 Ubuntu 零碎,精简不必要的软件!

Ubuntu 镜像

用于 apt 减速。首先,抉择你的 Ubuntu 版本的配置,

  • 阿里源
  • 清华源

而后,替换进 /etc/apt/sources.list

sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
sudo vi /etc/apt/sources.list

sudo apt update

中文输入法

  1. 关上 SettingsRegion & Language 配置页,点击 Manage Installed Language 弹出 Language Support 窗口
  2. Language Support 窗口,点击 Install/Remove Languages,勾选 Chinese (simplified)Apply 装置语言

    • Keyboard Input method systemIBus
  3. 回到 Region & Language 配置页,Input Sources 下点击 +,抉择 ChineseChinese (Intelligent Pinyin) 实现
  4. 关上 SettingsDevices Keyboard 配置页,可批改 Typing 快捷键。默认 Super+Space 切换输出。

    • Chinese (Intelligent Pinyin)Shift 切换中英。

exFAT 驱动

反对 exFAT 格局的移动硬盘。exFAT 于 macOS, Windows 可读写;文件和分区的大小,可到 128PB。

sudo apt install exfat-fuse exfat-utils

必要开发软件

零碎最小化装置时,必要装置的一些工具:

# ifconfig
sudo apt install net-tools

开发,必要装置的一些软件:

sudo apt install build-essential cmake git
  • Visual Studio Code on Linux

SSH 配置

近程机器启用 SSH 服务:

# 装置服务
sudo apt install openssh-server
# 启动服务
sudo service ssh start
# 查看服务
ps -aux | grep ssh

如果要免密登录,可把公钥复制进 ~/.ssh/authorized_keys。或者,本地机器写进近程机器:

ssh-copy-id -i ~/.ssh/id_rsa.pub remote@0.0.0.0

本地机器增加 SSH 私钥:

# 如果没有,则生成秘钥
#  私钥 id_rsa 公钥 id_rsa.pub
ssh-keygen -t rsa -C "ikuokuo@hotmail.com"

# 把已有私钥放进 ~/.ssh/
mkdir -p ~/.ssh/
mv id_rsa ~/.ssh/
chmod 600 ~/.ssh/id_rsa

# 增加进 ssh-agent
ssh-add ~/.ssh/id_rsa

# 测试是否胜利
ssh -T remote@0.0.0.0

配置 ~/.ssh/config,可设 Host 昵称,如用于 GitHub 多账户:

Host github.com
  HostName github.com
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/id_rsa

屏幕分享

Settings > Sharing > Screen Sharing,启用屏幕分享。

零碎最小化装置时,或于某些嵌入式版本的 Ubuntu,不存在上述选项,需装置:

# 装置服务
sudo apt install vino

# 启用服务
/usr/lib/vino/vino-server

# SSH 登录启用服务
/usr/lib/vino/vino-server --display=:0

配置需敞开 require-encryption,尔后如 macOS Screen Sharing 等才可登录:

# sudo apt install dconf-editor
sudo apt install dconf-tools
dconf write /org/gnome/desktop/remote-access/require-encryption false

Ubuntu 可用 Remmina 客户端软件,VNC 进入远程桌面:

sudo apt install remmina remmina-plugin-vnc

屏幕录制

  • Kazam: 屏幕录制
  • HandBrake: 格局转换

因为 Kazam 录制格局于其余平台可能存在问题,如微信。可用 HandBrake 转换成 MPEG-4 再分享。

sudo apt install kazam handbrake

桌面优化

可用 Tweaks 优化或定制 GNOME 桌面。其扩大可见:https://extensions.gnome.org。

sudo apt install gnome-tweaks

Nvidia 驱动

如果是 N 卡,可装置 Nvidia 驱动。举荐应用 graphics drivers PPA 形式:

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update

如果装置 CUDA Toolkit,请先理解 CUDA Compatibility。装置 CUDA Toolkit 时,留神其携带的驱动版本,最好将其与驱动别离进行装置。而驱动从官网上间接找适合的版本。

查看驱动信息

Settings > Details > About, Graphics: 查看显卡驱动

$ ubuntu-drivers devices
== /sys/devices/pci0000:00/0000:00:14.3 ==
modalias : pci:v00008086d000006F0sv00008086sd000002A4bc02sc80i00
vendor   : Intel Corporation
manual_install: True
driver   : backport-iwlwifi-dkms - distro free
$ lspci | grep -i vga
00:02.0 VGA compatible controller: Intel Corporation Device 9bc4 (rev 05)
01:00.0 VGA compatible controller: NVIDIA Corporation Device 1f15 (rev a1)

$ lspci -v -s 01:00.0
01:00.0 VGA compatible controller: NVIDIA Corporation Device 1f15 (rev a1) (prog-if 00 [VGA controller])
  Subsystem: Device 1d05:1097
  Flags: bus master, fast devsel, latency 0, IRQ 159
  Memory at c5000000 (32-bit, non-prefetchable) [size=16M]
  Memory at b0000000 (64-bit, prefetchable) [size=256M]
  Memory at c0000000 (64-bit, prefetchable) [size=32M]
  I/O ports at 6000 [size=128]
  Expansion ROM at c6000000 [disabled] [size=512K]
  Capabilities: <access denied>
  Kernel driver in use: nouveau
  Kernel modules: nvidiafb, nouveau

装置 Nvidia 驱动

apt-cache search nvidia | grep ^nvidia-driver

sudo apt install nvidia-driver-440

查看 Nvidia 驱动信息

$ nvidia-smi
Fri Apr 17 07:31:55 2020
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.82       Driver Version: 440.82       CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce RTX 2060    Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   40C    P8     5W /  N/A |    263MiB /  5934MiB |      3%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1560      G   /usr/lib/xorg/Xorg                           144MiB |
|    0      1726      G   /usr/bin/gnome-shell                          76MiB |
|    0      2063      G   ...uest-channel-token=10544833948196615517    39MiB |
+-----------------------------------------------------------------------------+
# after reboot
$ nvidia-settings

正文完
 0