etckeeper 是否会破坏软件中心的安装

etckeeper 是否会破坏软件中心的安装

我在软件中心搜索 VirtualBox,找到后点击“安装”。安装结束时弹出一个窗口,显示

包操作失败

软件包安装或删除失败

并在详细信息部分

installArchives() failed: fatal: $HOME not set
[master e1552a4] saving uncommitted changes in /etc prior to apt run
 1 file changed, 4 insertions(+)
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 793534 files and directories currently installed.)
Removing virtualbox-qt (4.3.10-dfsg-1ubuntu5) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.13-1) ...
Processing triggers for mime-support (3.54ubuntu1.1) ...
Processing triggers for bamfdaemon (0.5.1+14.04.20140409-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for desktop-file-utils (0.22-1ubuntu1) ...
Processing triggers for gnome-menus (3.10.1-0ubuntu2) ...
Processing triggers for shared-mime-info (1.2-0ubuntu3) ...

*** Please tell me who you are.

Run

除了这条消息之外,安装似乎成功了,但这条消息让我感到不安。当我再次通过软件中心删除它时,也发生了同样的情况。

通过软件中心删除它后,我从命令行安装了它,没有任何错误或警告

sudo apt-get install virtualbox

软件中心输出中的以下行是由etckeeper什么导致的?这让我认为这etckeeper会破坏安装和删除:

[master e1552a4] saving uncommitted changes in /etc prior to apt run
 1 file changed, 4 insertions(+)

如果这是真的,我该怎么做才能让etckeeper软件中心运行良好?如果不行,还有什么原因导致此问题?

答案1

您的详细信息部分日志中显示两个错误。最顶部的第一个错误(“ fatal: $HOME not set”)是由于 git$HOME在权限提升后和提交之前(在 VirtualBox 安装之前)不知道您的目录。可以通过在文件顶部附近添加以下内容来修复此问题/etc/etckeeper/pre-install.d/50uncommitted-changes

if [ "$HOME" = "" ]; then
    export HOME="/root"
fi

你可能想要使用以下命令提交此更改:

cd /etc
sudo git add etckeeper/pre-install.d/50uncommitted-changes
sudo git commit -m "Set $HOME if it is blank"

*** Please tell me who you are...靠近底部的第二个错误(“ ”)也是由 git 引起的,可以通过设置/etc/repo 所有者的用户名和电子邮件来修复:

cd /etc
sudo git config user.name "Your Name"
sudo git config user.email "[email protected]"

我在每日更新(在 Ubuntu 14.04 上)中也看到了同样的问题,但是在我进行这些更改之后,这些问题就不再出现。

希望这可以帮助。

相关内容