有时,当我使用sudo apt-get install <package>
命令安装软件时,软件包可能需要几分钟才能安装,最终可能占用一些gb空间。如果我使用sudo apt-get purge <package>
卸载它,那么它可能会在几秒钟内卸载,并且很小的空间(一些kb或mb)可能会从安装时占用的原始空间中删除!显然,这意味着这不是一个干净的卸载,我的电脑是充满了未删除的文件。为什么会发生这种情况,我应该如何彻底地卸载软件包?
发布于 2014-10-31 02:46:15
当您安装一个包时,它可能还需要安装它的依赖项--例如安装torcs
(例如,使用sudo apt-get install torcs
),它需要torcs-data
等来工作--它们也被安装,并且体积相当大(因此也需要时间下载等等)。
当移除torcs
(例如使用sudo apt-get remove torcs
)时,它可能会离开torcs-data
包和其他不再需要的包,占用空间。您可以通过运行sudo apt-get autoremove <package>
,或者在使用purge
/remove
删除它之后运行sudo apt-get autoremove
来解决这个问题。
您还可以使用--purge
选项和autoremove
删除剩余的配置文件。
另一种清除空间的方法是使用sudo apt-get clean
,清除回购信息和缓存的包,这些包也占用空间。之后您可能需要运行sudo apt-get update
。
以下是来自手册页的相关条目:
purge
purge is identical to remove except that packages are removed and
purged (any configuration files are deleted too).
clean
clean clears out the local repository of retrieved package files.
It removes everything but the lock file from
/var/cache/apt/archives/ and /var/cache/apt/archives/partial/. When
APT is used as a dselect(8) method, clean is run automatically.
Those who do not use dselect will likely want to run apt-get clean
from time to time to free up disk space.
autoremove
autoremove is used to remove packages that were automatically
installed to satisfy dependencies for some package and that are no
more needed.
https://askubuntu.com/questions/543864
复制相似问题