站点图标 Linux-技术共享

Ubuntu server 22.04 系统安装

09e0a8312fae40ad98bc0f029a25bcc0

 

1|01.Ubuntu系统镜像下载

【Ubuntu官网下载】

2|02.使用workstation安装Ubuntu 22.04

选择下载的镜像,创建安装Ubuntu系统

语言选择

系统更新安装(回车即可)

网络配置(默认即可,也可手动配置,新手建议手动配置一下,熟悉一下环境)

手动配置网络(选择手动模式)上下键选择,回车确认即可

手动配置网络(选择save,保存当前配置)

确认手动配置的网络地址,选择done,回车即可

代理选择(默认即可,回车)

配置系统更新源,默认为ubuntu官方源,(可手动填写其他国内源,如阿里云,华为等)

系统配置磁盘分区(默认选择全部分区 )

磁盘分区配置确认

选择Continue继续下一步

配置系统用户设置

安装openssh远程连接工具

信息确认及配置

安装中

我们也可以查看完整的安装日志

更新完成后,输入注册账户登录即可:zeny


3|03.远程连接ubuntu

使用远程连接工具连接uubuntu系统(默认不支持root远程连接)

更改root账户密码,使用root登录ubuntu系统

4|04.修改软件管理仓库

常用的镜像仓库:
【阿⾥云镜像仓库】
【华为镜像仓库】
【清华⼤学镜像仓库】

 

#ubuntu默认软件管理仓库地址 root@ubuntu:~# egrep "^[^#]" /etc/apt/sources.list deb http://cn.archive.ubuntu.com/ubuntu jammy main restricted deb http://cn.archive.ubuntu.com/ubuntu jammy-updates main restricted deb http://cn.archive.ubuntu.com/ubuntu jammy universe deb http://cn.archive.ubuntu.com/ubuntu jammy-updates universe deb http://cn.archive.ubuntu.com/ubuntu jammy multiverse deb http://cn.archive.ubuntu.com/ubuntu jammy-updates multiverse deb http://cn.archive.ubuntu.com/ubuntu jammy-backports main restricted universe multiverse deb http://cn.archive.ubuntu.com/ubuntu jammy-security main restricted deb http://cn.archive.ubuntu.com/ubuntu jammy-security universe deb http://cn.archive.ubuntu.com/ubuntu jammy-security multiverse #修改默认软件仓库(预发布软件仓库源,下载很慢,不建议使用的,替换为国内的软件仓库) root@ubuntu:~# sed -i 's/cn.archive.ubuntu/mirrors.aliyun/' /etc/apt/sources.list root@ubuntu:~# egrep "^[^#]" /etc/apt/sources.list deb http://mirrors.aliyun.com/ubuntu jammy main restricted deb http://mirrors.aliyun.com/ubuntu jammy-updates main restricted deb http://mirrors.aliyun.com/ubuntu jammy universe deb http://mirrors.aliyun.com/ubuntu jammy-updates universe deb http://mirrors.aliyun.com/ubuntu jammy multiverse deb http://mirrors.aliyun.com/ubuntu jammy-updates multiverse deb http://mirrors.aliyun.com/ubuntu jammy-backports main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu jammy-security main restricted deb http://mirrors.aliyun.com/ubuntu jammy-security universe deb http://mirrors.aliyun.com/ubuntu jammy-security multiverse

5|05.更新ubuntu系统

 

#更新软件仓库,创建链接 root@ubuntu:~# apt update Get:1 http://mirrors.aliyun.com/ubuntu jammy InRelease [270 kB] Get:2 http://mirrors.aliyun.com/ubuntu jammy-updates InRelease [109 kB] Get:3 http://mirrors.aliyun.com/ubuntu jammy-backports InRelease [99.8 kB] Get:4 http://mirrors.aliyun.com/ubuntu jammy-security InRelease [110 kB] Get:5 http://mirrors.aliyun.com/ubuntu jammy/main amd64 Packages [1,395 kB] Get:6 http://mirrors.aliyun.com/ubuntu jammy/main Translation-en [510 kB] Get:7 http://mirrors.aliyun.com/ubuntu jammy/main amd64 c-n-f Metadata [30.3 kB] Get:8 http://mirrors.aliyun.com/ubuntu jammy/restricted amd64 Packages [129 kB] Get:9 http://mirrors.aliyun.com/ubuntu jammy/restricted Translation-en [18.6 kB] Get:10 http://mirrors.aliyun.com/ubuntu jammy/restricted amd64 c-n-f Metadata [488 B] Get:11 http://mirrors.aliyun.com/ubuntu jammy/universe amd64 Packages [14.1 MB] Get:12 http://mirrors.aliyun.com/ubuntu jammy/universe Translation-en [5,652 kB] Get:13 http://mirrors.aliyun.com/ubuntu jammy/universe amd64 c-n-f Metadata [286 kB] Get:14 http://mirrors.aliyun.com/ubuntu jammy/multiverse amd64 Packages [217 kB] Get:15 http://mirrors.aliyun.com/ubuntu jammy/multiverse Translation-en [112 kB] Get:16 http://mirrors.aliyun.com/ubuntu jammy/multiverse amd64 c-n-f Metadata [8,372 B] Get:17 http://mirrors.aliyun.com/ubuntu jammy-updates/main amd64 Packages [277 kB] Get:18 http://mirrors.aliyun.com/ubuntu jammy-updates/main Translation-en [68.2 kB] Get:19 http://mirrors.aliyun.com/ubuntu jammy-updates/main amd64 c-n-f Metadata [4,840 B] Get:20 http://mirrors.aliyun.com/ubuntu jammy-updates/restricted amd64 Packages [165 kB] Get:21 http://mirrors.aliyun.com/ubuntu jammy-updates/restricted Translation-en [25.0 kB] Get:22 http://mirrors.aliyun.com/ubuntu jammy-updates/restricted amd64 c-n-f Metadata [460 B] Get:23 http://mirrors.aliyun.com/ubuntu jammy-updates/universe amd64 Packages [116 kB] Get:24 http://mirrors.aliyun.com/ubuntu jammy-updates/universe Translation-en [40.1 kB] Get:25 http://mirrors.aliyun.com/ubuntu jammy-updates/universe amd64 c-n-f Metadata [2,344 B] Get:26 http://mirrors.aliyun.com/ubuntu jammy-updates/multiverse amd64 Packages [4,192 B] Get:27 http://mirrors.aliyun.com/ubuntu jammy-updates/multiverse Translation-en [900 B] Get:28 http://mirrors.aliyun.com/ubuntu jammy-updates/multiverse amd64 c-n-f Metadata [232 B] Get:29 http://mirrors.aliyun.com/ubuntu jammy-backports/main amd64 c-n-f Metadata [112 B] Get:30 http://mirrors.aliyun.com/ubuntu jammy-backports/restricted amd64 c-n-f Metadata [116 B] Get:31 http://mirrors.aliyun.com/ubuntu jammy-backports/universe amd64 Packages [2,036 B] Get:32 http://mirrors.aliyun.com/ubuntu jammy-backports/universe Translation-en [7,012 B] Get:33 http://mirrors.aliyun.com/ubuntu jammy-backports/universe amd64 c-n-f Metadata [216 B] Get:34 http://mirrors.aliyun.com/ubuntu jammy-backports/multiverse amd64 c-n-f Metadata [116 B] Get:35 http://mirrors.aliyun.com/ubuntu jammy-security/main amd64 Packages [159 kB] Get:36 http://mirrors.aliyun.com/ubuntu jammy-security/main Translation-en [39.2 kB] Get:37 http://mirrors.aliyun.com/ubuntu jammy-security/main amd64 c-n-f Metadata [2,600 B] Get:38 http://mirrors.aliyun.com/ubuntu jammy-security/restricted amd64 Packages [148 kB] Get:39 http://mirrors.aliyun.com/ubuntu jammy-security/restricted Translation-en [22.4 kB] Get:40 http://mirrors.aliyun.com/ubuntu jammy-security/restricted amd64 c-n-f Metadata [464 B] Get:41 http://mirrors.aliyun.com/ubuntu jammy-security/universe amd64 Packages [68.1 kB] Get:42 http://mirrors.aliyun.com/ubuntu jammy-security/universe Translation-en [22.3 kB] Get:43 http://mirrors.aliyun.com/ubuntu jammy-security/universe amd64 c-n-f Metadata [1,128 B] Get:44 http://mirrors.aliyun.com/ubuntu jammy-security/multiverse amd64 Packages [4,192 B] Get:45 http://mirrors.aliyun.com/ubuntu jammy-security/multiverse Translation-en [900 B] Get:46 http://mirrors.aliyun.com/ubuntu jammy-security/multiverse amd64 c-n-f Metadata [228 B] Fetched 24.2 MB in 2min 48s (144 kB/s) Reading package lists... Done Building dependency tree... Done Reading state information... Done 20 packages can be upgraded. Run 'apt list --upgradable' to see them. root@ubuntu:~# #系统软件包更新 root@ubuntu:~# apt upgrade Reading package lists... Done Building dependency tree... Done Reading state information... Done Calculating upgrade... Done The following packages will be upgraded: base-files cloud-init libjson-c5 libnss-systemd libpam-systemd libssl3 libsystemd0 libudev1 libusb-1.0-0 motd-news-config openssl python3-distupgrade python3-software-properties software-properties-common systemd systemd-sysv systemd-timesyncd ubuntu-advantage-tools ubuntu-release-upgrader-core udev 20 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 11.6 MB of archives. After this operation, 84.0 kB of additional disk space will be used. Do you want to continue? [Y/n] y .... ...
 
 

 

#apt常用命令 apt list #apt列出仓库软件包,等于yum list apt update #更新本地软件包列表索引,修改了apt仓库后必须执⾏ apt upgrade #升级所有已安装且可升级到新版本的软件包 apt search NAME #搜索安装包 apt purge apache2 #卸载单个软件包删除配置⽂件 apt show apache2 #查看某个安装包的详细信息 apt install apache2 #在线安装软件包 apt remove apache2 #卸载单个软件包但是保留配置⽂件 apt autoremove apache2 #删除安装包并解决依赖关系 apt full-upgrade #升级整个系统,必要时可以移除旧软件包。 apt edit-sources #编辑source源⽂件 apt-cache madison nginx #查看仓库中软件包有哪些版本可以安装 apt install nginx=1.14.0-0ubuntu1.6 #安装软件包的时候指定安装具体的版本
退出移动版