我在 Ubuntu 12.04 服务器版上安装了 PacketFence,一切运行正常。我可以通过以下地址访问仪表板:https://(IP地址):1443没有问题。
将硬盘移到另一台机器并验证网络连接后,我再也无法访问仪表板了。摆弄了一会儿之后,我认为直接删除并重新安装会更快,因为我还没有完成配置过程。在sudo apt-get purge packetfence
重新启动之后,我运行了sudo apt-get install packetfence
(上次安装时已经添加了源和密钥)。完成后,我运行了sudo service packetfence start
,它返回了packetfence: unrecognized service
。我想我一定是在安装过程中忽略了某些错误消息,所以我再次运行了“sudo apt-get install packetfence”——下面您可以看到它返回的有问题的输出:
administrator@PacketFence-ALTO:~$ sudo apt-get install packetfence
[sudo] password for administrator:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
sound-theme-freedesktop libgconf-2-4 libatk1.0-0 gconf2-common libxfixes3 libxcomposite1 libcanberra-gtk3-0 dconf-g
libdconf0 libxdamage1 libxi6 libvorbis0a libxcursor1 dconf-service libxrandr2 libgtk-3-common libogg0
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
packetfence
0 upgraded, 1 newly installed, 0 to remove and 5 not upgraded.
263 not fully installed or removed.
Need to get 0 B/39.4 MB of archives.
After this operation, 74.4 MB of additional disk space will be used.
Setting up packetfence-config (5.6.0) ...
chown: cannot access `/usr/local/pf/conf/pfconfig.conf': No such file or directory
dpkg: error processing packetfence-config (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up packetfence-redis-cache (5.6.0) ...
System start/stop links for /etc/init.d/packetfence-redis-cache already exist.
* Restarting packetfence-redis-cache packetfence-redis-cache
invoke-rc.d: initscript packetfence-redis-cache, action "restart" failed.
dpkg: error processing packetfence-redis-cache (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
packetfence-config
packetfence-redis-cache
E: Sub-process /usr/bin/dpkg returned an error code (1)
我能够通过运行来处理packetfence-config sudo apt-get remove --purge packetfence-config
,但是sudo apt-get remove --purge packetfence-redis-cache
(以及我运行的几乎任何其他命令,包括sudo apt-get install -f
和sudo apt-get autoremove --purge
)返回以下内容:
administrator@PacketFence-ALTO:~$ sudo dpkg --purge packetfence-redis-cache (Reading database ... 84944 files and directories currently installed.) Removing packetfence-redis-cache ... invoke-rc.d: initscript packetfence-redis-cache, action "stop" failed. dpkg: error processing packetfence-redis-cache (--purge): subprocess installed pre-removal script returned error exit status 1 Errors were encountered while processing: packetfence-redis-cache
Aptitude 具有以下输出:
administrator@PacketFence-ALTO:~$ sudo aptitude remove packetfence-redis-cache
The following packages will be REMOVED:
init-system-helpers{u} libjemalloc1{u} packetfence-redis-cache redis-server{u} redis-tools{u}
0 packages upgraded, 0 newly installed, 5 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 1,662 kB will be freed.
Do you want to continue? [Y/n/?] y
(Reading database ... 114575 files and directories currently installed.)
Removing packetfence-redis-cache ...
invoke-rc.d: initscript packetfence-redis-cache, action "stop" failed.
dpkg: error processing packetfence-redis-cache (--remove):
subprocess installed pre-removal script returned error exit status 1
No apport report written because MaxReports is reached already
Removing redis-server ...
Stopping redis-server: redis-server.
Removing init-system-helpers ...
dpkg: warning: while removing init-system-helpers, directory '/var/lib/systemd' not empty so not removed.
Removing redis-tools ...
Removing libjemalloc1 ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Errors were encountered while processing:
packetfence-redis-cache
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Current status: 1 broken [+1].
关于如何解决与 packetfence 相关的剩余软件包的问题,以便我可以从头开始重新安装它,有什么想法吗?
答案1
这个问题可以忽略。我通过以下操作解决了这个问题:
cd /var/lib/dpkg/info
sudo rm packetfence-redis-cache*
sudo dpkg --remove --force-remove-reinstreq packetfence-redis-cache
发出这些命令后,我能够使用 apt 成功重新安装 Packetfence。