Ubuntu 介绍
Ubuntu(友帮拓、优般图、乌班图)是一个以桌面应用为主的开源 GNU/Linux 操作系统,Ubuntu 是基于 GNU/Linux, 支持 x86、amd64(即 x64)和 ppc 架构,由全球化的专业开发团队(Canonical Ltd)打造的。
专业的 Python 开发者一般会选择 Ubuntu 这款 Linux 系统作为生产平台.
温馨提示:Ubuntu 和 Centos 都是基于 GNU/Linux 内核的,因此基本使用和Centos 是几乎一样的,它们的各种指令可以通用,同学们在学习和使用 Ubuntu 的过程中,会发现各种操作指令在前面学习CentOS 都使用过。只是界面和预安装的软件有所差别。
Ubuntu 下载地址:http://cn.ubuntu.com/download/
安装Ubuntu
设置中文
- 默认安装的 ubuntu 中只有英文语言,因此是不能显示汉字的。要正确显示汉字,需要安装中文语言包。安装中文支持步骤:单击左侧图标栏打开 Language Support 菜单,点击打开 Language Support(语言支持)选项卡。
- 点击 Install / Remove Languages,在弹出的选项卡中下拉找到 Chinese(Simplified),即中文简体,在后面的选项框中打勾。然后点击 Apply Changes 提交,系统会自动联网下载中文语言包。(保证 ubuntu 是联网的)。
- 这时“汉语(中国)”在最后一位因为当前第一位是”English”,所以默认显示都是英文。我们如果希望默认显示 用中文,则应该将“汉语(中国)”设置为第一位。设置方法是拖动,鼠标单击“汉语(中国)”,当底色变化(表 示选中了)后,按住鼠标左键不松手,向上拖动放置到第一位。
- 设置后不会即刻生效,需要下一次登录时才会生效
Ubuntu 的 root 用户
介绍
安装 ubuntu 成功后,都是普通用户权限,并没有最高 root 权限,如果需要使用 root 权限的时候,通常都会在命令前面加上 sudo 。有的时候感觉很麻烦。
我们一般使用 su 命令来直接切换到 root 用户的,但是如果没有给 root 设置初始密码,就会抛出 su : Authentication failure 这样的问题。所以,我们只要给 root 用户设置一个初始密码就好了。
给root 用户设置密码并使用
- 输入 sudo passwd 命令,设定 root 用户密码。
- 设定 root 密码成功后,输入 su 命令,并输入刚才设定的 root 密码,就可以切换成 root 了。
- 提示符$代表一般用户, 提示符#代表 root 用户。以后就可以使用 root 用户了
- 输入 exit 命令,退出 root 并返回一般用户
wenchang@ubuntu:~/Desktop$ sudo passwd
新的 密码:
重新输入新的 密码:
passwd:已成功更新密码
wenchang@ubuntu:~/Desktop$ su root
密码:
root@ubuntu:/home/wenchang/Desktop# exit
exit
wenchang@ubuntu:~/Desktop$
Ubuntu 下开发Python
说明
安装好 Ubuntu 后,默认就已经安装好 Python 的开发环境。在Ubuntu 下开发一个 Python 程序
wenchang@ubuntu:~/Desktop$ vim hello.py
wenchang@ubuntu:~/Desktop$ cat hello.py
print("hello,python")
wenchang@ubuntu:~/Desktop$ python3 hello.py
hello,python
APT 软件管理
apt 介绍
apt 是 Advanced Packaging Tool 的简称,是一款安装包管理工具。在 Ubuntu 下,我们可以使用 apt 命令进行软件包的安装、删除、清理等,类似于 Windows 中的软件管理工具。
apt-cache和apt-get是apt包的管理工具,他们根据/etc/apt/sources.list里的软件源地址列表搜索目标软件、并通过维护本地软件包列表来安装和卸载软件。Ubuntu 软件操作的相关命令
```shell 1.搜索软件 sudo apt-cache search package_name 其中还可以使用正则表达式 sudo apt-cache search sof* 这样就可以搜索到源上面所有以sof开头的软件包。
2.查看软件包信息 sudo apt-cache show package_name
3.查看软件包依赖关系 sudo apt-cache show depends package_name
4.查看每个软件包的简要信息 sudo apt-cache dump
5.安装软件 sudo apt-get install package_name
6.更新已安装的软件包 sudo apt-get upgrade
7.更新软件包列表 sudo apt-get update
8.卸载一个软件包但是保留相关的配置文件 sudo apt-get remove package_name
9.卸载一个软件包同时删除配置文件 apt-get -purge remove package_name
10.删除软件包的备份 apt-get clean
<a name="AD4Bt"></a>
## 更新 Ubuntu 软件下载地址
<a name="zWQSK"></a>
### 原理介绍
Ubuntu自带包管理器apt,但是由于众所周知的原因,国内通过apt默认的源下载/更新软件相当慢。更换apt使用国内的镜像源可以使更新更快更稳定,这是Ubuntu换源最主要的目的。
<a name="kRc9x"></a>
### 寻找国内镜像源
[清华大学开源软件镜像站: https://mirrors.tuna.tsinghua.edu.cn/](https://mirrors.tuna.tsinghua.edu.cn/)<br />所谓的镜像源:可以理解为提供下载软件的地方,比如 Android 手机上可以下载软件的安卓市场;iOS 手机上可以下载软件的 AppStore<br /><br />
```shell
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
备份Ubuntu 默认的源地址
wenchang@ubuntu:~/Desktop$ sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
wenchang@ubuntu:~/Desktop$ cd /etc/apt/
wenchang@ubuntu:/etc/apt$ ll
总用量 48
drwxr-xr-x 7 root root 4096 Jan 21 11:41 ./
drwxr-xr-x 130 root root 12288 Jan 21 11:41 ../
drwxr-xr-x 2 root root 4096 Jan 21 11:21 apt.conf.d/
drwxr-xr-x 2 root root 4096 Apr 9 2020 auth.conf.d/
drwxr-xr-x 2 root root 4096 Apr 9 2020 preferences.d/
-rw-r--r-- 1 root root 3158 Jan 20 17:26 sources.bak
-rw-rw-r-- 1 root root 3158 Jan 20 17:27 sources.list
-rw-r--r-- 1 root root 3158 Jan 21 11:41 sources.list.backup
drwxr-xr-x 2 root root 4096 Apr 9 2020 sources.list.d/
drwxr-xr-x 2 root root 4096 Aug 1 2020 trusted.gpg.d/
wenchang@ubuntu:/etc/apt$ cat sources.list
#deb cdrom:[Ubuntu 20.04.1 LTS _Focal Fossa_ - Release amd64 (20200731)]/ focal main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ focal main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ focal main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ focal-updates main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ focal-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ focal universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ focal universe
deb http://us.archive.ubuntu.com/ubuntu/ focal-updates universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ focal-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://us.archive.ubuntu.com/ubuntu/ focal multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ focal multiverse
deb http://us.archive.ubuntu.com/ubuntu/ focal-updates multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ focal-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu focal partner
# deb-src http://archive.canonical.com/ubuntu focal partner
deb http://security.ubuntu.com/ubuntu focal-security main restricted
# deb-src http://security.ubuntu.com/ubuntu focal-security main restricted
deb http://security.ubuntu.com/ubuntu focal-security universe
# deb-src http://security.ubuntu.com/ubuntu focal-security universe
deb http://security.ubuntu.com/ubuntu focal-security multiverse
# deb-src http://security.ubuntu.com/ubuntu focal-security multiverse
# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.
wenchang@ubuntu:/etc/apt$
更新源服务器列表
#先清空 sources.list 文件
wenchang@ubuntu:/etc/apt$ su
密码:
root@ubuntu:/etc/apt# echo '' > sources.list
root@ubuntu:/etc/apt# cat sources.list
#复制镜像网站的地址,拷贝到 sources.list 文件
root@ubuntu:/etc/apt# vim sources.list
root@ubuntu:/etc/apt# cat sources.list
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
#更新源地址
root@ubuntu:/etc/apt# sudo apt-get update
获取:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal InRelease [265 kB]
获取:2 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates InRelease [114 kB]
获取:3 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports InRelease [108 kB]
获取:4 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security InRelease [114 kB]
获取:5 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/main amd64 Packages [970 kB]
获取:6 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/main i386 Packages [718 kB]
获取:7 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/main Translation-zh_CN [113 kB]
获取:8 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/main Translation-en [506 kB]
获取:9 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/main amd64 DEP-11 Metadata [494 kB]
获取:10 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/main DEP-11 48x48 Icons [98.4 kB]
获取:11 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/main DEP-11 64x64 Icons [163 kB]
获取:12 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/main DEP-11 64x64@2 Icons [15.8 kB]
获取:13 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/main amd64 c-n-f Metadata [29.5 kB]
获取:14 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/restricted amd64 Packages [22.0 kB]
获取:15 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/restricted i386 Packages [8,112 B]
获取:16 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/restricted Translation-zh_CN [1,324 B]
获取:17 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/restricted Translation-en [6,212 B]
获取:18 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/restricted amd64 c-n-f Metadata [392 B]
获取:19 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/universe i386 Packages [4,642 kB]
获取:20 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/universe amd64 Packages [8,628 kB]
获取:21 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/universe Translation-zh_CN [388 kB]
获取:22 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/universe Translation-en [5,124 kB]
获取:23 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/universe amd64 DEP-11 Metadata [3,603 kB]
获取:24 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/universe DEP-11 48x48 Icons [3,016 kB]
获取:25 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/universe DEP-11 64x64 Icons [7,794 kB]
获取:26 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/universe DEP-11 64x64@2 Icons [44.3 kB]
获取:27 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/universe amd64 c-n-f Metadata [265 kB]
获取:28 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/multiverse amd64 Packages [144 kB]
获取:29 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/multiverse i386 Packages [74.7 kB]
获取:30 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/multiverse Translation-en [104 kB]
获取:31 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/multiverse Translation-zh_CN [4,612 B]
获取:32 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/multiverse amd64 DEP-11 Metadata [48.4 kB]
获取:33 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/multiverse DEP-11 48x48 Icons [23.1 kB]
获取:34 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/multiverse DEP-11 64x64 Icons [192 kB]
获取:35 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/multiverse DEP-11 64x64@2 Icons [214 B]
获取:36 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/multiverse amd64 c-n-f Metadata [9,136 B]
获取:37 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/main i386 Packages [591 kB]
获取:38 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/main amd64 Packages [1,509 kB]
获取:39 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/main Translation-en [296 kB]
获取:40 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/main amd64 DEP-11 Metadata [280 kB]
获取:41 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/main DEP-11 48x48 Icons [60.8 kB]
获取:42 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/main DEP-11 64x64 Icons [98.3 kB]
获取:43 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/main DEP-11 64x64@2 Icons [29 B]
获取:44 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/main amd64 c-n-f Metadata [14.7 kB]
获取:45 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/restricted i386 Packages [21.8 kB]
获取:46 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/restricted amd64 Packages [736 kB]
获取:47 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/restricted Translation-en [105 kB]
获取:48 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/restricted amd64 c-n-f Metadata [532 B]
获取:49 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/universe i386 Packages [663 kB]
获取:50 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/universe amd64 Packages [893 kB]
获取:51 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/universe Translation-en [196 kB]
获取:52 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/universe amd64 DEP-11 Metadata [364 kB]
获取:53 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/universe DEP-11 48x48 Icons [220 kB]
获取:54 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/universe DEP-11 64x64 Icons [394 kB]
获取:55 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/universe DEP-11 64x64@2 Icons [29 B]
获取:56 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/universe amd64 c-n-f Metadata [20.0 kB]
获取:57 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/multiverse i386 Packages [8,432 B]
获取:58 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/multiverse amd64 Packages [24.8 kB]
获取:59 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/multiverse Translation-en [6,928 B]
获取:60 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/multiverse amd64 DEP-11 Metadata [940 B]
获取:61 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/multiverse DEP-11 48x48 Icons [1,865 B]
获取:62 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/multiverse DEP-11 64x64 Icons [2,498 B]
获取:63 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/multiverse DEP-11 64x64@2 Icons [29 B]
获取:64 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/multiverse amd64 c-n-f Metadata [620 B]
获取:65 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports/main amd64 Packages [42.0 kB]
获取:66 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports/main i386 Packages [34.5 kB]
获取:67 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports/main Translation-en [10.0 kB]
获取:68 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports/main amd64 DEP-11 Metadata [7,984 B]
获取:69 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports/main DEP-11 48x48 Icons [6,977 B]
获取:70 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports/main DEP-11 64x64 Icons [10.5 kB]
获取:71 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports/main DEP-11 64x64@2 Icons [29 B]
获取:72 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports/main amd64 c-n-f Metadata [864 B]
获取:73 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports/restricted amd64 c-n-f Metadata [116 B]
获取:74 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports/universe amd64 Packages [19.5 kB]
获取:75 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports/universe i386 Packages [11.1 kB]
获取:76 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports/universe Translation-en [13.4 kB]
获取:77 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports/universe amd64 DEP-11 Metadata [11.3 kB]
获取:78 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports/universe DEP-11 48x48 Icons [4,959 B]
获取:79 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports/universe DEP-11 64x64 Icons [8,416 B]
获取:80 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports/universe DEP-11 64x64@2 Icons [29 B]
获取:81 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports/universe amd64 c-n-f Metadata [672 B]
获取:82 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports/multiverse amd64 c-n-f Metadata [116 B]
获取:83 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/main amd64 Packages [1,177 kB]
获取:84 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/main i386 Packages [362 kB]
获取:85 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/main Translation-en [210 kB]
获取:86 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/main amd64 DEP-11 Metadata [38.2 kB]
获取:87 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/main DEP-11 48x48 Icons [18.3 kB]
获取:88 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/main DEP-11 64x64 Icons [35.5 kB]
获取:89 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/main DEP-11 64x64@2 Icons [29 B]
获取:90 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/main amd64 c-n-f Metadata [9,132 B]
获取:91 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/restricted i386 Packages [20.5 kB]
获取:92 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/restricted amd64 Packages [686 kB]
获取:93 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/restricted Translation-en [97.9 kB]
获取:94 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/restricted amd64 c-n-f Metadata [536 B]
获取:95 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/universe amd64 Packages [676 kB]
获取:96 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/universe i386 Packages [532 kB]
获取:97 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/universe Translation-en [115 kB]
获取:98 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/universe amd64 DEP-11 Metadata [66.2 kB]
获取:99 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/universe DEP-11 48x48 Icons [31.6 kB]
获取:100 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/universe DEP-11 64x64 Icons [70.3 kB]
获取:101 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/universe DEP-11 64x64@2 Icons [29 B]
获取:102 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/universe amd64 c-n-f Metadata [13.0 kB]
获取:103 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/multiverse i386 Packages [7,176 B]
获取:104 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/multiverse amd64 Packages [21.8 kB]
获取:105 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/multiverse Translation-en [4,948 B]
获取:106 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/multiverse amd64 DEP-11 Metadata [2,464 B]
获取:107 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/multiverse DEP-11 48x48 Icons [29 B]
获取:108 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/multiverse DEP-11 64x64 Icons [2,638 B]
获取:109 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/multiverse DEP-11 64x64@2 Icons [29 B]
获取:110 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/multiverse amd64 c-n-f Metadata [536 B]
已下载 48.7 MB,耗时 14秒 (3,527 kB/s)
正在读取软件包列表... 完成
root@ubuntu:/etc/apt#
Ubuntu 软件安装,卸载
使用 apt 完成安装和卸载 vim 软件,并查询 vim 软件的信息
wenchang@ubuntu:/etc/apt$ sudo apt-get remove vim
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
下列软件包是自动安装的并且现在不需要了:
vim-runtime
使用'sudo apt autoremove'来卸载它(它们)。
下列软件包将被【卸载】:
vim
升级了 0 个软件包,新安装了 0 个软件包,要卸载 1 个软件包,有 271 个软件包未被升级。
解压缩后将会空出 3,111 kB 的空间。
您希望继续执行吗? [Y/n] y
(正在读取数据库 ... 系统当前共安装有 187415 个文件和目录。)
正在卸载 vim (2:8.1.2269-1ubuntu5.4) ...
update-alternatives: 使用 /usr/bin/vim.tiny 来在自动模式中提供 /usr/bin/vi (vi)
update-alternatives: 使用 /usr/bin/vim.tiny 来在自动模式中提供 /usr/bin/view (view)
update-alternatives: 使用 /usr/bin/vim.tiny 来在自动模式中提供 /usr/bin/ex (ex)
update-alternatives: 使用 /usr/bin/vim.tiny 来在自动模式中提供 /usr/bin/rview (rview)
wenchang@ubuntu:/etc/apt$ sudo apt-cache search vim
exuberant-ctags - build tag file indexes of source code definitions
tmux - terminal multiplexer
vim - Vi 增强版 - 增强的 vi 编辑器
vim-common - Vi IMproved - 共用文件
vim-doc - Vi IMproved - HTML documentation
vim-runtime - Vi IMproved - Runtime files
vim-tiny - Vi IMproved - enhanced vi editor - compact version
acr - autoconf like tool
alot - Text mode MUA using notmuch mail
alot-doc - Text mode MUA using notmuch mail - documentation
biosyntax-vim - Syntax Highlighting for Computational Biology (vim)
cernlib-base - CERNLIB data analysis suite - common files
clang-format-10 - Tool to format C/C++/Obj-C code
clang-format-6.0 - Tool to format C/C++/Obj-C code
clang-format-7 - Tool to format C/C++/Obj-C code
clang-format-8 - Tool to format C/C++/Obj-C code
clang-format-9 - Tool to format C/C++/Obj-C code
colordiff - tool to colorize 'diff' output
context-modules - additional ConTeXt modules
copyq - Advanced clipboard manager with editing and scripting features
copyq-plugins - Plugins for CopyQ
cpl-plugin-vimos - ESO data reduction pipeline for the VIMOS instrument
cpl-plugin-vimos-calib - ESO data reduction pipeline calibration data downloader for VIMOS
cpl-plugin-vimos-doc - ESO data reduction pipeline documentation for VIMOS
cream - VIM macros that make the VIM easier to use for beginners
dh-vim-addon - debhelper addon to help package Vim/Neovim addons
ejabberd-mod-shcommands - execute shell commands via XMPP (dangerous!)
elpa-anzu - show number of matches in mode-line while searching
elpa-bind-map - bind personal keymaps in multiple locations
elpa-color-theme-modern - deftheme reimplementation of classic Emacs color-themes
elpa-evil - extensible vi layer for Emacs
elpa-neotree - directory tree sidebar for Emacs that is like NERDTree for Vim
elpa-powerline - Emacs version of the Vim powerline
elpa-smeargle - highlight region by last updated time
elpa-solarized-theme - port of Solarized theme to Emacs
elpa-vimish-fold - fold text in GNU Emacs like in Vim
elpa-zenburn-theme - low contrast color theme for Emacs
elvis-tiny - Tiny vi compatible editor for the base system
env2 - convert environment variables between scripting languages
fim - scriptable frame buffer, X.org and ascii art image viewer
findent - indents/converts Fortran sources
fonts-powerline - prompt and statusline utility (symbols font)
formiko - reStructuredText and MarkDown editor and live previewer
geany-plugin-vimode - Vim-mode plugin for Geany
get-flash-videos - video downloader for various Flash-based video hosting sites
global - Source code search and browse tools
glogg - Smart interactive log explorer using Qt
golang-github-vimeo-go-magic-dev - Go bindings for libmagic
gramadoir - Irish language grammar checker (integration scripts)
grilo-plugins-0.3-extra - Framework for discovering and browsing media - Extra Plugins
hothasktags - Haskell ctags generator
imediff - interactive full screen 2/3-way merge tool
kakoune - Vim-inspired, selection-oriented code editor
libghc-pandoc-dev - general markup converter - libraries
libghc-pandoc-doc - general markup converter - library documentation
libghc-pandoc-prof - general markup converter - profiling libraries
libghc-yi-keymap-vim-dev - Vim keymap for Yi editor
libghc-yi-keymap-vim-doc - Vim keymap for Yi editor; documentation
libghc-yi-keymap-vim-prof - Vim keymap for Yi editor; profiling libraries
libjs-xterm - terminal front-end component for the browser - browser library
liblatex-table-perl - Perl extension for the automatic generation of LaTeX tables
libocp-indent-ocaml - OCaml indentation tool for emacs and vim - libraries
libocp-indent-ocaml-dev - OCaml indentation tool for emacs and vim - development libraries
libtext-findindent-perl - module to heuristically determine indentation style
libvi-quickfix-perl - Perl support for vim's QuickFix mode
linuxdoc-tools - convert LinuxDoc SGML source into other formats
lua-nvim - Lua client for Neovim
lua-nvim-dev - Lua client for Neovim
movim - decentralised social network fully based on XMPP
neovim - heavily refactored vim fork
neovim-qt - neovim client library and GUI
neovim-runtime - heavily refactored vim fork (runtime files)
nescc - Programming Language for Deeply Networked Systems
netrik - text mode WWW browser with vi like keybindings
node-xterm - terminal front-end component for the browser - NodeJS modules
notmuch-vim - thread-based email index, search and tagging (vim interface)
ocaml-tools - tools for OCaml developers
ocp-indent - OCaml indentation tool for emacs and vim - runtime
otags - tags file generator for OCaml
pacvim - pacman game concept with vim command
pandoc - general markup converter
pandoc-data - general markup converter - data files
php-embed - Get info from any web service or page
pms - Practical Music Search, an MPD client
powerline - prompt and statusline utility
powerline-doc - prompt and statusline utility (documentation)
powerline-gitstatus - Powerline Git segment
pqiv - Powerful image viewer with minimal UI
python-django-allauth-doc - Django app for local and social authentication (Documentation)
python3-django-allauth - Django app for local and social authentication (Python 3 version)
python3-editor - programmatically open an editor, capture the result - Python 3.x
python3-neovim - transitional dummy package
python3-powerline - prompt and statusline utility (Python 3.x module)
python3-powerline-gitstatus - Powerline Git segment for Python (3.x)
python3-pynvim - Python3 library for scripting Neovim processes through its msgpack-rpc API
python3-searx - Privacy-respecting metasearch engine - library package
qutebrowser - Keyboard-driven, vim-like browser based on PyQt5
qutebrowser-qtwebengine - QtWebEngine backend dependency package for qutebrowser
qutebrowser-qtwebkit - QtWebKit backend dependency package for qutebrowser
ruby-ace-rails-ap - ajax.org Cloud9 Editor (Ace) for the Rails asset pipeline
ruby-fuubar - instafailing RSpec progress bar formatter
ruby-neovim - Ruby client for Neovim
searx - Privacy-respecting metasearch engine
sen - Terminal user interface for docker engine
sisu - documents - structuring, publishing in multiple formats and search
supercollider-vim - SuperCollider mode for Vim
tpp - text presentation program
txt2regex - A Regular Expression "wizard", all written with bash2 builtins
vcsh - Version Control System for $HOME - multiple Git repositories in $HOME
vifm - flexible vi-like file manager using ncurses
vim-addon-manager - manager of addons for the Vim editor
vim-addon-mw-utils - Vim funcref library
vim-airline - Lean & mean status/tabline for vim that's light as air
vim-airline-themes - official theme collection for vim-airline
vim-athena - Vi IMproved - enhanced vi editor - with Athena GUI
vim-autopep8 - vim plugin to apply autopep8
vim-bitbake - Vim plugin to interact with Yocto bitbake-based recipes
vim-command-t - open files with a minimum number of keystrokes
vim-ctrlp - fuzzy file, buffer, mru, tag, etc. finder for Vim
vim-editorconfig - EditorConfig Plugin for Vim
vim-fugitive - Vim plugin to work with Git
vim-gocomplete - gocode integration for Vim
vim-gtk - Vi IMproved - enhanced vi editor (dummy package)
vim-gtk3 - Vi IMproved - enhanced vi editor - with GTK3 GUI
vim-gui-common - Vi IMproved - Common GUI files
vim-haproxy - syntax highlighting for HAProxy configuration files
vim-icinga2 - syntax highlighting for Icinga 2 config files in VIM
vim-julia - Vim support for Julia language
vim-khuno - Python flakes Vim plugin
vim-lastplace - Vim script to reopen files at your last edit position
vim-latexsuite - view, edit and compile LaTeX documents from within Vim
vim-ledger - Vim plugin for Ledger
vim-migemo - VIM plugin for C/Migemo
vim-nox - Vi IMproved - enhanced vi editor - with scripting languages support
vim-pathogen - Manage your runtimepath with ease
vim-puppet - syntax highlighting for puppet manifests in vim
vim-python-jedi - autocompletion tool for Python - VIM addon files
vim-rails - vim development tools for Rails development
vim-scripts - plugins for vim, adding bells and whistles
vim-snippets - Snippets files for various programming languages.
vim-syntastic - Syntax checking hacks for vim
vim-syntax-docker - Docker container engine - Vim highlighting syntax files
vim-syntax-gtk - Syntax files to highlight GTK+ keywords in vim
vim-tabular - Vim script for text filtering and alignment
vim-textobj-user - Vim plugin for user-defined text objects
vim-tjp - vim addon for TaskJuggler .tjp files
vim-tlib - Some vim utility functions
vim-ultisnips - snippet solution for Vim
vim-vimerl - Erlang plugin for Vim
vim-vimerl-syntax - Erlang syntax for Vim
vim-voom - Vim two-pane outliner
vim-youcompleteme - fast, as-you-type, fuzzy-search code completion engine for Vim
vis - Modern, legacy free, simple yet efficient vim-like editor
vit - full-screen terminal interface for Taskwarrior
youtube-dl - downloader of videos from YouTube and other sites
zathura - document viewer with a minimalistic interface
zathura-cb - comic book archive support for zathura
zathura-djvu - DjVu support for zathura
zathura-pdf-poppler - PDF support for zathura
zathura-ps - PostScript support for zathura
zeal - Simple offline API documentation browser
zsh-antigen - manage your zsh plugins
apvlv - 类似于 Vim 的 PDF 阅读器
bleachbit - 清除系统中不需要的文件
kdesdk-scripts - scripts and data files for development
nvi - 4.4BSD 中的 vi 实现版本
nvi-doc - 4.4BSD re-implementation of vi - documentation files
openshot-qt - create and edit videos and movies
vim-asciidoc - Vim syntax highlighting files for asciidoc
vim-snipmate - Vim script that implements some of TextMate's snippets features.
u-boot-tools - companion tools for Das U-Boot bootloader
clang-format-11 - Tool to format C/C++/Obj-C code
clang-format-12 - Tool to format C/C++/Obj-C code
yt-dlp - downloader of videos from YouTube and other sites
wenchang@ubuntu:/etc/apt$ sudo apt-get install vim
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
建议安装:
ctags vim-doc vim-scripts
下列【新】软件包将被安装:
vim
升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 271 个软件包未被升级。
需要下载 1,239 kB 的归档。
解压缩后会消耗 3,111 kB 的额外空间。
获取:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/main amd64 vim amd64 2:8.1.2269-1ubuntu5.4 [1,239 kB]
已下载 1,239 kB,耗时 2秒 (798 kB/s)
正在选中未选择的软件包 vim。
(正在读取数据库 ... 系统当前共安装有 187406 个文件和目录。)
准备解压 .../vim_2%3a8.1.2269-1ubuntu5.4_amd64.deb ...
正在解压 vim (2:8.1.2269-1ubuntu5.4) ...
正在设置 vim (2:8.1.2269-1ubuntu5.4) ...
update-alternatives: 使用 /usr/bin/vim.basic 来在自动模式中提供 /usr/bin/vim (vim)
update-alternatives: 使用 /usr/bin/vim.basic 来在自动模式中提供 /usr/bin/vimdiff (vimdiff)
update-alternatives: 使用 /usr/bin/vim.basic 来在自动模式中提供 /usr/bin/rvim (rvim)
update-alternatives: 使用 /usr/bin/vim.basic 来在自动模式中提供 /usr/bin/rview (rview)
update-alternatives: 使用 /usr/bin/vim.basic 来在自动模式中提供 /usr/bin/vi (vi)
update-alternatives: 使用 /usr/bin/vim.basic 来在自动模式中提供 /usr/bin/view (view)
update-alternatives: 使用 /usr/bin/vim.basic 来在自动模式中提供 /usr/bin/ex (ex)
wenchang@ubuntu:/etc/apt$ sudo apt-cache show vim
Package: vim
Architecture: amd64
Version: 2:8.1.2269-1ubuntu5.4
Priority: optional
Section: editors
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 3038
Provides: editor
Depends: vim-common (= 2:8.1.2269-1ubuntu5.4), vim-runtime (= 2:8.1.2269-1ubuntu5.4), libacl1 (>= 2.2.23), libc6 (>= 2.29), libcanberra0 (>= 0.2), libgpm2 (>= 1.20.7), libpython3.8 (>= 3.8.2), libselinux1 (>= 1.32), libtinfo6 (>= 6)
Suggests: ctags, vim-doc, vim-scripts
Filename: pool/main/v/vim/vim_8.1.2269-1ubuntu5.4_amd64.deb
Size: 1239120
MD5sum: 8c35debacd94e106f0e72a6bd56b646d
SHA1: 3226d42c6e98c7b7a4fa361d536409986b1d52c9
SHA256: c0a2d158eb8dcadef082755ed41203568c86189b8510714d7cb2144fdb09159d
SHA512: 26a10e3c4d3b72cb7f5d3f909b954349baa03b661354fca9a0bc2949e76e715d6ecf9e34236f20f70237127a1ee8c964c13b3ea8e5de14d1ae34bb6ac7b1dc89
Homepage: https://www.vim.org/
Description-zh_CN: Vi 增强版 - 增强的 vi 编辑器
Vim 是一个与 UNIX 编辑器 Vi 几乎完全兼容的版本。
.
Vim 在 vi 的基础上添加了许多特性:多次撤销、语法高亮、命令行 历史、 在线帮助、文件名补全、块操作、折叠、Unicode 支持等。
.
此软件包提供了一个带有一系列标准功能的 vim。它不提供 Vim 的 图形界面,如果您需要更多(或更少)的功能,请查看其它 vim-* 软 件包。
Description-md5: 59e8b8f7757db8b53566d5d119872de8
Task: server, cloud-image, lubuntu-desktop
Package: vim
Architecture: amd64
Version: 2:8.1.2269-1ubuntu5
Priority: optional
Section: editors
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 3038
Provides: editor
Depends: vim-common (= 2:8.1.2269-1ubuntu5), vim-runtime (= 2:8.1.2269-1ubuntu5), libacl1 (>= 2.2.23), libc6 (>= 2.29), libcanberra0 (>= 0.2), libgpm2 (>= 1.20.7), libpython3.8 (>= 3.8.2), libselinux1 (>= 1.32), libtinfo6 (>= 6)
Suggests: ctags, vim-doc, vim-scripts
Filename: pool/main/v/vim/vim_8.1.2269-1ubuntu5_amd64.deb
Size: 1237624
MD5sum: 198ccbb07a9fc8ebe67a213eab6a3e96
SHA1: 796c962d044f99a81b187211e6ce9a0a44b8d5d1
SHA256: 1e38f267bf4c06e424b166e8d666ffd6ce25c657012892d099651bee18a2c834
Homepage: https://www.vim.org/
Description-zh_CN: Vi 增强版 - 增强的 vi 编辑器
Vim 是一个与 UNIX 编辑器 Vi 几乎完全兼容的版本。
.
Vim 在 vi 的基础上添加了许多特性:多次撤销、语法高亮、命令行 历史、 在线帮助、文件名补全、块操作、折叠、Unicode 支持等。
.
此软件包提供了一个带有一系列标准功能的 vim。它不提供 Vim 的 图形界面,如果您需要更多(或更少)的功能,请查看其它 vim-* 软 件包。
Description-md5: 59e8b8f7757db8b53566d5d119872de8
Task: server, cloud-image, lubuntu-desktop
wenchang@ubuntu:/etc/apt$
远程登录Ubuntu
ssh 介绍
SSH 为 Secure Shell 的缩写,由 IETF 的网络工作小组(Network Working Group)所制定;SSH 为建立在应用层和传输层基础上的安全协议。
SSH 是目前较可靠,专为远程登录会话和其他网络服务提供安全性的协议。常用于远程登录。几乎所有UNIX/LInux平台都可运行 SSH。
使用 SSH 服务,需要安装相应的服务器和客户端。客户端和服务器的关系:如果,A 机器想被 B 机器远程控制, 那么,A 机器需要安装 SSH 服务器,B 机器需要安装 SSH 客户端。
和 CentOS 不一样,Ubuntu 默认没有安装 SSHD 服务(使用 netstat 指令查看: apt install net-tools),因此,我们不能进行远程登录。
安装SSH 和启用
sudo apt-get install openssh-server
执行上面指令后,在当前这台 Linux 上就安装了 SSH 服务端和客户端。
service sshd restart
执行上面的指令,就启动了 sshd 服务。会监听端口 22
wenchang@ubuntu:/etc/apt$ sudo apt-get install openssh-server
[sudo] wenchang 的密码:
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
将会同时安装下列软件:
ncurses-term openssh-client openssh-sftp-server ssh-import-id
建议安装:
keychain libpam-ssh monkeysphere ssh-askpass molly-guard
下列【新】软件包将被安装:
ncurses-term openssh-server openssh-sftp-server ssh-import-id
下列软件包将被升级:
openssh-client
升级了 1 个软件包,新安装了 4 个软件包,要卸载 0 个软件包,有 270 个软件包未被升级。
需要下载 1,359 kB 的归档。
解压缩后会消耗 6,010 kB 的额外空间。
您希望继续执行吗? [Y/n] y
获取:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/main amd64 openssh-client amd64 1:8.2p1-4ubuntu0.4 [671 kB]
获取:2 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/main amd64 ncurses-term all 6.2-0ubuntu2 [249 kB]
获取:3 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/main amd64 openssh-sftp-server amd64 1:8.2p1-4ubuntu0.4 [51.5 kB]
获取:4 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/main amd64 openssh-server amd64 1:8.2p1-4ubuntu0.4 [377 kB]
获取:5 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/main amd64 ssh-import-id all 5.10-0ubuntu1 [10.0 kB]
已下载 1,359 kB,耗时 8秒 (166 kB/s)
正在预设定软件包 ...
(正在读取数据库 ... 系统当前共安装有 187415 个文件和目录。)
准备解压 .../openssh-client_1%3a8.2p1-4ubuntu0.4_amd64.deb ...
正在解压 openssh-client (1:8.2p1-4ubuntu0.4) 并覆盖 (1:8.2p1-4ubuntu0.2) ...
正在选中未选择的软件包 ncurses-term。
准备解压 .../ncurses-term_6.2-0ubuntu2_all.deb ...
正在解压 ncurses-term (6.2-0ubuntu2) ...
正在选中未选择的软件包 openssh-sftp-server。
准备解压 .../openssh-sftp-server_1%3a8.2p1-4ubuntu0.4_amd64.deb ...
正在解压 openssh-sftp-server (1:8.2p1-4ubuntu0.4) ...
正在选中未选择的软件包 openssh-server。
准备解压 .../openssh-server_1%3a8.2p1-4ubuntu0.4_amd64.deb ...
正在解压 openssh-server (1:8.2p1-4ubuntu0.4) ...
正在选中未选择的软件包 ssh-import-id。
准备解压 .../ssh-import-id_5.10-0ubuntu1_all.deb ...
正在解压 ssh-import-id (5.10-0ubuntu1) ...
正在设置 openssh-client (1:8.2p1-4ubuntu0.4) ...
正在设置 ssh-import-id (5.10-0ubuntu1) ...
Attempting to convert /etc/ssh/ssh_import_id
正在设置 ncurses-term (6.2-0ubuntu2) ...
正在设置 openssh-sftp-server (1:8.2p1-4ubuntu0.4) ...
正在设置 openssh-server (1:8.2p1-4ubuntu0.4) ...
Creating config file /etc/ssh/sshd_config with new version
Creating SSH2 RSA key; this may take some time ...
3072 SHA256:Rr1fjKz8MN1x+CEb+Uf+jKv19eE43EWKjHZHIIJlL1k root@ubuntu (RSA)
Creating SSH2 ECDSA key; this may take some time ...
256 SHA256:9QfJ1lxmsUsyALSTksgEc2K3EDm9tgvDBoDKyp0Us6g root@ubuntu (ECDSA)
Creating SSH2 ED25519 key; this may take some time ...
256 SHA256:rPezrbW+45Hs7ATWB4xngknjw1o7JO9HH8Qmu+1ju1c root@ubuntu (ED25519)
Created symlink /etc/systemd/system/sshd.service → /lib/systemd/system/ssh.service.
Created symlink /etc/systemd/system/multi-user.target.wants/ssh.service → /lib/systemd/system/ssh.service.
rescue-ssh.target is a disabled or a static unit, not starting it.
正在处理用于 systemd (245.4-4ubuntu3.15) 的触发器 ...
正在处理用于 man-db (2.9.1-1) 的触发器 ...
正在处理用于 ufw (0.36-6) 的触发器 ...
wenchang@ubuntu:/etc/apt$ service sshd restart
在Windows 使用XShell 登录 Ubuntu
使用 普通用户登录,需要的时候再 su - 切换成 root 用户
从一台linux 系统远程登陆另外一台linux 系统
基本语法
ssh 用户名@IP
例如:ssh root@192.168.200.130
使用 ssh 访问,如访问出现错误。可查看是否有该文件 ~/.ssh/known_ssh 尝试删除该文件解决,一般不会有问题