我试图只升级一个包,所以我输入了 sudo apt-get upgrade packagename。(现在我知道我应该为此使用 apt-get install。)现在 apt-get 正在升级我整个系统中的所有内容。我现在用 shutdown -h 停止了它(嘿,它起作用了),因为 Cc 似乎不太好用。
然而 apt-get 有内存,现在我不能用 apt-get 做任何事情,比如安装,除非它尝试继续完整的系统升级。如何让 apt-get 中止升级?
当我按照 Itai Ganot 建议的已接受答案中的说明进行操作时,会发生以下情况:
$ sudo apt-get autoclean
[sudo] password for dsw:
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
dsw@dsw-VirtualBox:~$ cd /var/cache/apt/archives/partial
dsw@dsw-VirtualBox:/var/cache/apt/archives/partial$ ls
dsw@dsw-VirtualBox:/var/cache/apt/archives/partial$ ls -a
. ..
Run Code Online (Sandbox Code Playgroud)
按照消息中的说明进行操作:
sudo dpkg --configure -a
Run Code Online (Sandbox Code Playgroud)
最终停止。所以上述方法似乎最终会停止 apt-get 更新。
您可以执行以下两项操作来取消升级:
尝试运行以下命令:
# sudo apt-get autoclean
Run Code Online (Sandbox Code Playgroud)清空 /var/cache/apt/archives/partial 为此,请使用 gksudo 命令打开文件管理器,例如:
# gksudo nautilus /var/cache/apt/archives/partial
Run Code Online (Sandbox Code Playgroud)删除“部分”中的文件,但不删除文件夹本身。