A system administrator needs to install the latest version of a package named 'webapp' from a third-party repository that has been added to the system. Which command should be used to update the package list and install the package in one step?
Trap 1: apt-get upgrade webapp
upgrade does not handle new installations.
Trap 2: dpkg -i webapp.deb
dpkg installs local .deb files, not from repositories.
Trap 3: apt-cache search webapp && apt-get install webapp
apt-cache does not update the package list.
- A
apt-get update && apt-get install webapp
Updates package list and installs the package.
- B
apt-get upgrade webapp
Why wrong: upgrade does not handle new installations.
- C
dpkg -i webapp.deb
Why wrong: dpkg installs local .deb files, not from repositories.
- D
apt-cache search webapp && apt-get install webapp
Why wrong: apt-cache does not update the package list.