博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
yum与apt命令比较,yum安装出现No package vim available解决办法
阅读量:5291 次
发布时间:2019-06-14

本文共 4160 字,大约阅读时间需要 13 分钟。

 (Yellowdog Updater Modified)是一个集与查找,安装,更新和删除程序的Linux软件。它运行在RPM包兼容的发行版本上,如:, Fedora, SUSE, , Mandriva。

今天我在用CentOS 5.5的yum命令安装的时候出现如下错误:

[root@malu2 ~]# yum install vim

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.hosting90.cz
* extras: mirror.hosting90.cz
* updates: mirror.hosting90.cz
Setting up Install Process
No package vim available.
Nothing to do

 

对于此错误,我一般习惯性先去更新一下yum仓库:

#yum -y update

再次运行安装,发现错误依旧,看来这种猜包名的方法不适用;所以接下来可以通过yum的查找参数来列出相关的包名:

[root@malu2 yum.repos.d]# yum search vim

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.hosting90.cz
* extras: mirror.hosting90.cz
* updates: mirror.hosting90.cz
===================== Matched: vim ===================
vim-X11.x86_64 : The VIM version of the vi editor for the X Window System.
vim-common.x86_64 : The common files needed by any version of the VIM editor.
vim-enhanced.x86_64 : A version of the VIM editor which includes recent
: enhancements.
vim-minimal.x86_64 : A minimal version of the VIM editor.

 

通过查看,我们可以看到,yum列出了详细的vim相关的包名,这样就可以顺利的安装vim了:

#yum -y install vim-enhanced.x86_64

以上命令就能执行成功了。当然不仅仅vim安装,其他程序比如mysql我们也同样只要先进行yum查找,再通过匹配详细包名来进行安装,就不会出现上述错误了

 

Yum的更新及安装操作

更新及安装:yum install package 安装指定的安装包packageyum localinstall package 本地安装软件包yum update 全部更新 yum update package 更新指定程序包package yum check-update 检查可更新的程序查找和显示yum info 
显示安装包信息 yum list 显示所有已经安装和可以安装的程序包 yum list
显示指定程序包安装情况 yum search
查找软件包

Yum和Apt-get对比

Task Red Hat/Fedora Ubuntu/Debian
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 installpackage_name apt-get installpackage_name
Install a package file yum installpackage.rpmrpm -ipackage.rpm dpkg –install package.deb
Remove a package rpm -e package_name apt-get removepackage_name
Check for package upgrades yum check-update apt-get -s upgradeapt-get -s dist-upgrade
Upgrade packages yum updaterpm -Uvh [args] apt-get dist-upgrade
Upgrade the entire system yum upgrade apt-get dist-upgrade
Package Information
Get information about an available package yum searchpackage_name apt-cache searchpackage_name
Show available packages yum list available apt-cache dumpavail
List all installed packages yum list installedrpm -qa dpkg –list
Get information about a package yum info package_name apt-cache showpackage_name
Get information about an installed package rpm -qi package_name dpkg –statuspackage_name
List files in an installed package rpm -ql package_name dpkg –listfilespackage_name
List documentation files in an installed package rpm -qd package_name -
List configuration files in an installed package rpm -qc package_name -
Show the packages a given package depends on rpm -qR package_name apt-cache depends
Show other packages that depend on agiven package (reverse dependency) 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 –contentspackage.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 –extractpackage.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(forcing a new download of same on next use) 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

转载于:https://www.cnblogs.com/tham/p/6827387.html

你可能感兴趣的文章
html5 SVG
查看>>
.Net学习 第2季06 C#面向对象 Path类 File类 FileStream类 StreamReader/StreamWriter类
查看>>
VS2008+Qt 项目目录编辑配置
查看>>
【动态规划DP】传娃娃-C++
查看>>
LOJ.121.[离线可过]动态图连通性(线段树分治 按秩合并)
查看>>
201521123072 结对编程
查看>>
最长上升子序列
查看>>
maven 依赖、聚合和继承 (转)
查看>>
selinux介绍/状态查看/开启/关闭
查看>>
DockerAPI版本不匹配的问题
查看>>
Leetcode: Ugly Number II
查看>>
项目立项管理
查看>>
(没时间维护,已下架)博客园第三方客户端-i博客园正式发布App Store
查看>>
map使用实例
查看>>
关于ShapeDrawable应用的一些介绍(上)
查看>>
洛谷 P3984 高兴的津津
查看>>
洛谷 P1308 统计单词数
查看>>
使用GitHub
查看>>
1.25回溯 n皇后问题,素数环,困难的串
查看>>
大量界面刷新时手动Dispose也是有必要的
查看>>