【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
相关推荐
工具人555515 分钟前
Linux 抓取 RAM Dump 完整指南
linux·运维·安全
会飞的小蛮猪24 分钟前
SkyWalking运维之路(Java探针接入)
java·运维·经验分享·容器·skywalking
不懂音乐的欣赏者34 分钟前
Windows 下 ROS/ROS2 开发环境最优解:WSL 比直接安装、虚拟机、双系统更优雅!
linux·windows·ubuntu·ros·wsl·ros2·双系统
天一生水water1 小时前
docker-compose安装
运维·docker·容器
Archy_Wang_12 小时前
基于BaGet 构建NuGet私有库并实现类库打包到NuGet私有库
运维·jenkins
初听于你2 小时前
运维高级故障排除与恢复-SysRq
运维·服务器·安全
RPA机器人就用八爪鱼2 小时前
RPA自动化程序:企业数字化转型的智能引擎
运维·自动化·rpa
demodashi6663 小时前
Linux下ag搜索命令详解
linux·运维·windows
無识3 小时前
Linux-第四章web服务
linux·运维·服务器
fie88893 小时前
在CentOS 7上集成cJSON库的方法
linux·运维·centos