如何阻止在 Ubuntu 20.04 中安装特定的软件包?

如何阻止在 Ubuntu 20.04 中安装特定的软件包?

我如何才能阻止安装特定的包?

我已经阅读过以下页面:

根据第一和第三个链接,我放置了偏好(不存在)在 /etc/apt/ 中包含以下内容:

Package: *name*
Pin: origin ""
Pin-Priority: -1

但我没有工作。

新版本的 Ubuntu 工作方式有什么不同吗?

我已经尝试重新启动并更新。

这是apt-cache policy *name*输出:

*name*:
  Installed: (none)
  Candidate: 7.0-2.1
  Version table:
     7.0-2.1 500
        500 http://it.archive.ubuntu.com/ubuntu focal/universe amd64 Packages

这是apt-cache policy输出:

Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu focal/main i386 Packages
     release v=20.04,o=LP-PPA-yannubuntu-boot-repair,a=focal,n=focal,l=Boot-Repair,c=main,b=i386
     origin ppa.launchpad.net
 500 http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu focal/main amd64 Packages
     release v=20.04,o=LP-PPA-yannubuntu-boot-repair,a=focal,n=focal,l=Boot-Repair,c=main,b=amd64
     origin ppa.launchpad.net
 500 https://packages.microsoft.com/repos/ms-teams stable/main amd64 Packages
     release o=ms-teams stable,a=stable,n=stable,l=ms-teams stable,c=main,b=amd64
     origin packages.microsoft.com
 500 http://ppa.launchpad.net/kgilmer/speed-ricer/ubuntu focal/main i386 Packages
     release v=20.04,o=LP-PPA-kgilmer-speed-ricer,a=focal,n=focal,l=Speed Ricer,c=main,b=i386
     origin ppa.launchpad.net
 500 http://ppa.launchpad.net/kgilmer/speed-ricer/ubuntu focal/main amd64 Packages
     release v=20.04,o=LP-PPA-kgilmer-speed-ricer,a=focal,n=focal,l=Speed Ricer,c=main,b=amd64
     origin ppa.launchpad.net
 500 http://security.ubuntu.com/ubuntu focal-security/multiverse i386 Packages
     release v=20.04,o=Ubuntu,a=focal-security,n=focal,l=Ubuntu,c=multiverse,b=i386
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages
     release v=20.04,o=Ubuntu,a=focal-security,n=focal,l=Ubuntu,c=multiverse,b=amd64
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu focal-security/universe i386 Packages
     release v=20.04,o=Ubuntu,a=focal-security,n=focal,l=Ubuntu,c=universe,b=i386
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages
     release v=20.04,o=Ubuntu,a=focal-security,n=focal,l=Ubuntu,c=universe,b=amd64
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu focal-security/restricted i386 Packages
     release v=20.04,o=Ubuntu,a=focal-security,n=focal,l=Ubuntu,c=restricted,b=i386
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages
     release v=20.04,o=Ubuntu,a=focal-security,n=focal,l=Ubuntu,c=restricted,b=amd64
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu focal-security/main i386 Packages
     release v=20.04,o=Ubuntu,a=focal-security,n=focal,l=Ubuntu,c=main,b=i386
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages
     release v=20.04,o=Ubuntu,a=focal-security,n=focal,l=Ubuntu,c=main,b=amd64
     origin security.ubuntu.com
 100 http://it.archive.ubuntu.com/ubuntu focal-backports/universe i386 Packages
     release v=20.04,o=Ubuntu,a=focal-backports,n=focal,l=Ubuntu,c=universe,b=i386
     origin it.archive.ubuntu.com
 100 http://it.archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages
     release v=20.04,o=Ubuntu,a=focal-backports,n=focal,l=Ubuntu,c=universe,b=amd64
     origin it.archive.ubuntu.com
 500 http://it.archive.ubuntu.com/ubuntu focal-updates/multiverse i386 Packages
     release v=20.04,o=Ubuntu,a=focal-updates,n=focal,l=Ubuntu,c=multiverse,b=i386
     origin it.archive.ubuntu.com
 500 http://it.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages
     release v=20.04,o=Ubuntu,a=focal-updates,n=focal,l=Ubuntu,c=multiverse,b=amd64
     origin it.archive.ubuntu.com
 500 http://it.archive.ubuntu.com/ubuntu focal-updates/universe i386 Packages
     release v=20.04,o=Ubuntu,a=focal-updates,n=focal,l=Ubuntu,c=universe,b=i386
     origin it.archive.ubuntu.com
 500 http://it.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages
     release v=20.04,o=Ubuntu,a=focal-updates,n=focal,l=Ubuntu,c=universe,b=amd64
     origin it.archive.ubuntu.com
 500 http://it.archive.ubuntu.com/ubuntu focal-updates/restricted i386 Packages
     release v=20.04,o=Ubuntu,a=focal-updates,n=focal,l=Ubuntu,c=restricted,b=i386
     origin it.archive.ubuntu.com
 500 http://it.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages
     release v=20.04,o=Ubuntu,a=focal-updates,n=focal,l=Ubuntu,c=restricted,b=amd64
     origin it.archive.ubuntu.com
 500 http://it.archive.ubuntu.com/ubuntu focal-updates/main i386 Packages
     release v=20.04,o=Ubuntu,a=focal-updates,n=focal,l=Ubuntu,c=main,b=i386
     origin it.archive.ubuntu.com
 500 http://it.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
     release v=20.04,o=Ubuntu,a=focal-updates,n=focal,l=Ubuntu,c=main,b=amd64
     origin it.archive.ubuntu.com
 500 http://it.archive.ubuntu.com/ubuntu focal/multiverse i386 Packages
     release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=multiverse,b=i386
     origin it.archive.ubuntu.com
 500 http://it.archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages
     release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=multiverse,b=amd64
     origin it.archive.ubuntu.com
 500 http://it.archive.ubuntu.com/ubuntu focal/universe i386 Packages
     release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=universe,b=i386
     origin it.archive.ubuntu.com

     500 http://it.archive.ubuntu.com/ubuntu focal/universe amd64 Packages
         release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=universe,b=amd64
         origin it.archive.ubuntu.com

 500 http://it.archive.ubuntu.com/ubuntu focal/restricted i386 Packages
     release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=restricted,b=i386
     origin it.archive.ubuntu.com
 500 http://it.archive.ubuntu.com/ubuntu focal/restricted amd64 Packages
     release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=restricted,b=amd64
     origin it.archive.ubuntu.com
 500 http://it.archive.ubuntu.com/ubuntu focal/main i386 Packages
     release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=main,b=i386
     origin it.archive.ubuntu.com
 500 http://it.archive.ubuntu.com/ubuntu focal/main amd64 Packages
     release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=main,b=amd64
     origin it.archive.ubuntu.com
Pinned packages:

相关内容