当前位置: 首页 > news >正文

Ubuntu Server 22.04.5 从零到一:详尽安装部署指南

文章目录

    • Ubuntu Server 22.04.5 从零到一:详尽安装部署指南
      • 一、部署环境
      • 二、安装系统
        • 2.1 安装
          • 2.1.1 选择安装方式
          • 2.1.2 选择语言
          • 2.1.3 选择不更新
          • 2.1.4 选择键盘标准
          • 2.1.5 选择安装版本
          • 2.1.6 设置网卡
          • 2.1.7 配置代理
          • 2.1.8 设置镜像源
          • 2.1.9 选择装系统的硬盘
          • 2.1.10 硬盘分区
          • 2.1.11 基本配置
          • 2.1.12 升级Ubuntu pro
          • 2.1.13 开启ssh服务
          • 2.1.14 服务快照
          • 2.1.15 系统自动执行安装
          • 2.1.16 重启
          • 2.1.17 登录系统
          • 2.1.18 进入系统
      • 三、系统设置
        • 3.1 安装网络管理工具
        • 3.2 配置ip
          • 3.2.1 进入到/etc/netplan/
          • 3.2.2 备份网卡配置文件
          • 3.2.3 查看网卡别名
          • 3.2.4 修改网卡配置文件
          • 3.2.5 重启网卡
        • 3.3 重启服务器

Ubuntu Server 22.04.5 从零到一:详尽安装部署指南

一、部署环境

名称软件版本号
操作系统Ubuntu Server22.04.5

二、安装系统

2.1 安装
2.1.1 选择安装方式

安装方式,选第一条。

image-20241114170752862

2.1.2 选择语言

建议英语,报错时比较好百度,中文版报错不容易搜索。

image-20241114171153757

2.1.3 选择不更新

image-20241114171510070

2.1.4 选择键盘标准

默认即可。

image-20241114173340237

2.1.5 选择安装版本

选择安装版本为标准server,键盘方向键控制光标,空格键选中。

image-20241114173453498

2.1.6 设置网卡

联网环境下稍稍等待一下,即可自动获取到IP地址。

image-20241114173545560

2.1.7 配置代理

没特殊需求不用理,直接下一步。

image-20241114173647636

2.1.8 设置镜像源

后面可以设置,这里直接下一步。

image-20241114173737222

2.1.9 选择装系统的硬盘

多块硬盘时需要进行选择。

image-20241114173856263

2.1.10 硬盘分区

默认即可。

image-20241114174010125

image-20241114174108944

2.1.11 基本配置

设置名字、主机名、用户名,设置用户名密码。

image-20241114174529043

2.1.12 升级Ubuntu pro

不升级,选择跳过。(默认选项即是跳过。Skip)

image-20241114174620666

2.1.13 开启ssh服务

这个建议开启,否则还需进系统修改,比较麻烦。空格选中。

image-20241114174916177

2.1.14 服务快照

这里不做选择,直接下一步。

image-20241114174955738

2.1.15 系统自动执行安装

等待进度结束,点击重启即可。

image-20241114175034240

2.1.16 重启

点击重启,等待服务器自动重启。

image-20241114175541450

2.1.17 登录系统

输入先前自己设置的用户名与密码。密码为不可见状态,输入完直接Enter。

image-20241114175915490

2.1.18 进入系统

image-20241114175956769

三、系统设置

进入系统后可使用ip add命令查看现有ip与网卡名称,再通过终端工具连接,我使用SecureCRT进行连接。

3.1 安装网络管理工具
superman@k8s-master:~$ sudo apt install net-tools
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:net-tools
0 upgraded, 1 newly installed, 0 to remove and 14 not upgraded.
Need to get 204 kB of archives.
After this operation, 819 kB of additional disk space will be used.
Get:1 http://cn.archive.ubuntu.com/ubuntu jammy/main amd64 net-tools amd64 1.60+git20181103.0eebece-1ubuntu5 [204 kB]
Fetched 204 kB in 1s (256 kB/s)   
Selecting previously unselected package net-tools.
(Reading database ... 74796 files and directories currently installed.)
Preparing to unpack .../net-tools_1.60+git20181103.0eebece-1ubuntu5_amd64.deb ...
Unpacking net-tools (1.60+git20181103.0eebece-1ubuntu5) ...
Setting up net-tools (1.60+git20181103.0eebece-1ubuntu5) ...
Processing triggers for man-db (2.10.2-1) ...
Scanning processes...                                                                                                      
Scanning linux images...                                                                                                   Running kernel seems to be up-to-date.No services need to be restarted.No containers need to be restarted.No user sessions are running outdated binaries.No VM guests are running outdated hypervisor (qemu) binaries on this host.
superman@k8s-master:~$ 
3.2 配置ip
3.2.1 进入到/etc/netplan/
superman@k8s-master:~$ cd /etc/netplan/
superman@k8s-master:/etc/netplan$ 
superman@k8s-master:/etc/netplan$ ls
50-cloud-init.yaml
superman@k8s-master:/etc/netplan$
3.2.2 备份网卡配置文件

此目录下有一个为.yaml的文件,此文件为网卡配置文件,修改现有配置文件名称为.bak如:50-cloud-init.yaml修改为50-cloud-init.yaml.bak

superman@k8s-master:/etc/netplan$ sudo mv 50-cloud-init.yaml 50-cloud-init.yaml.bak
[sudo] password for superman: 
superman@k8s-master:/etc/netplan$ 
3.2.3 查看网卡别名
superman@k8s-master:/etc/netplan$ ifconfig 
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500inet 192.168.1.129  netmask 255.255.255.0  broadcast 192.168.1.255inet6 fe80::20c:29ff:fe1b:4d1  prefixlen 64  scopeid 0x20<link>ether 00:0c:29:1b:04:d1  txqueuelen 1000  (Ethernet)RX packets 2089  bytes 732805 (732.8 KB)RX errors 0  dropped 0  overruns 0  frame 0TX packets 1371  bytes 248989 (248.9 KB)TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536inet 127.0.0.1  netmask 255.0.0.0inet6 ::1  prefixlen 128  scopeid 0x10<host>loop  txqueuelen 1000  (Local Loopback)RX packets 200  bytes 16264 (16.2 KB)RX errors 0  dropped 0  overruns 0  frame 0TX packets 200  bytes 16264 (16.2 KB)TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0superman@k8s-master:/etc/netplan$
3.2.4 修改网卡配置文件
superman@k8s-master:/etc/netplan$ sudo vim 01-netcfg.yaml
network:version: 2renderer: networkdethernets:ens33:dhcp4: noaddresses:- 192.168.1.131/24gateway4: 192.168.1.1nameservers:addresses: [202.102.224.68,202.102.227.68]

保存退出–先按一下esc,然后输入“:wq”点击“Enter”。

说明:
ens33 —为服务器的网卡名称。
192.168.1.131/24 —为此台服务器的ip/子网掩码。
gateway4: 192.168.1.1 —网关。
addresses: [202.102.224.68,202.102.227.68] —是DNS,不需要连外网可以不设。

3.2.5 重启网卡
superman@k8s-master:/etc/netplan$ sudo netplan apply** (generate:2340): WARNING **: 11:02:18.289: Permissions for /etc/netplan/01-netcfg.yaml are too open. Netplan configuration should NOT be accessible by others.** (generate:2340): WARNING **: 11:02:18.289: `gateway4` has been deprecated, use default routes instead.
See the 'Default routes' section of the documentation for more details.
WARNING:root:Cannot call Open vSwitch: ovsdb-server.service is not running.** (process:2338): WARNING **: 11:02:18.709: Permissions for /etc/netplan/01-netcfg.yaml are too open. Netplan configuration should NOT be accessible by others.** (process:2338): WARNING **: 11:02:18.709: `gateway4` has been deprecated, use default routes instead.
See the 'Default routes' section of the documentation for more details.** (process:2338): WARNING **: 11:02:19.022: Permissions for /etc/netplan/01-netcfg.yaml are too open. Netplan configuration should NOT be accessible by others.** (process:2338): WARNING **: 11:02:19.022: `gateway4` has been deprecated, use default routes instead.
See the 'Default routes' section of the documentation for more details.** (process:2338): WARNING **: 11:02:19.022: Permissions for /etc/netplan/01-netcfg.yaml are too open. Netplan configuration should NOT be accessible by others.** (process:2338): WARNING **: 11:02:19.022: `gateway4` has been deprecated, use default routes instead.
See the 'Default routes' section of the documentation for more details.
superman@k8s-master:/etc/netplan$ 
superman@k8s-master:/etc/netplan$ ifconfig -a
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500inet 192.168.1.131  netmask 255.255.255.0  broadcast 192.168.1.255inet6 fe80::20c:29ff:fe1b:4d1  prefixlen 64  scopeid 0x20<link>ether 00:0c:29:1b:04:d1  txqueuelen 1000  (Ethernet)RX packets 6208  bytes 1186753 (1.1 MB)RX errors 0  dropped 0  overruns 0  frame 0TX packets 4710  bytes 932202 (932.2 KB)TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536inet 127.0.0.1  netmask 255.0.0.0inet6 ::1  prefixlen 128  scopeid 0x10<host>loop  txqueuelen 1000  (Local Loopback)RX packets 200  bytes 16264 (16.2 KB)RX errors 0  dropped 0  overruns 0  frame 0TX packets 200  bytes 16264 (16.2 KB)TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0superman@k8s-master:~$ 
3.3 重启服务器
superman@k8s-master:/etc/netplan$ sudo reboot

原文链接:https://mp.weixin.qq.com/s/RXTCuWTj-mP2fXZ5qFx6MA

👍 点赞,你的认可是我创作的动力!

⭐️ 收藏,你的青睐是我努力的方向!

✏️ 评论,你的意见是我进步的财富!

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

http://www.lryc.cn/news/494577.html

相关文章:

  • 反射机制了解
  • 机器学习策略Ⅰ
  • redis中的bigkey及读取优化
  • 【西瓜书】支持向量机(SVM)
  • 三维渲染中顺序无关的半透明混合(OIT)(二——Stencil Route)
  • (SAST检测规则-3)固定的 SessionID 缺陷详解
  • 【安卓开发】【Android Studio】项目构建(Build)时报错:Integer Overflow
  • STM32主要功能
  • MacOS 如何连接 Linux NFS 服务器
  • 【英特尔IA-32架构软件开发者开发手册第3卷:系统编程指南】2001年版翻译,2-39
  • 摄影相关常用名词
  • 02.06、回文链表
  • Shell脚本小练习
  • 四轮转向轮式里程计设计(python)
  • 多方法做配对样本t检验(三)
  • Vue 将推出「无虚拟DOM」版本,又是新的前端框架趋势?
  • 阿里云ECS服务器磁盘空间不足的几个文件
  • 从0开始linux(38)——线程(1)线程概念
  • Ubuntu源码安装gitlab13.7集群多前端《二》
  • 身份证OCR 识别 API 接口的发展前景
  • Spring boot之BeanDefinition介绍
  • 30分钟学会正则表达式
  • Python 自动化办公的 10 大脚本
  • Python蒙特卡罗MCMC:优化Metropolis-Hastings采样策略Fisher矩阵计算参数推断应用—模拟与真实数据...
  • 成绩排序
  • MySQL底层概述—7.优化原则及慢查询
  • R““有什么作用在C++中,举例说明
  • linux中top 命令返回数据解释
  • 深入理解二叉树及其变体:平衡二叉树、红黑树、B-树和B+树
  • C++ 编程技巧之StrongType(1)