1、下载Ubuntu镜像
下载地址:清华大学开源软件镜像站
选择Ubuntu版本22.04.XX(amd64, Server),其中XX小版本自选(当前示例版本为22.04.2)。
2、本地加载Ubuntu的iso镜像
默认选中「Try or Install Ubuntu Server」安装选项,回车(或等待 30 秒后),等待系统镜像自检并进行安装初始化。
1) 选择语言:English
2) 版本更新
询问是否更新到新版本(Update to the new installer), 或者不更新并继续安装当前版本(Continue without updating),这里选默认的「Continue without updating」,回车确认。(一定要选择“不更新”,否则会等到天荒地老)。
3) 选择键盘布局
键盘配置,选择「Identify keyboard」可让系统自动识别键盘布局,这里默认并回车确认。
4) 选择安装方式
最小安装(minimized) 或者 常规安装,根据自己的实际情况选择。
5) 配置网络
默认是 DHCP 自动获取 IP 地址,下图中的「192.168.242.129」即为自动获取的 IP。(刚刚接触的同学,建议选择DHCP)
选择了桥接模式,我想设置为静态 IP,方便 ssh 连接,选中「ens32 eth - ▶」, 按空格键或回车弹出修改「Edit IPv4」选项,选中。
选择「manual」,即手动设置。
然后依次输入:网络号、IP 地址、网关、域名服务器(即 DNS ),然后保存。
6) 配置代理
默认放空,无需设置。
7) 配置存档镜像
这里强烈建议改成清华的源:https://mirrors.tuna.tsinghua.edu.cn/ubuntu/
否则安装中有一步kernel下载会等到天荒地老。(注意:也不能用阿里的源,阿里的源也非常慢,安装中会卡住不动)
8) 引导式存储布局配置
即分区配置,保持默认。
什么都不做,选择「Continue」。
9) 个人信息设置
依次设置名字、服务器名、用户名、用户密码。
10) 升级到 ubuntu pro
不升级,直接选择skip。
11) SSH 配置
勾选「Install OpenSSH Server」,
12) 可选的服务器软件包
什么都不安装。
13) 开始安装
配置完成,开始安装系统。
安装过程中如果出现CD ROM挂载错误,按下 ENTER 回车键让它继续。
14) 安装成功
输入用户名和密码即可登录。
3、安装完成后的一些必要设置
1) 安装完成后开启root
sudo passwd root
密码设置为root
2) 开启ssh server
sudo vi /etc/ssh/sshd_config
把 PermitRootLogin without-password 改为 PermitRootLogin yes #这一步是为了让root用户可以通过ssh进行登录
sudo systemctl restart sshd
3) 修改软件包源(推荐:清空的源)
源配置文件为/etc/apt/sources.list
# 备份原来的文件 sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak # 修改 sources.list 为以下内容: # 默认注释了源码镜像以提高 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 multiverse deb 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 multiverse 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 multiverse # deb 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 http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse # deb-src http://security.ubuntu.com/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
附:阿里的源
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse # deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse # deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse # deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse # deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse ## Pre-released source, not recommended. # deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse # deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
附:中科大的源
deb https://mirrors.ustc.edu.cn/ubuntu/ focal main restricted universe multiverse deb https://mirrors.ustc.edu.cn/ubuntu/ focal-updates main restricted universe multiverse deb https://mirrors.ustc.edu.cn/ubuntu/ focal-backports main restricted universe multiverse deb https://mirrors.ustc.edu.cn/ubuntu/ focal-security main restricted universe multiverse # deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal main restricted universe multiverse # deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-updates main restricted universe multiverse # deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-backports main restricted universe multiverse # deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-security main restricted universe multiverse ## Pre-released source, not recommended. # deb https://mirrors.ustc.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse # deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
附:网易的源
deb http://mirrors.163.com/ubuntu/ focal main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ focal-security main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ focal-updates main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ focal-backports main restricted universe multiverse # deb-src http://mirrors.163.com/ubuntu/ focal main restricted universe multiverse # deb-src http://mirrors.163.com/ubuntu/ focal-security main restricted universe multiverse # deb-src http://mirrors.163.com/ubuntu/ focal-updates main restricted universe multiverse # deb-src http://mirrors.163.com/ubuntu/ focal-backports main restricted universe multiverse ## Pre-released source, not recommended. # deb http://mirrors.163.com/ubuntu/ focal-proposed main restricted universe multiverse # deb-src http://mirrors.163.com/ubuntu/ focal-proposed main restricted universe multiverse
源配置文件更新后,需要更新apt缓存
sudo apt update sudo apt upgrade -y sudo unminimize
Ubuntu Server版本安装到这里结束:)
标签:LTS,universe,server,22.04,ubuntu,deb,main,multiverse,restricted From: https://www.cnblogs.com/ddcoder/p/18027575