The /usr/bin/p7zip file that is part of the p7zip package has been overwritten. This server is critical
to production and cannot be rebooted. Identify the command that would restore the file without
requiring a reboot.
A.
pkg verify p7zip
B.
pkg fix p7sip
C.
pkg rebuild-index p7zip
D.
pkg revert p7zip
E.
pkg uninstsll p7zip
F.
pkg install p7zip
G.
pkg install –no-backup-be p7sip
H.
pkg refresh p7zip
Explanation:
Use the pkg revert command to restore files to their as-delivered condition.
Reference: Adding and Updating Oracle Solaris 11 Software Packages, Restoring a File
ans is D because server is critical to production and cannot be rebooted.
answer a is correct bcoz i have just done the practical
pkg verify – Validate installation of packages in the current image.
pkg fix – Fix package installation errors reported by the pkg verify command.
pkg revert – Revert files delivered by pkg packages to their as delivered condition.
Correct answer is D.
B would also work, but that would fix any corrupted file in the pkg, while pkg revert /usr/bin/p7zip, will only fix that specific file. And that’s what’s requested.
However, the correct syntax for D is:
pkg revert /usr/bin/p7zip
It requires the full pathname to the file.
D
Correct answer is B, there is a typo, but is definitely B.
root@sol11:# > /usr/bin/p7zip
root@sol11:# pkg fix compress/p7zip
Verifying: pkg://solaris/compress/p7zip ERROR
file: usr/bin/p7zip
Size: 0 bytes should be 2512
Hash: da39a3ee5e6b4b0d3255bfef95601890afd80709 should be 22818fdc4a3a3d9f85ceacb8a85bf084d4d67889
Created ZFS snapshot: 2015-01-07-03:13:34
Repairing: pkg://solaris/compress/p7zip
Creating Plan (Evaluating mediators): |
DOWNLOAD PKGS FILES XFER (MB) SPEED
Completed 1/1 1/1 0.0/0.0 1.8k/s
PHASE ITEMS
Updating modified actions 1/1
Updating package state database Done
Updating package cache 0/0
Updating image state Done
Creating fast lookup database Done
D will be right but specifying the path of the file instead the package name:
root@sol11:# > /usr/bin/p7zip
root@sol11:# pkg revert p7zip
pkg revert: The following files are not packaged in this image:
p7zip
root@sol11:# pkg revert /usr/bin/p7zip
Packages to fix: 1
Create boot environment: No
Create backup boot environment: Yes
DOWNLOAD PKGS FILES XFER (MB) SPEED
Completed 1/1 1/1 0.0/0.0 2.6k/s
PHASE ITEMS
Updating modified actions 1/1
Updating package state database Done
Updating package cache 0/0
Updating image state Done
Creating fast lookup database Done
Updating package cache 1/1
root@sol11:/home/labuser#
the question is : identify the command that restore the file. so the response is pkg revert /usr/bin/p7zip
D (with /usr/bin/p7zip)