【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
相关推荐
春日见15 分钟前
如何跑通,吃透一个开源项目?
linux·运维·开发语言·数码相机·matlab
Blueeyedboy52117 分钟前
服务器监控工具-netdata
运维·服务器
hkNaruto21 分钟前
【docker】docker exec -it 报错 open /dev/pts/0: operation not permitted
运维·docker·容器
TG:@yunlaoda360 云老大23 分钟前
华为云国际站代理商DSS的跨区域备份与恢复具体是如何实现的?
运维·服务器·华为云
Ccjf酷儿29 分钟前
计算机网络 (郑烇) 2 应用层
运维·服务器·计算机网络
寰天柚子33 分钟前
服务器性能优化实战:从资源瓶颈定位到极致调优(附租赁服务器适配指南)
运维·服务器·udp
AAA_bo135 分钟前
liunx安装canda、python、nodejs、git,随后部署私有网页内容提取工具--JinaReader全攻略
linux·python·ubuntu·typescript·aigc·python3.11·jina
未来之窗软件服务39 分钟前
服务器运维(十九)web服务管理Nginx UI介绍——东方仙盟炼气期
运维·服务器·服务器运维·东方仙盟
梦想的旅途243 分钟前
企业微信外部群消息自动化:模拟操作与工程化实现路径探讨
运维·服务器
代码游侠1 小时前
学习笔记——Linux进程间通信(IPC)
linux·运维·笔记·学习·算法