Ubuntu中apt更新时报错The certificate issuer is unknown的解决办法

Ubuntu 22.04更新apt出现The certificate issuer is unknown的解决办法

  • 问题描述
  • 解决办法
  • 讨论

问题描述

使用docker安装Ubuntu22.04,官网给出的镜像只是一个裸系统,预装软件很少。换阿里源以后,apt update,出现如下报错:

# apt update
Ign:1 https://mirrors.aliyun.com/ubuntu-ports jammy InRelease
Ign:2 https://mirrors.aliyun.com/ubuntu-ports jammy-security InRelease
Ign:3 https://mirrors.aliyun.com/ubuntu-ports jammy-updates InRelease
Ign:4 https://mirrors.aliyun.com/ubuntu-ports jammy-backports InRelease
Ign:1 https://mirrors.aliyun.com/ubuntu-ports jammy InRelease
Ign:2 https://mirrors.aliyun.com/ubuntu-ports jammy-security InRelease
Ign:3 https://mirrors.aliyun.com/ubuntu-ports jammy-updates InRelease
Ign:4 https://mirrors.aliyun.com/ubuntu-ports jammy-backports InRelease
Ign:1 https://mirrors.aliyun.com/ubuntu-ports jammy InRelease
Ign:2 https://mirrors.aliyun.com/ubuntu-ports jammy-security InRelease
Ign:3 https://mirrors.aliyun.com/ubuntu-ports jammy-updates InRelease
Ign:4 https://mirrors.aliyun.com/ubuntu-ports jammy-backports InRelease
Err:1 https://mirrors.aliyun.com/ubuntu-ports jammy InReleaseCertificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown.  Could not handshake: Error in the certificate verification. [IP: 222.192.186.76 443]
Err:2 https://mirrors.aliyun.com/ubuntu-ports jammy-security InReleaseCertificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown.  Could not handshake: Error in the certificate verification. [IP: 222.192.186.77 443]
Err:3 https://mirrors.aliyun.com/ubuntu-ports jammy-updates InReleaseCertificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown.  Could not handshake: Error in the certificate verification. [IP: 222.192.186.76 443]
Err:4 https://mirrors.aliyun.com/ubuntu-ports jammy-backports InReleaseCertificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown.  Could not handshake: Error in the certificate verification. [IP: 222.192.186.77 443]
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
W: https://mirrors.aliyun.com/ubuntu-ports/dists/jammy/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.aliyun.com/ubuntu-ports/dists/jammy-security/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.aliyun.com/ubuntu-ports/dists/jammy-updates/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.aliyun.com/ubuntu-ports/dists/jammy-backports/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.aliyun.com/ubuntu-ports/dists/jammy/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.aliyun.com/ubuntu-ports/dists/jammy-security/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.aliyun.com/ubuntu-ports/dists/jammy-updates/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.aliyun.com/ubuntu-ports/dists/jammy-backports/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.aliyun.com/ubuntu-ports/dists/jammy/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.aliyun.com/ubuntu-ports/dists/jammy-security/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.aliyun.com/ubuntu-ports/dists/jammy-updates/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.aliyun.com/ubuntu-ports/dists/jammy-backports/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.aliyun.com/ubuntu-ports/dists/jammy/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.aliyun.com/ubuntu-ports/dists/jammy-security/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.aliyun.com/ubuntu-ports/dists/jammy-updates/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.aliyun.com/ubuntu-ports/dists/jammy-backports/InRelease: No system certificates available. Try installing ca-certificates.
W: Failed to fetch https://mirrors.aliyun.com/ubuntu-ports/dists/jammy/InRelease  Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown.  Could not handshake: Error in the certificate verification. [IP: 222.192.186.76 443]
W: Failed to fetch https://mirrors.aliyun.com/ubuntu-ports/dists/jammy-security/InRelease  Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown.  Could not handshake: Error in the certificate verification. [IP: 222.192.186.77 443]
W: Failed to fetch https://mirrors.aliyun.com/ubuntu-ports/dists/jammy-updates/InRelease  Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown.  Could not handshake: Error in the certificate verification. [IP: 222.192.186.76 443]
W: Failed to fetch https://mirrors.aliyun.com/ubuntu-ports/dists/jammy-backports/InRelease  Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown.  Could not handshake: Error in the certificate verification. [IP: 222.192.186.77 443]
W: Some index files failed to download. They have been ignored, or old ones used instead.

重点出在了The certificate issuer is unknown. 上,这个错误通常表示 SSL/TLS 证书的颁发机构未知或无法验证。网上给出的方法有很多,但是或多或少都要用到一些需要安装的工具,而裸系统上都没有。

解决办法

  1. httpshttp。以阿里云镜像为例,直接将以下脚本拷贝到终端运行,将apt配置写入/etc/apt/sources.list
# 清空当前 sources.list
bash -c 'echo "" > /etc/apt/sources.list'# 写入新的源列表
tee /etc/apt/sources.list <<EOF
deb http://mirrors.aliyun.com/ubuntu-ports/ jammy main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu-ports/ jammy main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu-ports/ jammy-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu-ports/ jammy-security main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu-ports/ jammy-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu-ports/ jammy-updates main restricted universe multiverse# deb http://mirrors.aliyun.com/ubuntu-ports/ jammy-proposed main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu-ports/ jammy-proposed main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu-ports/ jammy-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu-ports/ jammy-backports main restricted universe multiverse
EOF
  1. 运行apt update。问题解决,成功更新。
  2. 考虑到http终归不安全,安装证书并更新。
apt install ca-certificates
update-ca-certificates

然后,将/etc/apt/sources.listhttp改回https

讨论

  • 换源时要去官方站点,CSDN博主分享的一些配置文件可能已经失效。官方站点中应有尽有,例如阿里云的站点。
  • 在没有vim等编辑器的情况下,可以借鉴上文笔者的方法,使用命令行的方式编辑文件。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/diannao/4151.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【C语言】动态内存分配(一)

目录 1.为什么要有动态内存分配 2.malloc和free 2.1malloc 2.2free 1.为什么要有动态内存分配 我们已经掌握的内存开辟方式有: 但是上述的开辟空间的方式有两个特点: ⭐空间开辟大小是固定的。 ⭐数组在申明的时候&#xff0c;必须指定数组的长度&#xff0c;数组空间一旦…

GateWay具体的使用之全局token过滤器

1: 创建过滤器类 首先&#xff0c;你需要创建一个实现了GatewayFilter接口或者继承AbstractGatewayFilterFactory类的过滤器类。这里以实现GatewayFilter接口为例&#xff0c;创建一个全局token过滤器。 package com.by.filter;import cn.hutool.core.collection.CollUtil; imp…

SQL提升

1. SQL TOP 子句 TOP 子句用于规定要返回的记录的数目。 对于拥有数千条记录的大型表来说&#xff0c;TOP 子句是非常有用的。 **注释&#xff1a;**并非所有的数据库系统都支持 TOP 子句。 1.1 SQL TOP 语法 SQL Server 的语法&#xff1a; SELECT TOP number|percent c…

OpenCV C++实现区域面积筛选以及统计区域个数

目录 1、背景介绍 2、代码实现 2.1 获取原图 2.1.1 区域图像imread 2.1.2 具体实现 2.2 获取图像大小 2.3 阈值分割 2.3.1 阈值分割threshold 2.3.2 具体实现 2.4 区域面积筛选 2.4.1 获取轮廓findContours 2.4.2 获取轮廓面积contourArea 2.4.3 填充区域fil…

http请求与响应

目录 HTTP请求格式 HTTP响应格式 HTTP请求格式 请求行&#xff1a;请求数据第一行(请求方式&#xff0c;资源路径&#xff0c;协议) 请求头&#xff1a;第二行开始&#xff0c;格式key:value 请求体&#xff1a;POST请求&#xff0c;存放在请求参数 非restful方式&#xff1…

浅谈大数据时代下的电商风控||电商数据API接口

抢抢抢&#xff01;最后1天&#xff0c;双十一直播活动来啦&#xff01;抢直播专属优惠…… 视频号 随着大数据时代的兴起&#xff0c;互联网电商风控已经从无风控、人工抽取规则为主的简易规则模型发展到当前基于大数据的风控。与金融风控不同&#xff0c;互联网电商风控呈现出…

详解MyBatis配置文件开发与注解式开发

首先呢&#xff0c;五一快来啦&#xff01;提前祝各位宝子们五一玩得开心&#xff0c;然后讲解一下MyBatis框架呀!!! 一.框架介绍 MyBatis 的主要特点 二.MyBatis工作流程 1. 初始化和配置 2. 创建 SqlSessionFactory 3. 获取 SqlSession 4. 映射器绑定 5. 执行操作 6.…

力扣1518. 换水问题

题目链接 力扣1518. 换水问题 简单方法(模拟) 思路 对换水进行模拟&#xff0c;每次喝完 n u m E x c h a n g e numExchange numExchange 瓶水后就去换一瓶水&#xff0c;直到不能再兑换为止&#xff0c;也就是剩余水的数量小于 n u m E x c h a n g e numExchange numE…

vscode中jsconfig.json文件首行提示错误

在使用react框架开发前端时&#xff0c;文件jsconfig.json首行提示错误&#xff0c;打开设置&#xff0c;勾选如下图这项

jupyter lab 如何安装和启动

Jupyter Lab 是一种基于 web 的交互式开发环境&#xff0c;用于 Jupyter 笔记本。与传统的 Jupyter 笔记本相比&#xff0c;它提供了更友好、更可扩展的界面&#xff0c;具有代码单元格、markdown 单元格、小部件和文件浏览器等功能。 1.安装 Jupyter Lab: 打开终端或命令提示…

【Go】通道作为函数参数

目录 一、Pings Pongs例子程序 二、使用通道进行任务分配和结果收集 三、使用通道进行错误处理 四、使用通道实现速率限制 五、使用通道进行数据同步 总结 共性 解决的问题类型 实际应用示例 Go 语言中&#xff0c;通道&#xff08;channel&#xff09;是实现协程&…

Linux 第十一章

&#x1f436;博主主页&#xff1a;ᰔᩚ. 一怀明月ꦿ ❤️‍&#x1f525;专栏系列&#xff1a;线性代数&#xff0c;C初学者入门训练&#xff0c;题解C&#xff0c;C的使用文章&#xff0c;「初学」C&#xff0c;linux &#x1f525;座右铭&#xff1a;“不要等到什么都没有了…

Java 图形化框架 - AWT、Swing

文章目录 关于 AWTAWT继承体系 关于 Swing关于 JFC 和 Swing Swing 组件组件层次Swing组件和AWT组件的对应关系&#xff1a;Swing组件按照功能来分类&#xff1a; Java使用AWT和Swing相关的类可以完成图形化界面编程&#xff0c;其中AWT的全称是抽象窗口工具集(Abstract Window…

北大发现了一种特殊类型的注意力头!

检索头的发现或许将有力地帮助大模型领域在提高长上下文推理能力、减少幻觉和压缩KV缓存方面的研究。 从 Claude100K 到 Gemini10M&#xff0c;我们正处于长上下文语言模型的时代。如何在长上下文中利用任何输入位置的信息&#xff1f;北大联合另外四所高校发现了一种特殊类型…

(四)后台-对文章的增删改查操作

&#xff08;四&#xff09;后台-对文章的增删改查操作 文章目录 &#xff08;四&#xff09;后台-对文章的增删改查操作一、RESTFUL API二、路由处理1、/home 后台首页页面2、/upload 文件上传功能 三、文章模块1、/list 获取文章列表 GetList2、/ 新增|编辑文章 SaveOrUpdate…

AI 提示词生成器

https://prompt-generator.ilovecoke.cc/参考 AI 提示词生成器

docker部署前端项目(三)简易迅速版本

前两个docker 部署都出现了 意外&#xff0c;通过dockerfile 文件操作的时候&#xff0c; 不是 npm 无法下载&#xff0c;就是 npm build 无法打包 总是困难重重&#xff0c;原因甚多&#xff0c;不是网络导致&#xff0c;就是版本不对&#xff0c; 原因可能是 node 版本和 npm…

运维 kubernetes(k8s)基础学习

一、容器相关 1、发展历程&#xff1a;主机–虚拟机–容器 主机类似别墅的概念&#xff0c;一个地基上盖的房子只属于一个人家&#xff0c;很多房子会空出来&#xff0c;资源比较空闲浪费。 虚拟机类似楼房&#xff0c;一个地基上盖的楼房住着很多人家&#xff0c;相对主机模式…

微信小程序的开发

1.了解项目的基本组成结构 pages 用来存放所有小程序的页面 utils 用来存放工具性质的模块(例如:格式化时间的自定义模块) app.js 小程序项目的入口文件 app.json 小程序项目的全局配置文件 app.wxss 小程序项目的全局样式文件 project.config.json 项目的配置文件 sitem…

Docker基础学习(5.Docker镜像命令)

⭐ 作者简介&#xff1a;码上言 ⭐ 代表教程&#xff1a;Spring Boot vue-element 开发个人博客项目实战教程 ⭐专栏内容&#xff1a;个人博客系统 ⭐我的文档网站&#xff1a;http://xyhwh-nav.cn/ ⭐微信公众号&#xff1a;码上言 文章目录 Docker run流程镜像是什么&a…