当前位置: 代码网 > 服务器>服务器>Linux > Ubuntu Server 22.04.5 入门篇:详尽安装部署指南

Ubuntu Server 22.04.5 入门篇:详尽安装部署指南

2025年03月05日 Linux 我要评论
ubuntu server 22.04.5 从零到一:详尽安装部署指南一、部署环境名称软件版本号操作系统ubuntu server22.04.5二、安装系统2.1 安装2.1.1 选择安装方式安装方式

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 1500
        inet 192.168.1.129  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 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 0
        tx packets 1371  bytes 248989 (248.9 kb)
        tx errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<up,loopback,running>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::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 0
        tx packets 200  bytes 16264 (16.2 kb)
        tx errors 0  dropped 0 overruns 0  carrier 0  collisions 0

superman@k8s-master:/etc/netplan$

3.2.4 修改网卡配置文件

superman@k8s-master:/etc/netplan$ sudo vim 01-netcfg.yaml
network:
  version: 2
  renderer: networkd
  ethernets:
    ens33:
      dhcp4: no
      addresses:
        - 192.168.1.131/24
      gateway4: 192.168.1.1
      nameservers:
        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 1500
        inet 192.168.1.131  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 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 0
        tx packets 4710  bytes 932202 (932.2 kb)
        tx errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<up,loopback,running>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::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 0
        tx packets 200  bytes 16264 (16.2 kb)
        tx errors 0  dropped 0 overruns 0  carrier 0  collisions 0

superman@k8s-master:~$ 

3.3 重启服务器

到此这篇关于ubuntu server 22.04.5 入门篇:详尽安装部署指南的文章就介绍到这了,更多相关ubuntu server安装部署内容请搜索代码网以前的文章或继续浏览下面的相关文章希望大家以后多多支持代码网!

(0)

相关文章:

  • Linux搜索文件和文件夹的四种简单方法

    Linux搜索文件和文件夹的四种简单方法

    引言linux管理员一天都不能离开搜索文件,因为这是他们的日常活动。了解一些搜索的东西是不错的,因为这能帮助你在命令行服务器中工作。这些命令记忆起来不复杂,因为... [阅读全文]
  • linux之source.list的使用解析

    linux source.list的使用众所周知,linux可以通过apt命令安装软件,那么apt又是从哪里获取软件包呢并安装呢?这里就绕不开一个文件source.list,该文件…

    2025年03月04日 服务器
  • Linux系统之authconfig命令的使用解读

    Linux系统之authconfig命令的使用解读

    linux authconfig命令的使用authconfig 是一个用于配置 linux 系统身份验证和账户管理设置的命令行工具,主要用于 red hat 系... [阅读全文]
  • Nginx实现高并发的项目实践

    Nginx实现高并发的项目实践

    nginx是一款轻量级的web和反向代理服务器,它以其高性能、稳定性、丰富的特性集、简单的配置以及低资源消耗而闻名。nginx能有效地处理高并发连接,这得益于它... [阅读全文]
  • Linux使用tcpdump进行网络分析详解

    Linux使用tcpdump进行网络分析详解

    简介tcpdump 是一个命令行数据包分析器,可实时捕获和检查网络流量。它通常用于网络故障排除、性能分析和安全监控。安装debian/ubuntusudo ap... [阅读全文]
  • Linux之权限管理解读

    linux 下有两种用户:超级用户( root )、普通用户。超级用户:可以再linux系统下做任何事情,不受限制普通用户:在linux下做有限的事情。超级用户的命令提示符是&ld…

    2025年03月07日 服务器

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

验证码:
Copyright © 2017-2025  代码网 保留所有权利. 粤ICP备2024248653号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com