Redhat 有一个日志,您可以在 yum 在您的系统上安装软件包后查看它。Ubuntu 中是否有类似的日志?
答案1
在 Ubuntu 上,高级包管理器是 APT。有一个目录/var/log/apt
包含
/var/log/apt/history.log
其中列出了 APT 命令、运行这些命令的人以及安装、升级或删除了什么。
和
/var/log/apt/term.log
记录 APT 命令的输出。
下级包管理器是dpkg
。在文件中
/var/log/dpkg.log
您可以查看 所做的包状态更新dpkg
。
如果日志为空,则表明该日志已被轮换。查找类似dpkg.log.1
或.gz
文件(可使用 读取zless
)的文件 - 这些是较旧的日志。
答案2
/var/log/apt
apt
包含有关在Ubuntu 上安装的软件包的日志条目。
有两组条目history
,显示包列表和所采取的操作:
Start-Date: 2017-12-01 08:49:50
Upgrade: firefox-locale-en:amd64 (57.0+build4-0ubuntu0.14.04.5, 57.0.1+build2-0ubuntu0.14.04.1), thunderbird-locale-en-us:amd64 (52.4.0+build1-0ubuntu0.14.04.2, 52.5.0+build1-0ubuntu0.14.04.1), thunderbird:amd64 (52.4.0+build1-0ubuntu0.14.04.2, 52.5.0+build1-0ubuntu0.14.04.1), firefox:amd64 (57.0+build4-0ubuntu0.14.04.5, 57.0.1+build2-0ubuntu0.14.04.1), thunderbird-locale-en:amd64 (52.4.0+build1-0ubuntu0.14.04.2, 52.5.0+build1-0ubuntu0.14.04.1), thunderbird-gnome-support:amd64 (52.4.0+build1-0ubuntu0.14.04.2, 52.5.0+build1-0ubuntu0.14.04.1)
End-Date: 2017-12-01 08:50:21
和term
,显示已处理的终端命令的输出。
Log started: 2017-12-01 08:49:50
(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 ... 330191 files and directories currently installed.)
Preparing to unpack .../firefox_57.0.1+build2-0ubuntu0.14.04.1_amd64.deb ...
Unpacking firefox (57.0.1+build2-0ubuntu0.14.04.1) over (57.0+build4-0ubuntu0.14.04.5) ...
Preparing to unpack .../firefox-locale-en_57.0.1+build2-0ubuntu0.14.04.1_amd64.deb ...
Unpacking firefox-locale-en (57.0.1+build2-0ubuntu0.14.04.1) over (57.0+build4-0ubuntu0.14.04.5) ...
Preparing to unpack .../thunderbird-locale-en_1%3a52.5.0+build1-0ubuntu0.14.04.1_amd64.deb ...
Unpacking thunderbird-locale-en (1:52.5.0+build1-0ubuntu0.14.04.1) over (1:52.4.0+build1-0ubuntu0.14.04.2) ...
Preparing to unpack .../thunderbird_1%3a52.5.0+build1-0ubuntu0.14.04.1_amd64.deb ...
Unpacking thunderbird (1:52.5.0+build1-0ubuntu0.14.04.1) over (1:52.4.0+build1-0ubuntu0.14.04.2) ...
Preparing to unpack .../thunderbird-gnome-support_1%3a52.5.0+build1-0ubuntu0.14.04.1_amd64.deb ...
Unpacking thunderbird-gnome-support (1:52.5.0+build1-0ubuntu0.14.04.1) over (1:52.4.0+build1-0ubuntu0.14.04.2) ...
Preparing to unpack .../thunderbird-locale-en-us_1%3a52.5.0+build1-0ubuntu0.14.04.1_all.deb ...
Unpacking thunderbird-locale-en-us (1:52.5.0+build1-0ubuntu0.14.04.1) over (1:52.4.0+build1-0ubuntu0.14.04.2) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu1.1) ...
Processing triggers for gnome-menus (3.10.1-0ubuntu2) ...
Processing triggers for bamfdaemon (0.5.1+14.04.20140409-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for mime-support (3.54ubuntu1.1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.13-1) ...
Setting up firefox (57.0.1+build2-0ubuntu0.14.04.1) ...
Please restart all running instances of firefox, or you will experience problems.
Setting up firefox-locale-en (57.0.1+build2-0ubuntu0.14.04.1) ...
Setting up thunderbird (1:52.5.0+build1-0ubuntu0.14.04.1) ...
Setting up thunderbird-locale-en (1:52.5.0+build1-0ubuntu0.14.04.1) ...
Setting up thunderbird-gnome-support (1:52.5.0+build1-0ubuntu0.14.04.1) ...
Setting up thunderbird-locale-en-us (1:52.5.0+build1-0ubuntu0.14.04.1) ...
Log ended: 2017-12-01 08:50:21
答案3
Ubuntu 和 Debian 生态系统中的所有其他发行版都使用包管理器apt
而不是yum
。
因此,您可以在目录中找到其日志/var/log/apt
。
最重要的是history.log
该位置的文件,它简要记录了所有软件包操作(安装、升级、删除软件包……)。另一个是term.log
,它记录所有调用的完整终端输出apt
。
请注意,由于日志轮换,旧日志文件将定期(大约每月一次)压缩并通过附加索引号(和压缩结尾.gz
)重命名,以便最高数字表示最旧的压缩日志。 例如:history.log.3.gz