时间:2023-05-18 23:36:01 | 来源:网站运营
时间:2023-05-18 23:36:01 来源:网站运营
【Ubuntu】Win11 VmWare虚拟机安装Ubuntu 22.04.1-server:注意:可以选择VM外的粘贴功能粘贴进去,清华源有ubuntu20,有的源没有,此处也可安装完毕配置。
Done
即可。提示:确认是否继续,继续后会对磁盘进行格式化会破坏磁盘数据,如果是宿主机系统重装建议提前备份。
这里个人勾选了docker和powershell。最后等待安装即可。
sudo passwd root
切换root账户sudo su
注意默认情况下无法用Root远程登陆。sudo vim /etc/ssh/sshd_config PermitRootLogin yes
修改之后需要重启SSHD后台进程:sudo systemctl restart sshd
sudo apt-get install openssh-server
在连接之前,需要保证 xshell 所在主机 和 ubuntu( 虚拟机 ) 相互能平通,因为ssh远程连接是通过网络连接的,如果网络不通,就无法连接。ip addr
命令查看网络IP,Windows主机使用ipconfig
查看网络IP:ip addr
Window主机地址如下:Connecting to 192.168.110.128:22...Connection established.To escape to local shell, press 'Ctrl+Alt+]'.Welcome to Ubuntu 22.04.1 LTS (GNU/Linux 5.15.0-57-generic x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/advantage System information as of Sun Jan 8 06:45:58 AM UTC 2023 System load: 0.0078125 Processes: 226 Usage of /: 41.8% of 13.67GB Users logged in: 1 Memory usage: 12% IPv4 address for docker0: 172.17.0.1 Swap usage: 0% IPv4 address for ens33: 192.168.110.12860 updates can be applied immediately.To see these additional updates run: apt list --upgradableLast login: Sun Jan 8 03:46:40 2023 from 192.168.110.1xander@xander:~$
/etc/apt/sources.list
。xander@xander:~$ sudo vim /etc/apt/sources.list# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to# newer versions of the distribution.deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy main restricted# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy main restricted## Major bug fix updates produced after the final release of the## distribution.deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-updates main restricted# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-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 https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy universe# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy universedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-updates universe# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-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 https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy multiverse# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-updates multiverse# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-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 https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-backports main restricted universe multiverse# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-backports main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-security main restricted# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-security main restricteddeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-security universe# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-security universedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-security multiverse# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-security multiverse
手动替换的方式可以参考网站,因为不同的版本替换方式不太一样,这里为22.04LTS
的版本。# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse# 预发布软件源,不建议启用# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
命令替换sudo sed -i "s@http://.*archive.ubuntu.com@https://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.listsudo sed -i "s@http://.*security.ubuntu.com@https://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list
操作内容 | Centos6/7 | Debian/Ubuntu |
---|---|---|
1.软件包后缀 | *.rpm | *.deb |
2.软件源配置文件 | /etc/yum.conf | /etc/apt/sources.list |
3.更新软件包列表 | yum makecache fast | apt update |
4.从软件仓库安装软件 | yum install package | apt install package |
5.安装本地软件包 | rpm -i pkg.rpm | dpkg -i pkg.deb |
6.删除软件包 | yum remove package | apt remove package |
7.获取某软件包的信息 | yum search package | apt search package |
关键词:安装,虚拟