【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
相关推荐
4***17549 小时前
Linux 下安装 Golang环境
linux·运维·golang
Lenyiin9 小时前
《 Linux 修炼全景指南: 七 》 指尖下的利刃:深入理解 Vim 的高效世界
linux·运维·服务器·vim·lenyiin
sulikey11 小时前
Linux基础指令与权限管理深度解析:从入门到精通
linux·运维·服务器·ubuntu·centos·linux命令·linux权限
qq_21539789711 小时前
docker 安装 opengauss 高斯数据库
运维·docker·容器
s***469812 小时前
linux 设置tomcat开机启动
linux·运维·tomcat
r***F26212 小时前
若依部署Nginx和Tomcat
运维·nginx·tomcat
HalvmånEver13 小时前
Linux:进程的切换与调度(进程四)
linux·运维·服务器
运维有小邓@13 小时前
实时日志关联分析工具:智能检测潜在安全威胁
运维·网络·安全
谷隐凡二14 小时前
Docker 的核心理念及技术的简单说明
运维·docker·容器
daqinzl14 小时前
Docker 安装 Ubuntu
ubuntu·docker