UNIX Question and Answer – Software Management
UNIX MCQ – Multiple Choice Questions for exam, interview, and Entrance Test
1. In Debian-based systems, which command is used to list all available package upgrades?
a) apt-get upgrade
b) apt list –upgradable
c) apt-get dist-upgrade
d) apt-get update
Answer: b) apt list –upgradable
Explanation: The command “apt list –upgradable” lists all available package upgrades in Debian-based systems.
2. What does the command “apt-get clean” do in Debian-based systems?
a) Removes cached package files
b) Removes old package versions
c) Removes unused packages
d) Removes orphaned packages
Answer: a) Removes cached package files
Explanation: The “apt-get clean” command removes cached package files in Debian-based systems.
3. Which command is used to search for packages containing a specific file in Debian-based systems?
a) apt-file search filename
b) apt-cache search filename
c) dpkg -S filename
d) dpkg-query -S filename
Answer: c) dpkg -S filename
Explanation: The command “dpkg -S filename” is used to search for packages containing a specific file in Debian-based systems.
4. What is the purpose of the “apt-get autoremove” command in Debian-based systems?
a) Removes unused packages
b) Removes orphaned packages
c) Removes conflicting packages
d) Removes outdated packages
Answer: a) Removes unused packages
Explanation: The “apt-get autoremove” command removes unused packages in Debian-based systems.
5. Which command is used to show a list of files installed by a package in Debian-based systems?
a) dpkg -l package-name
b) dpkg -L package-name
c) dpkg -s package-name
d) dpkg -i package-name
Answer: b) dpkg -L package-name
Explanation: The command “dpkg -L package-name” shows a list of files installed by a package in Debian-based systems.
6. In Fedora systems, which command is used to install a package from a specific repository?
a) dnf install package-name –repo=repository
b) dnf install package-name –repository=repository
c) dnf install package-name –source=repository
d) dnf install package-name –source=repository-url
Answer: b) dnf install package-name –repository=repository
Explanation: The command “dnf install package-name –repository=repository” is used to install a package from a specific repository in Fedora systems.
7. What does the command “dnf history list” do in Fedora systems?
a) Lists package history
b) Lists installation history
c) Lists transaction history
d) Lists update history
Answer: c) Lists transaction history
Explanation: The “dnf history list” command lists transaction history in Fedora systems.
8. Which command is used to view details about a package in Fedora systems?
a) rpm -qa package-name
b) rpm -qi package-name
c) dnf info package-name
d) dnf show package-name
Answer: d) dnf show package-name
Explanation: The command “dnf show package-name” is used to view details about a package in Fedora systems.
9. What is the purpose of the “dnf remove” command in Fedora systems?
a) Removes a package
b) Removes a package and its dependencies
c) Removes a package but keeps its configuration files
d) Removes a package and its configuration files
Answer: b) Removes a package and its dependencies
Explanation: The “dnf remove” command removes a package and its dependencies in Fedora systems.
10. Which command is used to install a specific version of a package in Fedora systems?
a) dnf install package-name
b) dnf install package-name-version
c) dnf install package-name=version
d) dnf install package-name –version=version
Answer: c) dnf install package-name=version
Explanation: The command “dnf install package-name=version” is used to install a specific version of a package in Fedora systems.
11. What does the command “dnf module list” display in Fedora systems?
a) Lists all enabled modules
b) Lists all available modules
c) Lists installed modules
d) Lists active modules
Answer: b) Lists all available modules
Explanation: The “dnf module list” command lists all available modules in Fedora systems.
12. Which command is used to install a package group in Fedora systems?
a) dnf install @group-name
b) dnf group install group-name
c) dnf install group-name
d) dnf install @group-name –skip-broken
Answer: a) dnf install @group-name
Explanation: The command “dnf install @group-name” is used to install a package group in Fedora systems.
13. What does the command “dnf repoquery –list package-name” do in Fedora systems?
a) Lists packages required by a package
b) Lists packages provided by a package
c) Lists packages installed on the system
d) Lists packages available in a repository
Answer: a) Lists packages required by a package
Explanation: The “dnf repoquery –list package-name” command lists packages required by a package in Fedora systems.
14. Which command is used to search for a package in the repositories in Fedora systems?
a) dnf search package-name
b) dnf find package-name
c) dnf query package-name
d) dnf search –repository=repository package-name
Answer: a) dnf search package-name
Explanation: The “dnf search package-name” command is used to search for a package in the repositories in Fedora systems.
15. What is the purpose of the “dnf updateinfo list” command in Fedora systems?
a) Lists available package updates
b) Lists installed package updates
c) Lists package update history
d) Lists package update transactions
Answer: a) Lists available package updates
Explanation: The “dnf updateinfo list” command lists available package updates in Fedora systems.
16. Which command is used to downgrade a package to a specific version in Fedora systems?
a) dnf downgrade package-name
b) dnf install package-name=version
c) dnf rollback package-name
d) dnf history rollback package-name
Answer: a) dnf downgrade package-name
Explanation: The “dnf downgrade package-name” command is used to downgrade a package to a specific version in Fedora systems.
17. What does the command “dnf check-update” do in Fedora systems?
a) Checks for available package updates
b) Checks for installed package updates
c) Checks for package dependencies
d) Checks for package conflicts
Answer: a) Checks for available package updates
Explanation: The “dnf check-update” command checks for available package updates in Fedora systems.
18. Which command is used to list all installed packages in Fedora systems?
a) dnf list
b) dnf list installed
c) dnf list installed | grep “Installed”
d) dnf list | grep “Installed”
Answer: b) dnf list installed
Explanation: The “dnf list installed” command is used to list all installed packages in Fedora systems.
19. What is the purpose of the “dnf distro-sync” command in Fedora systems?
a) Synchronizes installed packages with the distribution’s repository
b) Upgrades the distribution to the latest release
c) Downgrades the distribution to a previous release
d) Syncs system configuration with the distribution’s defaults
Answer: a) Synchronizes installed packages with the distribution’s repository
Explanation: The “dnf distro-sync” command synchronizes installed packages with the distribution’s repository in Fedora systems.
20. Which command is used to install a package without checking for dependencies in Fedora systems?
a) dnf install package-name
b) dnf install package-name –nodeps
c) dnf install package-name –skip-broken
d) dnf install package-name –force
Answer: b) dnf install package-name –nodeps
Explanation: The “dnf install package-name –nodeps” command is used to install a package without checking for dependencies in Fedora systems.
21. What does the command “dnf swap old-package new-package” do in Fedora systems?
a) Swaps the locations of two packages
b) Replaces the old package with the new package
c) Upgrades the old package to the new package
d) Downgrades the new package to the old package
Answer: b) Replaces the old package with the new package
Explanation: The “dnf swap old-package new-package” command replaces the old package with the new package in Fedora systems.
22. Which command is used to remove orphaned packages in Fedora systems?
a) dnf clean
b) dnf remove
c) dnf autoremove
d) dnf clean packages
Answer: c) dnf autoremove
Explanation: The “dnf autoremove” command removes orphaned packages in Fedora systems.
23. What is the purpose of the “dnf config-manager” command in Fedora systems?
a) Manages repository configurations
b) Manages package configurations
c) Manages system configurations
d) Manages user configurations
Answer: a) Manages repository configurations
Explanation: The “dnf config-manager” command manages repository configurations in Fedora systems.
24. Which command is used to check if a package is installed in Fedora systems?
a) dnf check package-name
b) dnf info package-name
c) dnf search package-name
d) dnf list installed | grep package-name
Answer: d) dnf list installed | grep package-name
Explanation: The “dnf list installed | grep package-name” command checks if a package is installed in Fedora systems.
25. What does the command “dnf group list hidden” do in Fedora systems?
a) Lists hidden package groups
b) Lists hidden packages
c) Lists hidden repositories
d) Lists hidden package groups and their packages
Answer: a) Lists hidden package groups
Explanation: The “dnf group list hidden” command lists hidden package groups in Fedora systems.
26. In Debian-based systems, which command is used to reinstall a package?
a) apt-get reinstall package-name
b) apt-get install –reinstall package-name
c) apt-get reconfigure package-name
d) apt-get upgrade package-name
Answer: b) apt-get install –reinstall package-name
Explanation: The command “apt-get install –reinstall package-name” is used to reinstall a package in Debian-based systems.
27. What is the purpose of the “apt-mark manual” command in Debian-based systems?
a) Marks a package as manually installed
b) Marks a package as automatically installed
c) Marks a package as essential
d) Marks a package as recommended
Answer: a) Marks a package as manually installed
Explanation: The “apt-mark manual” command marks a package as manually installed in Debian-based systems.
28. Which command is used to download package sources in Debian-based systems?
a) apt-get source package-name
b) apt-get download package-name
c) apt-get fetch package-name
d) apt-get install source package-name
Answer: a) apt-get source package-name
Explanation: The “apt-get source package-name” command is used to download package sources in Debian-based systems.
29. What does the command “dpkg-query -W -f=’${Status} ${Version}\n'” do in Debian-based systems?
a) Lists all installed packages with their statuses and versions
b) Lists all available packages with their statuses and versions
c) Lists all installed packages with their statuses
d) Lists all available packages with their versions
Answer: a) Lists all installed packages with their statuses and versions
Explanation: The “dpkg-query -W -f=’${Status} ${Version}\n'” command lists all installed packages with their statuses and versions in Debian-based systems.
30. Which command is used to download a package without installing it in Debian-based systems?
a) apt-get download package-name
b) apt-get install package-name –download-only
c) apt-get fetch package-name
d) apt-get install package-name
Answer: a) apt-get download package-name
Explanation: The “apt-get download package-name” command is used to download a package without installing it in Debian-based systems.
31. In Fedora systems, which command is used to list all available package groups?
a) dnf group list
b) dnf group info
c) dnf group list hidden
d) dnf group install
Answer: a) dnf group list
Explanation: The “dnf group list” command is used to list all available package groups in Fedora systems.
32. What is the purpose of the “dnf module reset” command in Fedora systems?
a) Resets module configurations to their defaults
b) Removes installed modules
c) Reinstalls modules
d) Resets module repositories
Answer: a) Resets module configurations to their defaults
Explanation: The “dnf module reset” command resets module configurations to their defaults in Fedora systems.
33. Which command is used to install a package from a specific repository in Fedora systems?
a) dnf install package-name –repo=repository
b) dnf install package-name –repository=repository
c) dnf install package-name –source=repository
d) dnf install package-name –source=repository-url
Answer: b) dnf install package-name –repository=repository
Explanation: The command “dnf install package-name –repository=repository” is used to install a package from a specific repository in Fedora systems.
34. What does the command “dnf repoquery –provides package-name” do in Fedora systems?
a) Lists packages provided by a package
b) Lists packages required by a package
c) Lists packages installed on the system
d) Lists packages available in a repository
Answer: a) Lists packages provided by a package
Explanation: The “dnf repoquery –provides package-name” command lists packages provided by a package in Fedora systems.
35. Which command is used to view the changelog of a package in Fedora systems?
a) rpm -q package-name –changelog
b) rpm -q package-name –log
c) dnf changelog package-name
d) dnf info package-name –changelog
Answer: a) rpm -q package-name –changelog
Explanation: The “rpm -q package-name –changelog” command is used to view the changelog of a package in Fedora systems.
36. What is the purpose of the “dnf config-manager –add-repo” command in Fedora systems?
a) Adds a new repository
b) Removes an existing repository
c) Modifies an existing repository
d) Lists all configured repositories
Answer: a) Adds a new repository
Explanation: The “dnf config-manager –add-repo” command adds a new repository in Fedora systems.
37. Which command is used to list all installed packages along with their versions in Fedora systems?
a) rpm -qa
b) rpm -q package-name
c) dnf list installed
d) dnf list installed | grep “Installed”
Answer: a) rpm -qa
Explanation: The “rpm -qa” command lists all installed packages along with their versions in Fedora systems.
38. What does the command “dnf swap old-package new-package” do in Fedora systems?
a) Swaps the locations of two packages
b) Replaces the old package with the new package
c) Upgrades the old package to the new package
d) Downgrades the new package to the old package
Answer: b) Replaces the old package with the new package
Explanation: The “dnf swap old-package new-package” command replaces the old package with the new package in Fedora systems.
39. Which command is used to clean up metadata and packages in Fedora systems?
a) dnf clean
b) dnf clean metadata
c) dnf clean packages
d) dnf clean all
Answer: d) dnf clean all
Explanation: The “dnf clean all” command is used to clean up metadata and packages in Fedora systems.
40. What is the purpose of the “dnf download” command in Fedora systems?
a) Downloads package sources
b) Downloads package dependencies
c) Downloads package documentation
d) Downloads a package without installing it
Answer: d) Downloads a package without installing it
Explanation: The “dnf download” command is used to download a package without installing it in Fedora systems.
41. Which command is used to search for a package in the repositories in Fedora systems?
a) dnf search package-name
b) dnf find package-name
c) dnf query package-name
d) dnf search –repository=repository package-name
Answer: a) dnf search package-name
Explanation: The “dnf search package-name” command is used to search for a package in the repositories in Fedora systems.
42. What does the command “dnf distro-sync” do in Fedora systems?
a) Synchronizes installed packages with the distribution’s repository
b) Upgrades the distribution to the latest release
c) Downgrades the distribution to a previous release
d) Syncs system configuration with the distribution’s defaults
Answer: a) Synchronizes installed packages with the distribution’s repository
Explanation: The “dnf distro-sync” command synchronizes installed packages with the distribution’s repository in Fedora systems.
43. Which command is used to list all enabled repositories in Fedora systems?
a) dnf repository list
b) dnf config-manager –list-enabled
c) dnf repo-list –enabled
d) dnf repoquery –enabled
Answer: b) dnf config-manager –list-enabled
Explanation: The “dnf config-manager –list-enabled” command is used to list all enabled repositories in Fedora systems.
44. What is the purpose of the “dnf swap-all” command in Fedora systems?
a) Swaps all installed packages
b) Swaps all installed packages with their dependencies
c) Swaps all installed packages and their configurations
d) Swaps all installed packages and their metadata
Answer: a) Swaps all installed packages
Explanation: The “dnf swap-all” command swaps all installed packages in Fedora systems.
45. Which command is used to list all enabled modules in Fedora systems?
a) dnf module list
b) dnf module list enabled
c) dnf module list –enabled
d) dnf module list | grep “Enabled”
Answer: b) dnf module list enabled
Explanation: The “dnf module list enabled” command is used to list all enabled modules in Fedora systems.
46. In Debian-based systems, which command is used to show the dependencies of a specific package?
a) apt-cache depends package-name
b) apt-cache show package-name
c) apt-cache list package-name
d) apt-cache search package-name
Answer: a) apt-cache depends package-name
Explanation: The command “apt-cache depends package-name” is used to show the dependencies of a specific package in Debian-based systems.
47. What is the purpose of the “apt-get changelog” command in Debian-based systems?
a) Displays the changelog of a package
b) Updates the changelog of a package
c) Removes the changelog of a package
d) Modifies the changelog of a package
Answer: a) Displays the changelog of a package
Explanation: The “apt-get changelog” command is used to display the changelog of a package in Debian-based systems.
48. Which command is used to list all available package versions in Fedora systems?
a) dnf version package-name
b) dnf list –versions package-name
c) dnf repoquery –versions package-name
d) dnf history package-name
Answer: c) dnf repoquery –versions package-name
Explanation: The “dnf repoquery –versions package-name” command is used to list all available package versions in Fedora systems.
49. What is the purpose of the “dnf config-manager –enable” command in Fedora systems?
a) Enables a repository
b) Disables a repository
c) Removes a repository
d) Lists all repositories
Answer: a) Enables a repository
Explanation: The “dnf config-manager –enable” command enables a repository in Fedora systems.
50. Which command is used to list all repositories configured in Fedora systems?
a) dnf repository list
b) dnf config-manager –list-repos
c) dnf repo-list
d) dnf repoquery –list-repos
Answer: b) dnf config-manager –list-repos
Explanation: The “dnf config-manager –list-repos” command is used to list all repositories configured in Fedora systems.