如果我安装两次软件包会发生什么情况?

如果我安装两次软件包会发生什么情况?

只是想知道如果我安装一个包两次会发生什么。

它只是删除旧的吗?我清除了 postfix,它也删除了一些其他文件,但我不确定哪些文件属于哪个包。

以下是 Apt 日志的片段:

原始 Apt-Get(清除之前):

Start-Date: 2015-11-22  12:53:25
        Commandline: apt-get install tmux mailutils postfix lib32gcc1 libstdc++6 libstdc++6:i386
        Install: libmailutils4:amd64 (2.99.98-1.1, automatic), libevent-2.0-5:amd64 (2.0.21-stable-1ubuntu1.14.04.1, automatic), gcc-4.8-base:i386 (4.8.4-2ubuntu1~14.04, automatic), tmux:amd64 (1.8-5), postfix:amd64 (2.11.0-1ubuntu1), lib32gcc1:amd64 (4.9.1-0ubuntu1), libgc1c2:amd64 (7.2d-5ubuntu2, automatic), libfribidi0:amd64 (0.19.6-1, automatic), libgcc1:i386 (4.9.1-0ubuntu1, automatic), libc6:i386 (2.19-0ubuntu6.6,$
        Remove: sendmail:amd64 (8.14.4-4.1ubuntu1), sendmail-bin:amd64 (8.14.4-4.1ubuntu1)
        End-Date: 2015-11-22  12:53:57

清除+自动删除:

Start-Date: 2015-11-23  10:21:29
        Commandline: apt-get purge postfix
        Purge: bsd-mailx:amd64 (8.1.2-0.20131005cvs-1ubuntu0.14.04.1), postfix:amd64 (2.11.0-1ubuntu1), logwatch:amd64 (7.4.0+svn20130529rev144-1ubuntu1), sensible-mda:amd64 (8.14.4-4.1ubuntu1), mailutils:amd64 (2.99.98-1.1)
        End-Date: 2015-11-23  10:21:41

Start-Date: 2015-11-23  10:23:10
    Commandline: apt-get autoremove
    Remove: libmailutils4:amd64 (2.99.98-1.1), sendmail-cf:amd64 (8.14.4-4.1ubuntu1), libgc1c2:amd64 (7.2d-5ubuntu2), libfribidi0:amd64 (0.19.6-1), libdate-manip-perl:amd64 (6.42-1), guile-2.0-libs:amd64 (2.0.9+1-1ubuntu1), liblzo2-2:amd64 (2.06-1.2ubuntu1.1), mysql-common:amd64 (5.5.46-0ubuntu0.14.04.2), libmysqlclient18:amd64 (5.5.46-0ubuntu0.14.04.2), mailutils-common:amd64 (2.99.98-1.1), libkyotocabinet16:amd64 $
    End-Date: 2015-11-23  10:23:14

我想再次运行apt-get install tmux mailutils postfix lib32gcc1 libstdc++6 libstdc++6:i386命令,但是如果已经安装了 tmux,这会产生干扰吗?

答案1

如果tmux已经安装,它只会将其标记为“手动安装”(而不是由于依赖性而自动安装),这样它就不会再出现在可自动卸载软件包列表中。

如果已安装并且有可用的新版本,它将进行升级(除非软件包被保留,在这种情况下事情会变得更加复杂)。

通常,安装已安装的软件包是无操作的(减去上述内容),除非您使用--reinstall或要求非常特定的版本。

[romano:~] % sudo apt-get install firefox
[sudo] password for romano: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
firefox is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

无论如何,如果你对接下来要做什么有疑问apt-get,你可以使用选项来运行它-s(它代表模拟),它会告诉你它会做什么而实际上不做任何事情(你sudo也可以省略):

[romano:~] % apt-get -s install tmux     
NOTE: This is only a simulation!
      apt-get needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  tmux
0 upgraded, 1 newly installed, 0 to remove and 20 not upgraded.
Inst tmux (1.8-5 Ubuntu:14.04/trusty [amd64])
Conf tmux (1.8-5 Ubuntu:14.04/trusty [amd64])

相关内容