2021-05-12 14:32:11
如何在 Linux 中列出可用的軟體包組
我們知道,如果想要在 Linux 中安裝軟體包,可以使用軟體包管理器來進行安裝。由於系統管理員需要頻繁用到軟體包管理器,所以它是 Linux 當中的一個重要工具。
但是如果想一次性安裝一個軟體包組,在 Linux 中有可能嗎?又如何通過命令去實現呢?
在 Linux 中確實可以用軟體包管理器來達到這樣的目的。很多軟體包管理器都有這樣的選項來實現這個功能,但就我所知,apt
或 apt-get
軟體包管理器卻並沒有這個選項。因此對基於 Debian 的系統,需要使用的命令是 tasksel
,而不是 apt
或 apt-get
這樣的官方軟體包管理器。
在 Linux 中安裝軟體包組有很多好處。對於 LAMP 來說,安裝過程會包含多個軟體包,但如果安裝軟體包組命令來安裝,只安裝一個包就可以了。
當你的團隊需要安裝 LAMP,但不知道其中具體包含哪些軟體包,這個時候軟體包組就派上用場了。軟體包組是 Linux 系統上一個很方便的工具,它能讓你輕鬆地完成一組軟體包的安裝。
軟體包組是一組用於公共功能的軟體包,包括系統工具、聲音和視訊。 安裝軟體包組的過程中,會獲取到一系列的依賴包,從而大大節省了時間。
如何在 CentOS/RHEL 系統上列出可用的軟體包組
RHEL 和 CentOS 系統使用的是 RPM 軟體包,因此可以使用 yum
軟體包管理器來獲取相關的軟體包資訊。
yum
是 “Yellowdog Updater, Modified” 的縮寫,它是一個用於基於 RPM 系統(例如 RHEL 和 CentOS)的,開源的命令列軟體包管理工具。它是從發行版倉庫或其它第三方庫中獲取、安裝、刪除、查詢和管理 RPM 包的主要工具。
#yum grouplist
Loaded plugins: fastestmirror, security
Setting up GroupProcess
Loading mirror speeds from cached hostfile
* epel: epel.mirror.constant.com
InstalledGroups:
Base
E-mail server
GraphicalAdministrationTools
Hardware monitoring utilities
Legacy UNIX compatibility
Milkymist
NetworkingTools
PerformanceTools
PerlSupport
SecurityTools
AvailableGroups:
AdditionalDevelopment
BackupClient
BackupServer
CIFS file server
Client management tools
Compatibility libraries
Console internet tools
DebuggingTools
Desktop
.
.
AvailableLanguageGroups:
AfrikaansSupport[af]
AlbanianSupport[sq]
AmazighSupport[ber]
ArabicSupport[ar]
ArmenianSupport[hy]
AssameseSupport[as]
AzerbaijaniSupport[az]
.
.
Done
如果需要列出相關聯的軟體包,可以執行以下這個命令。下面的例子是列出和 “Performance Tools” 組相關聯的軟體包。
#yum groupinfo "Performance Tools"
Loaded plugins: fastestmirror, security
Setting up GroupProcess
Loading mirror speeds from cached hostfile
* epel: ewr.edge.kernel.org
Group:PerformanceTools
Description:Toolsfor diagnosing system and application-level performance problems.
MandatoryPackages:
blktrace
sysstat
DefaultPackages:
dstat
iotop
latencytop
latencytop-tui
oprofile
perf
powertop
seekwatcher
OptionalPackages:
oprofile-jit
papi
sdparm
sg3_utils
tiobench
tuned
tuned-utils
如何在 Fedora 系統上列出可用的軟體包組
Fedora 系統使用的是 DNF 軟體包管理器,因此可以通過 DNF 軟體包管理器來獲取相關的資訊。
DNF 的含義是 “Dandified yum”。DNF 軟體包管理器是 YUM 軟體包管理器的一個分支,它使用 hawkey/libsolv 庫作為後端。從 Fedora 18 開始,Aleš Kozumplík 開始著手 DNF 的開發,直到在 Fedora 22 開始加入到系統中。
dnf
命令可以在 Fedora 22 及更高版本上安裝、更新、搜尋和刪除軟體包, 它可以自動解決軟體包的依賴關係並其順利安裝,不會產生問題。
YUM 被 DNF 取代是由於 YUM 中存在一些長期未被解決的問題。為什麼 Aleš Kozumplík 沒有對 yum 的這些問題作出修補呢,他認為修補程式解決存在技術上的難題,而 YUM 團隊也不會馬上接受這些更改,還有一些重要的問題。而且 YUM 的代???量有 5.6 萬行,而 DNF 只有 2.9 萬行。因此已經不需要沿著 YUM 的方向繼續開發了,重新開一個分支才是更好的選擇。
# dnf grouplist
Last metadata expiration check:0:00:00 ago on Sun09Sep201807:10:36 PM IST.
AvailableEnvironmentGroups:
FedoraCustomOperatingSystem
MinimalInstall
FedoraServerEdition
FedoraWorkstation
FedoraCloudServer
KDE PlasmaWorkspaces
XfceDesktop
LXDE Desktop
HawaiiDesktop
LXQtDesktop
CinnamonDesktop
MATE Desktop
SugarDesktopEnvironment
DevelopmentandCreativeWorkstation
WebServer
InfrastructureServer
BasicDesktop
InstalledGroups:
C DevelopmentToolsandLibraries
DevelopmentTools
AvailableGroups:
3DPrinting
AdministrationTools
Ansible node
AudioProduction
AuthoringandPublishing
BooksandGuides
CloudInfrastructure
CloudManagementTools
ContainerManagement
D DevelopmentToolsandLibraries
.
.
RPM DevelopmentTools
SecurityLab
Text-based Internet
WindowManagers
GNOME DesktopEnvironment
GraphicalInternet
KDE (K DesktopEnvironment)
Fonts
GamesandEntertainment
HardwareSupport
SoundandVideo
SystemTools
如果需要列出相關聯的軟體包,可以執行以下這個命令。下面的例子是列出和 “Editor” 組相關聯的軟體包。
# dnf groupinfo Editors
Last metadata expiration check:0:04:57 ago on Sun09Sep201807:10:36 PM IST.
Group:Editors
Description:Sometimes called text editors, these are programs that allow you to create and edit text files.This includes EmacsandVi.
OptionalPackages:
code-editor
cssed
emacs
emacs-auctex
emacs-bbdb
emacs-ess
emacs-vm
geany
gobby
jed
joe
leafpad
nedit
poedit
psgml
vim-X11
vim-enhanced
xemacs
xemacs-packages-base
xemacs-packages-extra
xemacs-xft
xmlcopyeditor
zile
如何在 openSUSE 系統上列出可用的軟體包組
openSUSE 系統使用的是 zypper 軟體包管理器,因此可以通過 zypper 軟體包管理器來獲取相關的資訊。
Zypper 是 suse 和 openSUSE 發行版的命令列包管理器。它可以用於安裝、更新、搜尋和刪除軟體包,還有管理儲存庫,執行各種查詢等功能。 Zypper 命令列介面用到了 ZYpp 系統管理庫(libzypp)。
# zypper patterns
Loading repository data...
Warning:Repository'Update Repository (Non-Oss)' appears to be outdated.Considerusing a different mirror or server.
Warning:Repository'Main Update Repository' appears to be outdated.Considerusing a different mirror or server.
Reading installed packages...
S |Name|Version|Repository|Dependency
---|----------------------|---------------|-----------------------|-----------
|64bit|20150918-25.1|MainRepository(OSS)|
| apparmor |20150918-25.1|MainRepository(OSS)|
i | apparmor |20150918-25.1|@System|
| base |20150918-25.1|MainRepository(OSS)|
i+| base |20150918-25.1|@System|
| books |20150918-25.1|MainRepository(OSS)|
| console |20150918-25.1|MainRepository(OSS)|
| devel_C_C++|20150918-25.1|MainRepository(OSS)|
i | enhanced_base |20150918-25.1|@System|
| enlightenment |20150918-25.1|MainRepository(OSS)|
| file_server |20150918-25.1|MainRepository(OSS)|
| fonts |20150918-25.1|MainRepository(OSS)|
i | fonts |20150918-25.1|@System|
| games |20150918-25.1|MainRepository(OSS)|
i | games |20150918-25.1|@System|
| gnome |20150918-25.1|MainRepository(OSS)|
| gnome_basis |20150918-25.1|MainRepository(OSS)|
i | imaging |20150918-25.1|@System|
| kde |20150918-25.1|MainRepository(OSS)|
i+| kde |20150918-25.1|@System|
| kde_plasma |20150918-25.1|MainRepository(OSS)|
i | kde_plasma |20150918-25.1|@System|
| lamp_server |20150918-25.1|MainRepository(OSS)|
| laptop |20150918-25.1|MainRepository(OSS)|
i+| laptop |20150918-25.1|@System|
| lxde |20150918-25.1|MainRepository(OSS)|
| lxqt |20150918-25.1|MainRepository(OSS)|
i | multimedia |20150918-25.1|@System|
| network_admin |20150918-25.1|MainRepository(OSS)|
| non_oss |20150918-25.1|MainRepository(OSS)|
i | non_oss |20150918-25.1|@System|
| office |20150918-25.1|MainRepository(OSS)|
i | office |20150918-25.1|@System|
| print_server |20150918-25.1|MainRepository(OSS)|
| remote_desktop |20150918-25.1|MainRepository(OSS)|
| x11 |20150918-25.1|MainRepository(OSS)|
i+| x11 |20150918-25.1|@System|
| x86 |20150918-25.1|MainRepository(OSS)|
| xen_server |20150918-25.1|MainRepository(OSS)|
| xfce |20150918-25.1|MainRepository(OSS)|
| xfce_basis |20150918-25.1|MainRepository(OSS)|
| yast2_basis |20150918-25.1|MainRepository(OSS)|
i | yast2_basis |20150918-25.1|@System|
| yast2_install_wf |20150918-25.1|MainRepository(OSS)|
如果需要列出相關聯的軟體包,可以執行以下這個命令。下面的例子是列出和 “file_server” 組相關聯的軟體包。另外 zypper
還允許使用者使用不同的選項執行相同的操作。
# zypper info file_server
Loading repository data...
Warning:Repository'Update Repository (Non-Oss)' appears to be outdated.Considerusing a different mirror or server.
Warning:Repository'Main Update Repository' appears to be outdated.Considerusing a different mirror or server.
Reading installed packages...
Informationfor pattern file_server:
------------------------------------
Repository:MainRepository(OSS)
Name: file_server
Version:20150918-25.1
Arch: x86_64
Vendor: openSUSE
Installed:No
Visible to User:Yes
Summary:FileServer
Description:
File services to host files so that they may be accessed or retrieved by other computers on the same network.This includes the FTP, SMB,and NFS protocols.
Contents:
S |Name|Type|Dependency
---|-------------------------------|---------|------------
i+| patterns-openSUSE-base |package|Required
| patterns-openSUSE-file_server |package|Required
| nfs-kernel-server |package|Recommended
i | nfsidmap |package|Recommended
i | samba |package|Recommended
i | samba-client |package|Recommended
i | samba-winbind |package|Recommended
| tftp |package|Recommended
| vsftpd |package|Recommended
| yast2-ftp-server |package|Recommended
| yast2-nfs-server |package|Recommended
i | yast2-samba-server |package|Recommended
| yast2-tftp-server |package|Recommended
如果需要列出相關聯的軟體包,可以執行以下這個命令。
# zypper pattern-info file_server
Loading repository data...
Warning:Repository'Update Repository (Non-Oss)' appears to be outdated.Considerusing a different mirror or server.
Warning:Repository'Main Update Repository' appears to be outdated.Considerusing a different mirror or server.
Reading installed packages...
Informationfor pattern file_server:
------------------------------------
Repository:MainRepository(OSS)
Name: file_server
Version:20150918-25.1
Arch: x86_64
Vendor: openSUSE
Installed:No
Visible to User:Yes
Summary:FileServer
Description:
File services to host files so that they may be accessed or retrieved by other computers on the same network.This includes the FTP, SMB,and NFS protocols.
Contents:
S |Name|Type|Dependency
---|-------------------------------|---------|------------
i+| patterns-openSUSE-base |package|Required
| patterns-openSUSE-file_server |package|Required
| nfs-kernel-server |package|Recommended
i | nfsidmap |package|Recommended
i | samba |package|Recommended
i | samba-client |package|Recommended
i | samba-winbind |package|Recommended
| tftp |package|Recommended
| vsftpd |package|Recommended
| yast2-ftp-server |package|Recommended
| yast2-nfs-server |package|Recommended
i | yast2-samba-server |package|Recommended
| yast2-tftp-server |package|Recommended
如果需要列出相關聯的軟體包,也可以執行以下這個命令。
# zypper info pattern file_server
Loading repository data...
Warning:Repository'Update Repository (Non-Oss)' appears to be outdated.Considerusing a different mirror or server.
Warning:Repository'Main Update Repository' appears to be outdated.Considerusing a different mirror or server.
Reading installed packages...
Informationfor pattern file_server:
------------------------------------
Repository:MainRepository(OSS)
Name: file_server
Version:20150918-25.1
Arch: x86_64
Vendor: openSUSE
Installed:No
Visible to User:Yes
Summary:FileServer
Description:
File services to host files so that they may be accessed or retrieved by other computers on the same network.This includes the FTP, SMB,and NFS protocols.
Contents:
S |Name|Type|Dependency
---|-------------------------------|---------|------------
i+| patterns-openSUSE-base |package|Required
| patterns-openSUSE-file_server |package|Required
| nfs-kernel-server |package|Recommended
i | nfsidmap |package|Recommended
i | samba |package|Recommended
i | samba-client |package|Recommended
i | samba-winbind |package|Recommended
| tftp |package|Recommended
| vsftpd |package|Recommended
| yast2-ftp-server |package|Recommended
| yast2-nfs-server |package|Recommended
i | yast2-samba-server |package|Recommended
| yast2-tftp-server |package|Recommended
如果需要列出相關聯的軟體包,也可以執行以下這個命令。
# zypper info-t pattern file_server
Loading repository data...
Warning:Repository'Update Repository (Non-Oss)' appears to be outdated.Considerusing a different mirror or server.
Warning:Repository'Main Update Repository' appears to be outdated.Considerusing a different mirror or server.
Reading installed packages...
Informationfor pattern file_server:
------------------------------------
Repository:MainRepository(OSS)
Name: file_server
Version:20150918-25.1
Arch: x86_64
Vendor: openSUSE
Installed:No
Visible to User:Yes
Summary:FileServer
Description:
File services to host files so that they may be accessed or retrieved by other computers on the same network.This includes the FTP, SMB,and NFS protocols.
Contents:
S |Name|Type|Dependency
---|-------------------------------|---------|------------
i+| patterns-openSUSE-base |package|Required
| patterns-openSUSE-file_server |package|Required
| nfs-kernel-server |package|Recommended
i | nfsidmap |package|Recommended
i | samba |package|Recommended
i | samba-client |package|Recommended
i | samba-winbind |package|Recommended
| tftp |package|Recommended
| vsftpd |package|Recommended
| yast2-ftp-server |package|Recommended
| yast2-nfs-server |package|Recommended
i | yast2-samba-server |package|Recommended
| yast2-tftp-server |package|Recommended
如何在 Debian/Ubuntu 系統上列出可用的軟體包組
由於 APT 或 APT-GET 軟體包管理器沒有為基於 Debian/Ubuntu 的系統提供這樣的選項,因此需要使用 tasksel
命令來獲取相關資訊。
tasksel 是 Debian/Ubuntu 系統上一個很方便的工具,只需要很少的操作就可以用它來安裝好一組軟體包。可以在 /usr/share/tasksel
目錄下的 .desc
檔案中安排軟體包的安裝任務。
預設情況下,tasksel
工具是作為 Debian 系統的一部分安裝的,但桌面版 Ubuntu 則沒有自帶 tasksel
,這個功能類似軟體包管理器中的元包(meta-packages)。
tasksel
工具帶有一個基於 zenity 的簡單使用者介面,例如命令列中的彈出圖形對話方塊。
# tasksel --list-task
u kubuntu-live Kubuntu live CD
u lubuntu-live-gtk Lubuntu live CD (GTK part)
u ubuntu-budgie-live UbuntuBudgie live CD
u ubuntu-live Ubuntu live CD
u ubuntu-mate-live Ubuntu MATE Live CD
u ubuntustudio-dvd-live UbuntuStudio live DVD
u vanilla-gnome-live Ubuntu GNOME live CD
u xubuntu-live Xubuntu live CD
u cloud-image UbuntuCloudImage(instance)
u dns-server DNS server
u kubuntu-desktop Kubuntu desktop
u kubuntu-full Kubuntu full
u lamp-server LAMP server
u lubuntu-core Lubuntu minimal installation
u lubuntu-desktop LubuntuDesktop
u lubuntu-gtk-core Lubuntu minimal installation (GTK part)
u lubuntu-gtk-desktop LubuntuDesktop(GTK part)
u lubuntu-qt-core Lubuntu minimal installation (Qt part)
u lubuntu-qt-desktop LubuntuQtDesktop(Qt part)
u mail-server Mail server
u postgresql-server PostgreSQL database
i print-server Print server
u samba-server Sambafile server
u tomcat-server TomcatJava server
u ubuntu-budgie-desktop UbuntuBudgie desktop
i ubuntu-desktop Ubuntu desktop
u ubuntu-mate-core Ubuntu MATE minimal
u ubuntu-mate-desktop Ubuntu MATE desktop
i ubuntu-usb Ubuntu desktop USB
u ubuntustudio-audio Audio recording and editing suite
u ubuntustudio-desktop UbuntuStudio desktop
u ubuntustudio-desktop-core UbuntuStudio minimal DE installation
u ubuntustudio-fonts Large selection of font packages
u ubuntustudio-graphics 2D/3D creation and editing suite
u ubuntustudio-photography Photograph touchup and editing suite
u ubuntustudio-publishing Publishing applications
u ubuntustudio-video Video creation and editing suite
u vanilla-gnome-desktop Vanilla GNOME desktop
u xubuntu-core Xubuntu minimal installation
u xubuntu-desktop Xubuntu desktop
u openssh-server OpenSSH server
u server BasicUbuntu server
如果需要列出相關聯的軟體包,可以執行以下這個命令。下面的例子是列出和 “lamp-server” 組相關聯的軟體包。
# tasksel --task-desc "lamp-server"
Selects a ready-made Linux/Apache/MySQL/PHP server.
如何在基於 Arch Linux 的系統上列出可用的軟體包組
基於 Arch Linux 的系統使用的是 pacman 軟體包管理器,因此可以通過 pacman 軟體包管理器來獲取相關的資訊。
pacman 是 “package manager” 的縮寫。pacman
可以用於安裝、構建、刪除和管理 Arch Linux 軟體包。pacman
使用 libalpm(Arch Linux Package Management 庫,ALPM)作為後端來執行所有操作。
# pacman -Sg
base-devel
base
multilib-devel
gnome-extra
kde-applications
kdepim
kdeutils
kdeedu
kf5
kdemultimedia
gnome
plasma
kdegames
kdesdk
kdebase
xfce4
fprint
kdegraphics
kdenetwork
kdeadmin
kf5-aids
kdewebdev
.
.
dlang-ldc
libretro
ring
lxqt
non-daw
non
alsa
qtcurve
realtime
sugar-fructose
tesseract-data
vim-plugins
如果需要列出相關聯的軟體包,可以執行以下這個命令。下面的例子是列出和 “gnome” 組相關聯的軟體包。
# pacman -Sg gnome
gnome baobab
gnome cheese
gnome eog
gnome epiphany
gnome evince
gnome file-roller
gnome gdm
gnome gedit
gnome gnome-backgrounds
gnome gnome-calculator
gnome gnome-calendar
gnome gnome-characters
gnome gnome-clocks
gnome gnome-color-manager
gnome gnome-contacts
gnome gnome-control-center
gnome gnome-dictionary
gnome gnome-disk-utility
gnome gnome-documents
gnome gnome-font-viewer
.
.
gnome sushi
gnome totem
gnome tracker
gnome tracker-miners
gnome vino
gnome xdg-user-dirs-gtk
gnome yelp
gnome gnome-boxes
gnome gnome-software
gnome simple-scan
也可以執行以下這個命令實現同樣的效果。
# pacman -S gnome
::There are 64 members in group gnome:
::Repository extra
1) baobab 2) cheese 3) eog 4) epiphany 5) evince 6)file-roller 7) gdm 8) gedit 9) gnome-backgrounds 10) gnome-calculator 11) gnome-calendar 12) gnome-characters 13) gnome-clocks
14) gnome-color-manager 15) gnome-contacts 16) gnome-control-center 17) gnome-dictionary 18) gnome-disk-utility 19) gnome-documents 20) gnome-font-viewer 21) gnome-getting-started-docs
22) gnome-keyring 23) gnome-logs 24) gnome-maps 25) gnome-menus 26) gnome-music 27) gnome-photos 28) gnome-screenshot 29) gnome-session 30) gnome-settings-daemon 31) gnome-shell
32) gnome-shell-extensions 33) gnome-system-monitor 34) gnome-terminal 35) gnome-themes-extra 36) gnome-todo 37) gnome-user-docs 38) gnome-user-share 39) gnome-video-effects 40) grilo-plugins
41) gvfs 42) gvfs-afc 43) gvfs-goa 44) gvfs-google 45) gvfs-gphoto2 46) gvfs-mtp 47) gvfs-nfs 48) gvfs-smb 49) mousetweaks 50) mutter 51) nautilus 52) networkmanager 53) orca 54) rygel
55) sushi 56) totem 57) tracker 58) tracker-miners 59) vino 60) xdg-user-dirs-gtk 61) yelp
::Repository community
62) gnome-boxes 63) gnome-software 64) simple-scan
Enter a selection (default=all):^C
Interrupt signal received
可以執行以下命令檢查相關軟體包的數量。
# pacman -Sg gnome |wc-l
64
作者:Prakash Subramanian 選題:lujun9972 譯者:HankChow 校對:wxy
相關文章