当你安装一个包时,它可能还需要安装依赖项才能工作 - 例如安装torcs(例如 with sudo apt-get install torcs),它需要torcs-data等等 - 它们也被安装,并且尺寸相当大(所以也需要时间下载等等)。
删除torcs(例如使用sudo apt-get remove torcs)时,它可能会将torcs-data包和其他不再需要的包留在后面,占用空间。您可以通过运行来解决这个问题sudo apt-get autoremove <package>,或者sudo apt-get autoremove在使用purge/删除它之后remove。
您还可以--purge选择autoremove删除剩余的配置文件。
清除空间的另一种方法是使用sudo apt-get clean, 清除同样占用空间的 repo 信息和缓存的包。之后您可能需要运行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.
Run Code Online (Sandbox Code Playgroud)