UNIX MCQs – Software Management (Part – 1)

UNIX Question and Answer – Software Management

UNIX MCQ – Multiple Choice Questions for exam, interview, and Entrance Test

1. Which package manager is commonly used in Debian-based distributions like Ubuntu?

a) rpm

b) dpkg

c) yum

d) pacman

Answer: b) dpkg

Explanation: dpkg is a package manager used in Debian-based distributions for installing, removing, and managing software packages.


2. Which command is used to install a package using apt-get in Ubuntu?

a) apt-get install

b) yum install

c) dpkg -i

d) pacman -S

Answer: a) apt-get install

Explanation: The apt-get install command is used in Ubuntu to install packages from repositories.


3. Which of the following package managers is used in Red Hat-based distributions like CentOS?

a) dpkg

b) apt

c) yum

d) zypper

Answer: c) yum

Explanation: yum is the package manager used in Red Hat-based distributions like CentOS for managing software packages.


4. What is the purpose of the command “apt-cache search” in Debian-based distributions?

a) Install a package

b) Remove a package

c) Search for a package

d) Update package information

Answer: c) Search for a package

Explanation: The apt-cache search command is used to search for packages in the repository.


5. Which command is used to remove a package using yum in CentOS?

a) yum uninstall

b) yum remove

c) yum erase

d) yum delete

Answer: b) yum remove

Explanation: The yum remove command is used in CentOS to remove installed packages.


6. What does the command “yum update” do in CentOS?

a) Installs new packages

b) Removes outdated packages

c) Updates installed packages

d) Cleans package cache

Answer: c) Updates installed packages

Explanation: The yum update command updates all installed packages to their latest versions in CentOS.


7. Which package manager is used in Arch Linux?

a) dpkg

b) apt

c) pacman

d) yum

Answer: c) pacman

Explanation: pacman is the package manager used in Arch Linux for managing software packages.


8. What is the purpose of the command “pacman -Syu” in Arch Linux?

a) Install a package

b) Remove a package

c) Update package database

d) Update installed packages

Answer: d) Update installed packages

Explanation: The pacman -Syu command updates all installed packages in Arch Linux to their latest versions.


9. Which command is used to list installed packages in Debian-based distributions?

a) dpkg -l

b) apt list

c) yum list installed

d) pacman -Q

Answer: a) dpkg -l

Explanation: The dpkg -l command lists all installed packages in Debian-based distributions.


10. What does the command “apt-get upgrade” do in Debian-based distributions?

a) Installs new packages

b) Removes outdated packages

c) Upgrades installed packages

d) Updates package information

Answer: c) Upgrades installed packages

Explanation: The apt-get upgrade command upgrades installed packages to their latest versions in Debian-based distributions.


11. Which command is used to search for available packages using yum in CentOS?

a) yum search

b) yum find

c) yum list

d) yum info

Answer: a) yum search

Explanation: The yum search command is used to search for available packages in CentOS.


12. What is the purpose of the command “pacman -Ss” in Arch Linux?

a) Install a package

b) Search for a package

c) Display package information

d) Update package database

Answer: b) Search for a package

Explanation: The pacman -Ss command is used to search for packages in Arch Linux.


13. Which command is used to install a local package file in Debian-based distributions?

a) apt-get install

b) dpkg -i

c) yum install

d) pacman -U

Answer: b) dpkg -i

Explanation: The dpkg -i command is used to install a local package file in Debian-based distributions.


14. What does the command “yum clean all” do in CentOS?

a) Removes outdated packages

b) Removes package cache

c) Removes orphaned packages

d) Cleans metadata and cache

Answer: d) Cleans metadata and cache

Explanation: The yum clean all command removes metadata and cache in CentOS.


15. Which command is used to display detailed information about a package in Debian-based distributions?

a) apt info

b) apt show

c) dpkg -s

d) dpkg -I

Answer: b) apt show

Explanation: The apt show command displays detailed information about a package in Debian-based distributions.


16. What is the purpose of the command “pacman -R” in Arch Linux?

a) Install a package

b) Remove a package

c) Reinstall a package

d) Rollback a package

Answer: b) Remove a package

Explanation: The pacman -R command is used to remove a package in Arch Linux.


17. Which command is used to display the dependencies of a package in Debian-based distributions?

a) apt depends

b) apt-cache depends

c) dpkg -I

d) dpkg -s

Answer: b) apt-cache depends

Explanation: The apt-cache depends command is used to display the dependencies of a package in Debian-based distributions.


18. What is the purpose of the command “yum history” in CentOS?

a) Display system history

b) Display package history

c) Display repository history

d) Display transaction history

Answer: d) Display transaction history

Explanation: The yum history command displays transaction history in CentOS.


19. Which command is used to reinstall a package in Arch Linux?

a) pacman -U

b) pacman -S

c) pacman -R

d) pacman -Syu

Answer: b) pacman -S

Explanation: The pacman -S command is used to reinstall a package in Arch Linux.


20. What is the purpose of the command “apt autoremove” in Debian-based distributions?

a) Install new packages

b) Remove unused packages

c) Remove broken packages

d) Remove conflicting packages

Answer: b) Remove unused packages

Explanation: The apt autoremove command removes unused packages in Debian-based distributions.


21. Which command is used to downgrade a package to a specific version in CentOS?

a) yum downgrade

b) yum install

c) yum history

d) yum rollback

Answer: a) yum downgrade

Explanation: The yum downgrade command is used to downgrade a package to a specific version in CentOS.


22. What does the command “pacman -Sy” do in Arch Linux?

a) Install a package

b) Update package database

c) Remove a package

d) Clean package cache

Answer: b) Update package database

Explanation: The pacman -Sy command updates the package database in Arch Linux.


23. Which command is used to prevent a package from being updated in Debian-based distributions?

a) apt hold

b) apt pin

c) apt lock

d) apt freeze

Answer: b) apt pin

Explanation: The apt pin command is used to prevent a package from being updated in Debian-based distributions.


24. What is the purpose of the command “yum grouplist” in CentOS?

a) List installed packages

b) List available package groups

c) List repository information

d) List package dependencies

Answer: b) List available package groups

Explanation: The yum grouplist command lists available package groups in CentOS.


25. Which command is used to display the files installed by a package in Debian-based distributions?

a) apt files

b) dpkg -L

c) apt list

d) dpkg -S

Answer: b) dpkg -L

Explanation: The dpkg -L command is used to display the files installed by a package in Debian-based distributions.


26. Which command is used to display the information about a specific package in Debian-based distributions?

a) apt info

b) apt show

c) dpkg -i

d) dpkg -s

Answer: b) apt show

Explanation: The apt show command displays detailed information about a specific package in Debian-based distributions.


27. What is the purpose of the “apt-get purge” command in Debian-based distributions?

a) Install a package

b) Remove a package along with its configuration files

c) Remove a package

d) Update package database

Answer: b) Remove a package along with its configuration files

Explanation: The apt-get purge command removes a package along with its configuration files in Debian-based distributions.


28. Which command is used to install a package in CentOS?

a) rpm -i

b) yum install

c) yum add

d) dnf install

Answer: b) yum install

Explanation: The yum install command is used to install a package in CentOS.


29. What does the command “dnf search” do in Fedora?

a) Install a package

b) Remove a package

c) Search for a package

d) Update package database

Answer: c) Search for a package

Explanation: The dnf search command is used to search for a package in Fedora.


30. Which command is used to display the information about a specific package in Arch Linux?

a) pacman -i

b) pacman -Q

c) pacman -Ss

d) pacman -Si

Answer: d) pacman -Si

Explanation: The pacman -Si command displays detailed information about a specific package in Arch Linux.


31. What is the purpose of the “pacman -Rs” command in Arch Linux?

a) Install a package

b) Remove a package along with its dependencies

c) Remove a package

d) Update package database

Answer: b) Remove a package along with its dependencies

Explanation: The pacman -Rs command removes a package along with its dependencies in Arch Linux.


32. Which command is used to update the package database in Debian-based distributions?

a) apt update

b) apt upgrade

c) apt refresh

d) apt-get update

Answer: d) apt-get update

Explanation: The apt-get update command updates the package database in Debian-based distributions.


33. What does the command “dnf upgrade” do in Fedora?

a) Installs new packages

b) Removes outdated packages

c) Upgrades installed packages

d) Updates package database

Answer: c) Upgrades installed packages

Explanation: The dnf upgrade command upgrades installed packages to their latest versions in Fedora.


34. Which command is used to list available package groups in CentOS?

a) yum groupinfo

b) yum grouplist

c) yum groupinstall

d) yum groupremove

Answer: b) yum grouplist

Explanation: The yum grouplist command lists available package groups in CentOS.


35. What is the purpose of the “dnf history” command in Fedora?

a) Display system history

b) Display package history

c) Display repository history

d) Display transaction history

Answer: d) Display transaction history

Explanation: The dnf history command displays transaction history in Fedora.


36. Which command is used to reinstall a package in Debian-based distributions?

a) apt reinstall

b) apt-get reinstall

c) apt install –reinstall

d) dpkg –reinstall

Answer: c) apt install –reinstall

Explanation: The apt install –reinstall command is used to reinstall a package in Debian-based distributions.


37. What does the command “yum clean all” do in CentOS?

a) Removes outdated packages

b) Removes package cache

c) Removes orphaned packages

d) Cleans metadata and cache

Answer: d) Cleans metadata and cache

Explanation: The yum clean all command removes metadata and cache in CentOS.


38. Which command is used to prevent a package from being updated in CentOS?

a) yum hold

b) yum pin

c) yum lock

d) yum freeze

Answer: c) yum lock

Explanation: The yum lock command is used to prevent a package from being updated in CentOS.


39. What is the purpose of the “dnf downgrade” command in Fedora?

a) Downgrade installed packages to a specific version

b) Remove outdated packages

c) Revert system to a previous state

d) Update installed packages

Answer: a) Downgrade installed packages to a specific version

Explanation: The dnf downgrade command is used to downgrade installed packages to a specific version in Fedora.


40. Which command is used to display the files installed by a package in CentOS?

a) yum files

b) rpm -ql

c) yum list files

d) rpm -q –filesbypkg

Answer: b) rpm -ql

Explanation: The rpm -ql command is used to display the files installed by a package in CentOS.


41. What does the command “apt-mark hold” do in Debian-based distributions?

a) Hold a package from being upgraded

b) Install a package

c) Remove a package

d) Update package information

Answer: a) Hold a package from being upgraded

Explanation: The apt-mark hold command holds a package from being upgraded in Debian-based distributions.


42. Which command is used to list available package groups in Fedora?

a) dnf groupinfo

b) dnf grouplist

c) dnf groupinstall

d) dnf groupremove

Answer: b) dnf grouplist

Explanation: The dnf grouplist command lists available package groups in Fedora.


43. What is the purpose of the “dnf remove” command in Fedora?

a) Install a package

b) Remove a package

c) Reinstall a package

d) Update installed packages

Answer: b) Remove a package

Explanation: The dnf remove command is used to remove a package in Fedora.


44. Which command is used to display the dependencies of a package in CentOS?

a) yum depends

b) yum deplist

c) yum listdeps

d) yum info

Answer: b) yum deplist

Explanation: The yum deplist command is used to display the dependencies of a package in CentOS.


45. What does the command “rpm -qa” do in CentOS?

a) List installed packages

b) List available packages

c) List package groups

d) List repository information

Answer: a) List installed packages

Explanation: The rpm -qa command lists all installed packages in CentOS.


46. Which command is used to clean the package cache in Fedora?

a) dnf clean all

b) dnf clean cache

c) dnf clean metadata

d) dnf clean packages

Answer: a) dnf clean all

Explanation: The dnf clean all command is used to clean the package cache in Fedora.


47. What is the purpose of the “dnf swap” command in Fedora?

a) Swap package versions

b) Swap package repositories

c) Swap package groups

d) Swap package formats

Answer: a) Swap package versions

Explanation: The dnf swap command is used to swap package versions in Fedora.


48. Which command is used to display the history of transactions in Arch Linux?

a) pacman -Q

b) pacman -R

c) pacman -Si

d) pacman -Rns

Answer: a) pacman -Q

Explanation: The pacman -Q command displays the history of transactions in Arch Linux.


49. What does the command “pacman -Syuw” do in Arch Linux?

a) Install a package

b) Update package database

c) Check for updates

d) Synchronize package lists and download upgrades

Answer: d) Synchronize package lists and download upgrades

Explanation: The pacman -Syuw command synchronizes package lists and downloads upgrades in Arch Linux.


50. Which command is used to remove orphaned packages in Arch Linux?

a) pacman -Rns

b) pacman -Rc

c) pacman -Rdd

d) pacman -R $(pacman -Qdtq)

Answer: d) pacman -R $(pacman -Qdtq)

Explanation: The pacman -R $(pacman -Qdtq) command is used to remove orphaned packages in Arch Linux.

Related Articles

Linux MCQ

Welcome to Linux Multiple Choice Questions (MCQ) Section Embark on a journey through the world of...