如何从apt-get autoremove“队列”中删除软件包

我刚刚在Ubuntu 10.04上通过apt-get安装了Calibre电子书pipe理软件,但是我发现它是当前版本背后的一个主要版本,所以我决定直接从源代码重新安装它。

当我卸载了打包的版本,apt就在autoremove队列中添加了一堆依赖项,而且当我从源代码安装更新版本的Calibre时,它并不知道它依赖于这些包。

现在我基本上拥有了我想要的所有库,但是它们仍然处于自动删除队列中。

The following packages were automatically installed and are no longer required: libqt4-script libqt4-designer libqt4-dbus python-lxml python-cherrypy3 python-encutils libqt4-xmlpatterns libqt4-help python-qt4 python-clientform python-sip python-django python-mechanize libqt4-svg python-django-tagging libphonon4 libqt4-xml libqt4-assistant libqt4-webkit libqt4-scripttools python-beautifulsoup python-pypdf python-dateutil python-cssutils Use 'apt-get autoremove' to remove them. 

我怎么知道我想保持这些软件包的安装,而无需手动重新安装?

只需使用apt-get install:

 sudo apt-get install libqt4-script libqt4-designer libqt4-dbus python-lxml python-cherrypy3 python-encutils libqt4-xmlpatterns libqt4-help python-qt4 python-clientform python-sip python-django python-mechanize libqt4-svg python-django-tagging libphonon4 libqt4-xml libqt4-assistant libqt4-webkit libqt4-scripttools python-beautifulsoup python-pypdf python-dateutil python-cssutils 

它不会实际安装它们。 它只会设置标志手动安装。

Apt-get知道这些软件包是作为依赖项自动安装的。 您应该将它们标记为“手动”,让apt-get知道您希望它们保持安装状态:

 apt-mark manual [packages] 

如果我很好地理解了你的话,你可以将这些软件包标记为手动安装。 Apt-get不允许你这样做。 但是, aptitude允许对这些标志进行操作。

看看这个post 。 有些人不鼓励使用apt-getaptitude的混合。 所以,小心!