重新安装 apache2

重新安装 apache2

似乎简单的安装apt-get install apache2并没有完全安装 Apache2,因为运行时我仍然可以在其中一个进程中看到它top。如何在 Ubuntu 服务器上重新安装 Apache2?

这是命令:

root@unl01:~# which apache2

/usr/sbin/apache2
root@unl01:~# whereis apache2
apache2: /usr/sbin/apache2 /etc/apache2 /usr/lib/apache2 /usr/share/apache2 /usr/share/man/man8/apache2.8.gz
root@unl01:~# apt-get remove apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done

此后,当我再次安装 Apache2 时,安装失败:

root@unl01:~# apt-get install apache2

Reading package lists... Error!
E: Couldn't create temporary file to work with /var/lib/apt/lists/us.archive.ubu                   ntu.com_ubuntu_dists_trusty_Release - mkstemp (2: No such file or directory)
E: The package lists or status file could not be parsed or opened.

答案1

在终端上尝试这个:

sudo apt-get clean
sudo mv /var/lib/apt/lists /tmp
sudo mkdir -p /var/lib/apt/lists/partial
sudo apt-get clean
sudo apt-get update

来源

相关内容