Linux
Kali 安装
Kali-WIFI密码(字典)
Armbian安装OMV(NAS)
NPS 内网穿透
CloudFlare
CloudFlare-免端口
CloudFlare-KV存储
API 使用
API-抓包信息使用
Linux-系统配置
Linux-更换源
Linux-一键更换源
Linux-权限
Linux-分区管理
Linux-网卡配置
Linux 端口转发
Linux 交换内存
Linux 进程优先级
Linux 共享打印机
Linux-自定义服务(支持Docker开机自启)
Linux-硬/软链接/挂载
Linux-系统时钟
Linux-清理命令记录
Linux-一键DD脚本
Linux-安装根证书
Linux-TheFuck(命令纠正)
Linux 服务器
Linux-面试鸭
Linux-Mall-Cook(商店可视化搭建)
Linux-Scratch
Linux-CasaOS(家庭云操作系统)
Linux-TiddlyWiki(非线性网页笔记)
Linux-拖拽式H5
Linux-鲁班H5
Linux-SSL证书续订
Linux-acme(SSL证书脚本)
SSL证书转换
SSL-httpsok
SSL-其它工具
Linux-LoveCards(表白墙)
Linux-游戏导航
Linux 常用命令
Linux-scp
Linux-打包/解压/压缩
Linux-SSH
Linux-portknocking(端口敲击)
Linux-获取当前公网IP
Linux-自动挂载盘
Linux-代理
Linux-nmap(局域网扫描)
Linux-jq(JSON处理)
Linux-DDNS(自制脚本)
Linux-shell传递参数
Linux-if(判断)
Linux-curl/wget
Linux-which(查看命令所在路径)
Linux-Maven
Linux-ncdu(清理日志)
Linux-共享
Linux-screen(终端切换)
Linux-Macchanger(MAC修改)
Linux-iptables(包过滤防火墙系统)
Linux-祸害人脚本
Linux-模拟网络延迟环境
Linux-Git
Linux-apt(安装软件)
Linux-crontab(定时任务)
Linux-nano/vi/vim 编辑器
Linux 环境安装
Linux 安装 Node.js
Node.js-创建通用执行
Linux 安装 Java
Linux 安装 Go
域名注册
MariaDB-相关操作
未测试开源项目
SQL 学习
SQL-常用指令
Ansible(自动化运维)
Zabbix(运维监控)
网络设备概述
备份概述
雷池WAF
Linux-新旧服务器同步rpm软件包
本文档使用 MrDoc 发布
-
+
首页
Linux-更换源
## 开源镜像源 - [清华大学开源软件镜像站](https://mirrors.tuna.tsinghua.edu.cn/help/AOSP/) - [中国科技大学开源软件镜像](http://mirrors.ustc.edu.cn/help/) - [网易开源镜像站](http://mirrors.163.com/) - [阿里巴巴开源镜像站](https://developer.aliyun.com/mirror/) - [华为开源镜像站](https://mirrors.huaweicloud.com/home) - [腾讯软件源](https://mirrors.tencent.com/) ## 查看内核版本 ```bash uname -a # 查看内核信息 hostnamectl cat /etc/issue cat /etc/os-release ``` ### Debian ```bash cat /etc/debian_version # 查看debian版本 lsb_release -a # 系统的版本信息 ``` #### [Debian 版本号](https://www.debian.org/releases/) Debian 12 (bookworm) — 当前版 Debian 11 (bullseye) — 当前的稳定(stable)版 Debian 10(buster) — 当前的旧的稳定(oldstable)版 Debian 9(stretch) — 更旧的稳定(oldoldstable)版 Debian 8(jessie) — 已存档版本,现有扩展长期支持 Debian 7(wheezy) — 被淘汰的稳定版 Debian 6.0(squeeze) — 被淘汰的稳定版 Debian GNU/Linux 5.0(lenny) — 被淘汰的稳定版 Debian GNU/Linux 4.0(etch) — 被淘汰的稳定版 Debian GNU/Linux 3.1(sarge) — 被淘汰的稳定版 Debian GNU/Linux 3.0(woody) — 被淘汰的稳定版 Debian GNU/Linux 2.2(potato) — 被淘汰的稳定版 Debian GNU/Linux 2.1(slink) — 被淘汰的稳定版 Debian GNU/Linux 2.0(hamm) — 被淘汰的稳定版 ## 更换源 根据上面查询到内核版本,并在开源镜像源内找到对应版本的源码镜像 ```bash sudo cp /etc/apt/sources.list /etc/apt/sources.list_bak # 备份软件源 # 不同系统镜像内置的编辑器可能不同,有的甚至没有 # 对于没有的可以先安装一个再编辑 nano /etc/apt/sources.list # 编辑软件源配置文件,编辑器任意 # 把你复制的进行源替换进去 # 脚本换源 sed -i 's#http://deb.debian.org/#http://mirrors.tuna.tsinghua.edu.cn/#' /etc/apt/sources.list # 快速更换清华源(http) sed -i 's#http://deb.debian.org/#https://mirrors.tuna.tsinghua.edu.cn/#' /etc/apt/sources.list # 更换清华源(https) apt install apt-transport-https ca-certificates # https 需要使用http源先安装 sed -i 's|deb.debian.org|mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list.d/debian.sources # 快速更换清华源(docker_debian) # 跨版本更新_脚本修改 sed -i 's/<当前Debian版本>/<更新Debian>/g' /etc/apt/sources.list # 修改 更新源 系统版本 sed -i 's/bullseye/bookworm/g' /etc/apt/sources.list # Debian 11 更新 Debian 12 # 更新源 + 更新软件 apt update && apt upgrade # 更新系统只需要更新到最新,然后修改源到下一个Debian版本,更新源后更新系统即可 apt dist-upgrade # 更新系统 # 软件排除更新 apt-mark hold <指定软件> # 标记软件_不进行更新 apt-mark unhold <指定软件> # 取消标记_正常更新 apt-mark showhold # 查看所有标记软件 ``` 如果 https 的报证书之类的,可以尝试把地址中的 https 更改为 http 来解决 也可以切换成 http 后把下列 https 支持装上再修改会 https `sudo apt install apt-transport-https ca-certificates` ### Debian 12(bookworm) 库报错 ```bash # 仓库'Debian bookworm'将其'non-free component'值从'non-free'修改到了'non-free non-free-firmware' nano /etc/apt/sources.list # 修改配置文件 # 修改 non-free 👉 non-free-firmware,效果如下👇 deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free # 修改前 deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free-firmware # 修改后 # 脚本修改 sed -i 's/non-free/non-free-firmware/g' /etc/apt/sources.list ``` ### NO_PUBLIC Key ```bash Ign:1 http://mirrors.tuna.tsinghua.edu.cn/debian stretch InRelease Hit:2 http://mirrors.tuna.tsinghua.edu.cn/debian stretch-updates InRelease Get:3 http://mirrors.tuna.tsinghua.edu.cn/debian stretch-backports InRelease [91.8 kB] Hit:4 http://mirrors.tuna.tsinghua.edu.cn/debian-security stretch/updates InRelease Err:3 http://mirrors.tuna.tsinghua.edu.cn/debian stretch-backports InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 648ACFD622F3D138 NO_PUBKEY 0E98404D386FA1D9 Hit:5 http://mirrors.tuna.tsinghua.edu.cn/debian stretch Release Reading package lists... Done W: GPG error: http://mirrors.tuna.tsinghua.edu.cn/debian stretch-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 648ACFD622F3D138 NO_PUBKEY 0E98404D386FA1D9 E: The repository 'http://mirrors.tuna.tsinghua.edu.cn/debian stretch-backports InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. ``` 只需要将出现`NO_PUBLIC`添加进到系统即可,将最后出现的一串`KEY`通过以下命令添加到系统中,比如我这个缺两个,两个都需要添加 ``` sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys [NO_PUBLIC Key] ``` #### No dirmngr ```bash Executing: /tmp/apt-key-gpghome.u6qTcyDZVb/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 gpg: failed to start the dirmngr '/usr/bin/dirmngr': No such file or directory gpg: connecting dirmngr at '/tmp/apt-key-gpghome.u6qTcyDZVb/S.dirmngr' failed: No such file or directory gpg: keyserver receive failed: No dirmngr ``` 添加 NO_PUBLIC Key 的时候如果提示上方内容,那就是缺少 No dirmngr ```bash apt install -y dirmngr ``` 把这个补上再添加 NO_PUBLIC Key 即可 #### NO gnupg ```bash E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation ``` 添加 NO_PUBLIC Key 的时候如果提示上方内容,那就是缺少 gnupg ```bash apt install -y gnupg2 ``` 把这个补上再添加 NO_PUBLIC Key 即可 ### 系统时间不对 系统时间不对也无法更新 ```bash # 查看时间 date Tue Aug 23 20:00:00 CST 2000 # 修改时间 date -s "20220823 20:00:00" # yyyymmdd hh:mm:ss Tue Aug 23 20:00:00 CST 2022 # date 有多种时间格式可接受,查看date --help ```
造物者W
2024年12月22日 17:52
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
Markdown文件
分享
链接
类型
密码
更新密码