【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
相关推荐
碳基沙盒21 小时前
OpenClaw 多 Agent 配置实战指南
运维
小飞程序员4 天前
Docker本地部署gitlab实践(windows,linux)
devops
蝎子莱莱爱打怪4 天前
Centos7中一键安装K8s集群以及Rancher安装记录
运维·后端·kubernetes
DianSan_ERP4 天前
电商API接口全链路监控:构建坚不可摧的线上运维防线
大数据·运维·网络·人工智能·git·servlet
呉師傅5 天前
火狐浏览器报错配置文件缺失如何解决#操作技巧#
运维·网络·windows·电脑
不是二师兄的八戒5 天前
Linux服务器挂载OSS存储的完整实践指南
linux·运维·服务器
欧云服务器5 天前
怎么让脚本命令可以同时在centos、debian、ubuntu执行?
ubuntu·centos·debian
智渊AI5 天前
Ubuntu 20.04/22.04 下通过 NVM 安装 Node.js 22(LTS 稳定版)
ubuntu·node.js·vim
zhangfeng11335 天前
趋动云 如何ssh登录 服务区 项目server
运维·人工智能·ssh
ZeroNews内网穿透5 天前
谷歌封杀OpenClaw背后:本地部署或是出路
运维·服务器·数据库·安全