Loading... # 配置 Ubuntu 24.04 模版机 ## 一、下载 24.04 Server Arm 镜像 Ubuntu官网:https://cn.ubuntu.com/ 123网盘:https://www.123865.com/s/lfKDVv-j9mNH?提取码:YYDS ## 二、开启 root 用户 切换用户: ```bash sudo su ``` 给`root`用户添加密码: ```bash passwd root ``` 开通`root`远程登录: ```bash vim /etc/ssh/sshd_config PermitRootLogin yes # 改为yes ``` ## 三、静态ip地址设置 **编辑网卡文件:** ```bash vim /etc/netplan/< 替*换 >-cloud-init.yaml ``` **添加以下配置:** ```yaml network: version: 2 renderer: networkd ethernets: ens160: dhcp4: no addresses: - 192.168.10.3/24 routes: - to: 0.0.0.0/0 via: 192.168.10.2 nameservers: addresses: - 8.8.8.8 - 233.5.5.5 ``` 默认: ```bash # This file is generated from information provided by the datasource. Changes # to it will not persist across an instance reboot. To disable cloud-init's # network configuration capabilities, write a file # /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following: # network: {config: disabled} network: ethernets: ens160: dhcp4: true version: 2 ``` 使网卡配置生效: ``` netplan apply ``` ## 四、设置时区 查看当前时间: ```bash date ``` 设置上海时区: ```bash sudo timedatectl set-timezone Asia/Shanghai ``` ## 五、换阿里 apt 源 备份官方源 ```bash sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak ``` 编辑源配置: ```bash sudo vim /etc/apt/sources.list ``` 阿里`24.04 ARM64 apt` 源配置,更多查看[阿里源配置文档](https://developer.aliyun.com/mirror/ubuntu-ports?spm=a2c6h.13651104.d-1008.3.7e5f4763UX0i7O): ```bash deb https://mirrors.aliyun.com/ubuntu-ports/ noble main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu-ports/ noble main restricted universe multiverse deb https://mirrors.aliyun.com/ubuntu-ports/ noble-security main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu-ports/ noble-security main restricted universe multiverse deb https://mirrors.aliyun.com/ubuntu-ports/ noble-updates main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu-ports/ noble-updates main restricted universe multiverse # deb https://mirrors.aliyun.com/ubuntu-ports/ noble-proposed main restricted universe multiverse # deb-src https://mirrors.aliyun.com/ubuntu-ports/ noble-proposed main restricted universe multiverse deb https://mirrors.aliyun.com/ubuntu-ports/ noble-backports main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu-ports/ noble-backports main restricted universe multiverse ``` 更新源和软件包: ```bash sudo apt update && sudo apt upgrade -y ``` 安装常用命令: ```bash sudo apt install -y wget git ``` 最后修改:2025 年 02 月 12 日 © 允许规范转载 打赏 赞赏作者 赞 咱们谁跟谁,用不着~