原文地址:https://www.lujun9972.win/blog/2020/05/13/如何从apt-upgrade中排除指定包/index.html
在 archlinux 下可以直接通过 pacman -Syu --ingore
来跳过指定包进行升级, 然而ubuntu 下的 apt 居然不提供类似的排除选项,这很让我感到吃惊. 不过网上apt的内容倒是蛮多,经过简单的搜索,很容易找到解决方法。
先用
apt-mark hold
来保留要排除的软件包sudo apt-mark hold emacs-snapshot
emacs-snapshot set on hold.
执行升级操作
sudo apt upgrade -y
用
apt-mark unhold
来取消包的保留sudo apt-mark unhold emacs-snapshot
Canceled hold on emacs-snapshot.
如果没有 apt-mark
命