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

Ubuntu Jammy Jellyfish系统sudo版本不一致及软件包最新版本安装问题咨询

Ubuntu Jammy Jellyfish系统sudo版本不一致及软件包最新版本安装问题咨询

Hi there! Let's break down your two questions and walk through practical solutions:

一、sudo版本显示不一致的问题

I get why this is confusing—you see two different versions for sudo depending on the command you run:

ii sudo 1.9.9-1ubuntu2.4 amd64 (from dpkg -l/apt list --installed)
Sudo versión 1.9.15p5 (from sudo -V)

This almost always means you've installed a newer sudo version manually (like compiling from source) that's overriding the system's official packaged version. Here's how to fix it:

  • First, confirm where your active sudo binary lives by running:

    which sudo
    

    If the output isn't /usr/bin/sudo, that proves a manually installed version is taking priority in your system's PATH.

  • To revert to the official Ubuntu package version:

    1. Uninstall the manually installed sudo. If you compiled it from source, navigate to the source directory and run:
      sudo make uninstall
      
      If you used another installation method, follow the corresponding steps to remove it.
    2. Reinstall the system's sudo package to ensure it's properly set up:
      sudo apt install --reinstall sudo
      
  • After these steps, run dpkg -l and sudo -V again—they should now show matching versions.

二、在Ubuntu Jammy中安装软件包最新版本的问题

Ubuntu 22.04 (Jammy Jellyfish) is an LTS release, which prioritizes stability over cutting-edge updates. The official repositories don't push the absolute latest versions of packages like OpenSSH; instead, they backport critical security patches to the older, tested version (1:8.9p1-3 in your case) to keep your system reliable.

If you still need the latest version (like OpenSSH 9.7/9.7p1), here are your options—note these carry potential stability risks, especially in production environments:

  • Manual deb package installation: Download the appropriate .deb packages for Jammy/amd64 from a trusted source (like the official OpenSSH site). Install them with dpkg -i, but be ready to resolve any dependency conflicts manually.

  • Third-party PPA: Some maintainers offer PPAs with updated versions. Add a trusted PPA (do your research to confirm it's safe), then update and install:

    sudo add-apt-repository ppa:<ppa-identifier>
    sudo apt update
    sudo apt install openssh-server
    

    Keep in mind PPAs aren't officially supported and might cause compatibility issues with other system packages.

  • Compile from source: Download the latest OpenSSH source code, compile it, and install it. However, this version won't be managed by apt, so you'll have to handle future updates manually, and it might clash with system components.

As a best practice, if you're running a production system, stick with the official package versions—they receive all critical security fixes without the risk of breaking your setup.

备注:内容来源于stack exchange,提问作者Jose99

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.04.17 10:33:10