search
HomeSystem TutorialLINUXUse these commands to easily see what packages are installed on your Linux PC

Use these commands to easily see what packages are installed on your Linux PC

怎么列举Linux上已安装的软件包

使用这种命令可以轻松查看LinuxPC上安装了什么软件包。

在安装新软件包之前,您须要检测它是否已安装在您的系统上。据悉,假若您要转移到新系统,拥有所有已安装软件包的列表可以节约大量时间和精力。它还可以帮助您辨识想要删掉的不须要的软件包以释放一些空间。

以下是怎样列举各类Linux发行版(包括Ubuntu、Debian、CentOS、ArchLinux和openSUSE)上所有已安装的软件包的方式。

列举Ubuntu/Debian上已安装的软件包

在基于Debian的发行版上,您可以使用APT包管理器来查找、安装、更新和删掉包。使用APT,您还可以列举Debian/Ubuntu上所有已安装的程序及其版本和一些其他信息。

要列举基于Debian的发行版上所有已安装的软件包,请使用以下命令:

apt list --installed

该列表显示带有[installed]、[installed,automatic]和[installed,local]标签的不同软件包。

您还可以使用grep命令从已安装的程序列表中搜索程序,如下所示:

apt list --installed | grep program_name

您还可以使用dpkg实用程序列举已安装的软件包:

dpkg -l

linux怎么查看什么系统_如何查看linux是什么系统_linux查看什么系统

要仅复印已安装软件包的名称,请结合使用dpkg命令和awk,如下所示:

dpkg -l | awk '{print $2}'

查看基于RHEL的发行版上已安装的软件包

YUM和DNF用于管理基于RHEL的发行版中的包。使用它们,您可以在PC上安装、更新、列出和删掉软件包

尽管YUM不再在较新的发行版(比如RHEL8、CentOS8、Fedora22等)中使用,但它依然可以在大多数发行版中使用。RPM还容许您安装和管理本地RPM软件包。

要使用YUM列举基于RHEL的发行版上所有已安装的软件包,请使用:

yum list installed

对于使用DNF安装的软件包,请使用:

dnf list installed

您还可以使用以下rpm命令列举基于RHEL的发行版上已安装的软件包:

rpm -qa

上述命令的--last选项列举了所有近来安装的软件包,最新的软件包坐落底部:

rpm -qa --last

此命令还列举已安装包的日期和时间以及包的名称:

rpm -qa --last | tac

列举ArchLinux上已安装的软件包

Pacman是基于Arch的Linux发行版(比如Manjaro和EndeavourOS)上的默认包管理器。使用Pacman,您可以在基于Arch的发行版中安装和删掉软件包、更新过时的软件包以及查看所有已安装软件包的列表。

以下命令用于列举基于Arch的发行版上所有已安装的软件包:

pacman -Q

要列举所有显式安装的软件包,请使用:

pacman -Qe

要列举从main之外的储存库自动安装的所有外部软件包linux服务器系统,请使用:

pacman -Qm

倘若您要在已安装的软件包列表中查找特定的软件包,请使用:

pacman -Q | grep 

linux查看什么系统_linux怎么查看什么系统_如何查看linux是什么系统

列举openSUSE上已安装的软件包

Zypper是openSUSE中默认的命令行包管理器。要列举openSUSE上所有已安装的软件包,请使用以下命令之一:

zypper search --installed-only

或则:

zypper se -i

要检测特定包是否在已安装的包列表中,请使用以下句型:

zypper se -i 

您还可以使用以下命令复印有关已安装软件包的信息:

zypper info 

查看Linux上已安装的Snap软件包

不仅传统的外置包管理器之外,还有一些程序可以通过Snap安装在Linux系统上。

Snap是所有主要Linux发行版都支持的通用包管理器。因为Snap软件包及其依赖项一起提供,因而Linux上的软件安装显得愈发容易。

要列举任何Linux发行版上已安装的Snap软件包,请运行:

如何查看linux是什么系统_linux查看什么系统_linux怎么查看什么系统

snap list

此命令列举您已使用Snap安装的软件包。它不包括您使用默认包管理器安装的任何包。

不仅已安装的软件包名称之外,该列表还包含一些其他信息,比如软件包的版本号、修订号、渠道信息、发布者名称以及任何其他信息(假如有)。

列举已安装的Flatpak软件包

与Snap类似,Flatpak也是一个在Linux上更轻松地进行包管理的工具。您可以在所有主要Linux发行版上安装Flatpak,而且可以使用它在Linux上建立、安装和运行应用程序。

要列举Flatpak已安装的软件包,请使用以下命令:

flatpak list

此命令列举Linux系统上所有安装的Flatpak软件包和运行时。运行时是应用程序运行所需的一组依赖项。

要仅列举已安装的应用程序,请使用--app选项,如下所示:

flatpak list --app

同样,要仅列举已安装的运行时,请使用--runtime选项:

linux怎么查看什么系统_linux查看什么系统_如何查看linux是什么系统

flatpak list --runtime

要查看有关所列项目的详尽信息,比如已安装的应用程序大小、体系结构、来源等如何查看linux是什么系统,请使用-d选项:

flatpak list -d

您还可以跳过所有额外信息,仅使用以下命令复印已安装应用程序的名称:

flatpak --columns=name list

将已安装程序的列表保存在文件中

要将所有已安装程序的列表保存在文件中,请使用重定向运算符(>)后跟文件名嵌入式linux培训,将命令输出重定向到文件。

比如,要将APT安装程序的列表保存在名为installed_programs.txt的文本文件中,命令为:

apt list --installed > installed_programs.txt

估算已安装的软件包数目

您还可以使用wc命令估算列表中已安装软件包的数目。比如如何查看linux是什么系统,要统计openSUSE中Zypper安装的软件包数目,命令为:

zypper search --installed-only | wc -l

您已获得所有已安装Linux软件包的列表!

如今您晓得Linux系统上安装了什么软件包,您可以轻松更新过时的软件包或通过删掉不须要的软件包来清理一些空间。

据悉,拥有此程序列表还可以促使无缝过渡到新系统,使您可以安装所有这种程序,而无需单独记住它们。

The above is the detailed content of Use these commands to easily see what packages are installed on your Linux PC. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
What are the typical use cases for Linux versus Windows?What are the typical use cases for Linux versus Windows?May 03, 2025 am 12:01 AM

Linuxisidealforcustomization,development,andservermanagement,whileWindowsexcelsineaseofuse,softwarecompatibility,andgaming.Linuxoffershighconfigurabilityfordevelopersandserversetups,whereasWindowsprovidesauser-friendlyinterfaceandbroadsoftwaresupport

What are the differences in user account management between Linux and Windows?What are the differences in user account management between Linux and Windows?May 02, 2025 am 12:02 AM

The main difference between Linux and Windows in user account management is the permission model and management tools. Linux uses Unix-based permissions models and command-line tools (such as useradd, usermod, userdel), while Windows uses its own security model and graphical user interface (GUI) management tools.

How does the command line environment of Linux make it more/less secure than Windows?How does the command line environment of Linux make it more/less secure than Windows?May 01, 2025 am 12:03 AM

Linux'scommandlinecanbemoresecurethanWindowsifmanagedcorrectly,butrequiresmoreuserknowledge.1)Linux'sopen-sourcenatureallowsforquicksecurityupdates.2)Misconfigurationcanleadtovulnerabilities.Windows'commandlineismorecontrolledbutlesscustomizable,with

How to Make a USB Drive Mount Automatically in LinuxHow to Make a USB Drive Mount Automatically in LinuxApr 30, 2025 am 10:04 AM

This guide explains how to automatically mount a USB drive on boot in Linux, saving you time and effort. Step 1: Identify Your USB Drive Use the lsblk command to list all block devices. Your USB drive will likely be labeled /dev/sdb1, /dev/sdc1, etc

Best Cross-Platform Apps for Linux, Windows, and Mac in 2025Best Cross-Platform Apps for Linux, Windows, and Mac in 2025Apr 30, 2025 am 09:57 AM

Cross-platform applications have revolutionized software development, enabling seamless functionality across operating systems like Linux, Windows, and macOS. This eliminates the need to switch apps based on your device, offering consistent experien

Best Linux Tools for AI and Machine Learning in 2025Best Linux Tools for AI and Machine Learning in 2025Apr 30, 2025 am 09:44 AM

Artificial Intelligence (AI) is rapidly transforming numerous sectors, from healthcare and finance to creative fields like art and music. Linux, with its open-source nature, adaptability, and performance capabilities, has emerged as a premier platfo

5 Best Lightweight Linux Distros Without a GUI5 Best Lightweight Linux Distros Without a GUIApr 30, 2025 am 09:38 AM

Looking for a fast, minimal, and efficient Linux distribution without a graphical user interface (GUI)? Lightweight, GUI-less Linux distros are perfect for older hardware or specialized tasks like servers and embedded systems. They consume fewer res

How to Install Wine 10.0 in RedHat DistributionsHow to Install Wine 10.0 in RedHat DistributionsApr 30, 2025 am 09:32 AM

Wine 10.0 stable version release: Running Windows applications on Linux to a higher level Wine, this open source and free application, allows Linux users to run Windows software and games on Unix/Linux operating systems, ushering in the release of the 10.0 stable version! This version has been provided with source code and binary package downloads, and supports various distributions such as Linux, Windows and Mac. This edition embodies a year of hard work and over 8,600 improvements, bringing many exciting improvements. Key highlights include: Enhanced support for Bluetooth devices. Improve support for HID input devices. Optimized performance of 32-bit and 64-bit applications.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.