XK0-005 · Question #245
The Apache web server was recently installed on a Debian/Ubuntu server. The web server fails and a review of log messages on another partition reveals the installation was not completed properly due…
The correct answer is A. apt-get install apache2 B. apt-get --purge remove acache2. To properly reinstall a package after a failed installation due to disk space, the existing partial installation should first be completely removed, and then the package reinstalled.
Question
The Apache web server was recently installed on a Debian/Ubuntu server. The web server fails and a review of log messages on another partition reveals the installation was not completed properly due to lack of disk space. After clearing the files, the systems administrator has requested the installation to be performed again. Which of the following command lines will perform this task? (Choose two.)
Options
- Aapt-get install apache2
- Bapt-get --purge remove acache2
- Capt-get --reinstall install apache2
- Dapt-get --reinstall apache2
How the community answered
(20 responses)- A80% (16)
- C5% (1)
- D15% (3)
Why each option
To properly reinstall a package after a failed installation due to disk space, the existing partial installation should first be completely removed, and then the package reinstalled.
After fully removing any remnants of the previous failed installation, `apt-get install apache2` is the correct command to perform a fresh and complete installation of the Apache web server package.
`apt-get --purge remove apache2` is used to completely remove the Apache package along with all its configuration files, ensuring a clean slate before attempting a new installation, which is crucial after a previously failed installation.
`apt-get --reinstall install apache2` is not a valid command; the `--reinstall` option is used with `install` but without the duplicate subcommand, and it primarily works for already installed packages.
`apt-get --reinstall apache2` attempts to reinstall an already installed package but does not guarantee the removal of all configuration files and might not fully clean up a broken installation state like `purge remove` does.
Concept tested: APT package management - purge and install
Source: https://manpages.debian.org/testing/apt/apt-get.8.en.html
Topics
Community Discussion
No community discussion yet for this question.