Below is a table of equivalent commands for package management on both Ubuntu/Debian and Red Hat/Fedora systems.
Task |
Red Hat/Fedora |
Ubuntu |
Adding, Removing and Upgrading Packages |
||
Refresh list of available packages |
Yum refreshes each time it's used |
apt-get update |
Install a package from a repository |
yum install package_name |
apt-get install package_name |
Install a package file |
yum install package.rpm |
dpkg --install package.deb |
Remove a package |
rpm -e package_name |
apt-get remove package_name |
Check for package upgrades |
yum check-update |
apt-get -s upgrade |
Upgrade packages |
yum update |
apt-get upgrade |
Upgrade the entire system |
yum upgrade |
apt-get dist-upgrade |
Package Information |
||
Get information about an available package |
yum search package_name |
apt-cache search package_name |
Show available packages |
yum list available |
apt-cache dumpavail |
List all installed packages |
yum list installed |
dpkg --list |
Get information about a package |
yum info package_name |
apt-cache show package_name |
Get information about an installed package |
rpm -qi package_name |
dpkg --status package_name |
List files in an installed package |
rpm -ql package_name |
dpkg --listfiles package_name |
List documentation files in an installed package |
rpm -qd package_name |
- |
List configuration files in an installed package |
rpm -qc package_name |
dpkg-query --show -f '${Conffiles}\n'package_name |
Show the packages a given package depends on |
rpm -qR package_name |
apt-cache depends |
Show other packages that depend on a |
rpm -q -whatrequires [args] |
apt-cache rdepends |
Package File Information |
||
Get information about a package file |
rpm -qpi package.rpm |
dpkg --info package.deb |
List files in a package file |
rpm -qpl package.rpm |
dpkg --contents package.deb |
List documentation files in a package file |
rpm -qpd package.rpm |
- |
List configuration files in a package file |
rpm -qpc package.rpm |
- |
Extract files in a package |
rpm2cpio package.rpm | cpio -vid |
dpkg-deb --extract package.deb dir-to-extract-to |
Find package that installed a file |
rpm -qf filename |
dpkg --search filename |
Find package that provides a particular file |
yum provides filename |
apt-file search filename |
Misc. Packaging System Tools |
||
Show stats about the package cache |
- |
apt-cache stats |
Verify all installed packages |
rpm -Va |
debsums |
Remove packages from the local cache directory |
yum clean packages |
apt-get clean |
Remove only obsolete packages from the local cache directory |
- |
apt-get autoclean |
Remove header files from the local cache directory |
yum clean headers |
apt-file purge |
General Packaging System Information |
||
Package file extension |
*.rpm |
*.deb |
Repository location configuration |
/etc/yum.conf |
/etc/apt/sources.list
|
相关推荐
内容概要:本文深入剖析了 Linux系统下三种流行的包管理器——APT、DNF 和 Pacman 的特点及区别。分别介绍了每个工具的工作机制、常用命令、优缺点以及适用场景。首先,APT 主要用于基于 Debian 的系统,如 Ubuntu;...
Linux常用命令包括文件和命令使用规范,文件管理命令,权限管理命令,查询相关命令,压缩相关命令,帮助相关命令,关机与重启命令,常见网络命令,系统资源查看命令和挂载命令。 vi&vim编辑器是Linux系统中常用的...
Linux具有强大的网络功能和稳定性,且因为其开源性质,衍生出众多的发行版,如Ubuntu、RedHat、CentOS等。 关于Linux发行版,笔记提到,Linux发行版实际上就是Linux内核与一系列应用软件的集合。由于其多样性和自由...
从给定的文件信息中,我们可以提炼出一系列与Linux及其发行版相关的专业知识点,这些知识点不仅涵盖了基础的系统操作和管理,还深入到了高级应用、编程以及特定领域如网络安全和设备驱动的细节。以下是对这些知识点...
Linux版本:目前的版本有 Ubuntu、Centos、redhat、opensuse等等;其中ubuntu注重界面,Centos注重服务器。其内核版本可以通过uname -a来查看。 Linux优势:1、真正的支持多任务,多用户;2、支持多种文件系统 3、...
CentOS其实是Redhat的内核,感觉是会成熟稳定一点,相比旧Redhat,他多了一个yum的命令,学Debian一样自动安装软件;但我感觉CentOS的可以Yum的东西相比Debian或Ubuntu,实在太少了;CentOS游走在年轻与成熟之间,它...
实验中,学生需要了解Linux的发展历程、不同发行版如RedHat、Debian、Ubuntu等,并在虚拟机上安装RedHat系统,通过截图记录安装步骤。 实验内容的核心部分是掌握Linux的命令行操作,包括: 1. 查看目录和文件:...
- 支持当前主流的Linux发行版本,包括RedHat、FedoraCore、Ubuntu等,推荐使用NOILinux(版本1.0.2)。 - 支持多种编程语言,包括C/C++/Pascal。 - 配置灵活,具有多样化的功能。 - 时间控制精确,误差不大于5毫秒。...