You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Unattended-Upgrade升级失败求助:指定软件包未自动更新

Troubleshooting Unattended-Upgrades Failures for msodbcsql and mssql-tools Packages

Let’s walk through the most likely fixes for why these Microsoft SQL packages aren’t updating automatically, even after you ran a manual dist-upgrade:

1. Confirm Microsoft’s repo is allowed in Unattended-Upgrades config

Unattended-Upgrades only pulls updates from sources explicitly listed in its allowed origins. Since msodbcsql and mssql-tools come from Microsoft’s third-party repository, it’s probably missing from the default allowlist.

  • Open your config file to check:
    nano /etc/apt/apt.conf.d/50unattended-upgrades
    
  • Look for the Unattended-Upgrade::Allowed-Origins section. To find the exact origin/suite string to add, run this command to inspect the package’s source details:
    apt-cache policy msodbcsql
    
    You’ll see lines like Origin: packages.microsoft.com and Suite: jammy-prod (the suite name matches your distro codename). Add this entry to the allowed origins list:
    "packages.microsoft.com:jammy-prod";
    
  • Save the file, then run unattended-upgrade -d (debug mode) to test if the auto-updater now recognizes the pending updates.

2. Check if the packages are marked as "held"

If a package is marked as held, Unattended-Upgrades will skip it completely. Verify this with:

apt-mark showhold

If you see msodbcsql or mssql-tools in the output, unhold them using:

apt-mark unhold msodbcsql mssql-tools

3. Inspect Unattended-Upgrades’ dedicated logs

The history.log only tracks manual upgrade actions—Unattended-Upgrades has its own detailed logs that will tell you exactly why it skipped these packages. Check them with:

less /var/log/unattended-upgrades/unattended-upgrades.log

Look for lines referencing msodbcsql or mssql-tools—common issues here include:

  • Unresolvable dependency conflicts that require user input
  • Failed connections to Microsoft’s repository
  • Configuration file prompts that the auto-updater is set to skip

If you spot config file conflicts, run dpkg --configure -a to resolve them manually, then re-test the unattended upgrade.

4. Validate Microsoft’s repository setup

Occasionally, Microsoft’s repo might be misconfigured or outdated, preventing updates from being detected. Check your repo file:

cat /etc/apt/sources.list.d/mssql-release.list

Ensure the URL matches your distro version (e.g., https://packages.microsoft.com/ubuntu/22.04/prod for Jammy). If it’s incorrect, update it, run apt update, and try again.

After working through these steps, run unattended-upgrade -d to simulate the auto-upgrade process and confirm the packages are now being processed correctly.

内容的提问来源于stack exchange,提问作者Sam

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 07:52:53