【DevOps】基于Nexus部署内网ubuntu 2204系统APT代理镜像仓库操作手册

Nexus3 创建代理

创建仓库,选择apt(proxy)

Name: ubuntu2204-apt-proxy

APT Settings:

​ Distribution:jammy

Proxy:

​ Remote storage: https://mirrors.aliyun.com/ubuntu

点击Create Repository

客户端配置

备份sources.list

复制代码
mv /etc/apt/sources.list /etc/apt/sources.list.bak

创建配置文件

复制代码
vim /etc/apt/sources.list

输入内容

复制代码
deb http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy/ jammy main restricted universe multiverse
deb-src http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy/ jammy main restricted universe multiverse

deb http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy/ jammy-security main restricted universe multiverse
deb-src http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy/ jammy-security main restricted universe multiverse

deb http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy/ jammy-updates main restricted universe multiverse
deb-src http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy/ jammy-updates main restricted universe multiverse

# deb http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy/ jammy-proposed main restricted universe multiverse
# deb-src http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy/ jammy-proposed main restricted universe multiverse

deb http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy/ jammy-backports main restricted universe multiverse
deb-src http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy/ jammy-backports main restricted universe multiverse

apt update

复制代码
root@9631cf6427f5:/# apt update
Get:1 http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy jammy InRelease [270 kB]
Get:2 http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy jammy-security InRelease [129 kB]
Get:3 http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy jammy-updates InRelease [128 kB]
Get:4 http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy jammy-backports InRelease [127 kB]
Get:5 http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy jammy/restricted Sources [28.2 kB]
Ign:6 http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy jammy/universe Sources
Get:7 http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy jammy/main Sources [1668 kB]
Get:8 http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy jammy/multiverse Sources [361 kB]
Get:9 http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy jammy/restricted amd64 Packages [164 kB]
Get:10 http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy jammy/main amd64 Packages [1792 kB]
Get:11 http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy jammy/multiverse amd64 Packages [266 kB]
Get:12 http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy jammy/universe amd64 Packages [17.5 MB]
Get:13 http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy jammy-security/multiverse Sources [27.6 kB]
Get:14 http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy jammy-security/restricted Sources [104 kB]
Get:15 http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy jammy-security/universe Sources [388 kB]
Get:16 http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy jammy-security/main Sources [407 kB]
Get:17 http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy jammy-security/multiverse amd64 Packages [71.0 kB]
Get:18 http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy jammy-security/restricted amd64 Packages [5742 kB]
Get:19 http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy jammy-security/universe amd64 Packages [1279 kB]
Get:20 http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy jammy-security/main amd64 Packages [3429 kB]
Get:21 http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy jammy-updates/universe Sources [596 kB]
Get:22 http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy jammy-updates/multiverse Sources [39.3 kB]
Get:23 http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy jammy-updates/restricted Sources [108 kB]
Get:24 http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy jammy-updates/main Sources [713 kB]
Get:25 http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy jammy-updates/main amd64 Packages [3778 kB]
Get:26 http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy jammy-updates/multiverse amd64 Packages [69.2 kB]
Get:27 http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy jammy-updates/restricted amd64 Packages [5988 kB]
Get:28 http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy jammy-updates/universe amd64 Packages [1586 kB]
Get:29 http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy jammy-backports/main Sources [10.3 kB]
Get:30 http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy jammy-backports/universe Sources [11.7 kB]
Get:31 http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy jammy-backports/main amd64 Packages [83.9 kB]
Get:32 http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy jammy-backports/universe amd64 Packages [35.2 kB]
Get:6 http://10.2.0.100:8081/nexus/repository/ubuntu2204-apt-proxy jammy/universe Sources [22.0 MB]
Fetched 68.8 MB in 3min 34s (322 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
2 packages can be upgraded. Run 'apt list --upgradable' to see them.

apt install

复制代码
root@9631cf6427f5:/# apt install gcc -y

附:不同版本系统Distribution对应关系表

Ubuntu 发行版 Distribution 字段值 (通常)
Ubuntu 20.04 focal
Ubuntu 18.04 bionic
Ubuntu 22.04 jammy
Ubuntu 24.04 noble
相关推荐
怪异的bug6 小时前
DevOps学习笔记
devops
hkNaruto6 小时前
【DevOps】基于Nexus3部署Docker内网私有代理仓库docker proxy
docker·devops·nexus3
JanelSirry6 小时前
DevOps是什么,有什么作用,一般用来干嘛
linux·运维·devops
残影飞雪6 小时前
jetson orin nano 部署FastDeploy
ubuntu
老坛程序员6 小时前
Coze 与 n8n 深度对比:AI智能体平台与工作流自动化的核心博弈
运维·人工智能·自动化
Zz_waiting.6 小时前
多机部署,负载均衡
运维·负载均衡
玉树临风江流儿15 小时前
Linux驱动开发总结速记
linux·运维·驱动开发
七宝大爷16 小时前
GPU服务器深度解析:H100/H200的“机头”与“模组”架构详解
运维·服务器·架构·h100·h200
A-花开堪折17 小时前
Qemu 嵌入式Linux驱动开发
linux·运维·驱动开发