飘在云端

东西南北,海角天涯

· 未定义 · · 28次浏览

国内云厂商 ubuntu 镜像源更新软件包时不满足依赖

环境
Ubuntu 22.04.4 LTS
服务器:腾讯云
apt 默认使用的是腾讯的镜像源,更新时走腾讯内网到腾讯自建的镜像源

今天更新/安装某个软件包一直报错依赖不满足

    root@www:~# apt install dovecot-core dovecot-pop3d dovecot-imapd dovecot-lmtpd dovecot-sqlite dovecot-sieve -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 dovecot-lmtpd : Depends: dovecot-core (= 1:2.3.16+dfsg1-3ubuntu2.2) but 1:2.3.16+dfsg1-3ubuntu2.1 is to be installed
 dovecot-sieve : Depends: dovecot-core (= 1:2.3.16+dfsg1-3ubuntu2.2) but 1:2.3.16+dfsg1-3ubuntu2.1 is to be installed
 dovecot-sqlite : Depends: dovecot-core (= 1:2.3.16+dfsg1-3ubuntu2.2) but 1:2.3.16+dfsg1-3ubuntu2.1 is to be installed
E: Unable to correct problems, you have held broken packages.

很明显,1:2.3.16+dfsg1-3ubuntu2.2 版本的 dovecot-core 在 apt 源找不到,此时最新只有 1:2.3.16+dfsg1-3ubuntu2.1,没有 2.2

尝试 apt update -y && apt upgrade -y 也没用,换了国内几个镜像源依旧,阿里云/中科大/华为/清华 都不好使

大概率是镜像源没有向上游 ubuntu 官方源同步完所需的软件包最新版本
不过我这个还是稍微不一样,这个 dovecot-core 软件包上游更新了1-2个星期了

最后只能换回 ubuntu 官方源,但国内访问境外服务器没速度

需配置 apt 使用代理重新更新软件包

配置 apt 使用 socks5 代理,在 /etc/apt/apt.conf.d/路径下随便新建一个文件名,bwgproxies,并编辑填入

Acquire::http::Proxy "socks5h://127.0.0.1:7890";

保存文件,注意,上面的 socks5h h 表示 host,意思是使用 socks5 远端 DNS 解析,而不是本地解析域名,socks5://xxxxx 则是本地 DNS 解析域名

自行寻找梯子并在本地监听上面配置的端口

之后再次 apt update -y && apt upgrade -y即可
接着安装/更新所需的软件

以后还是坚持使用官方源 + 配置代理的形式使用了

评论 (0条)