五周第一次课(1月8日) 7.1 安装软件包的三种方法 7.2 rpm包介绍 7.3 rpm工具用法 7.4 yum工具用法 7.5 yum搭建本地仓库(视频中ppt小错误: gpcheck改为gpgcheck,yum cean 改为 yum clean)

五周第一次课(1月8日)
7.1 安装软件包的三种方法
7.2 rpm包介绍
7.3 rpm工具用法
7.4 yum工具用法
7.5 yum搭建本地仓库(视频中ppt小错误: gpcheck改为gpgcheck,yum cean 改为 yum clean)


=======================================================================================================================================================================================


扩展
1.http://www.360doc.com/content/11/0218/15/4171006_94080041.shtml
2. 搭建局域网yum源 http://ask.apelearn.com/question/7627

3.命令:


rpm命令:
是RPM软件包的管理工具。rpm原本是Red Hat Linux发行版专门用来管理Linux各项套件的程序,由于它遵循GPL规则且功能强大方便,因而广受欢迎。逐渐受到其他发行版的采用。RPM套件管理方式的出现,让Linux易于安装,升级,间接提升了Linux的适用度。

语法
rpm(选项)(参数)
选项
-a:查询所有套件;
-b<完成阶段><套件档>+或-t <完成阶段><套件档>+:设置包装套件的完成阶段,并指定套件档的文件名称;
-c:只列出组态配置文件,本参数需配合"-l"参数使用;
-d:只列出文本文件,本参数需配合"-l"参数使用;
-e<套件档>或--erase<套件档>:删除指定的套件;
-f<文件>+:查询拥有指定文件的套件;
-h或--hash:套件安装时列出标记;
-i:显示套件的相关信息;
-i<套件档>或--install<套件档>:安装指定的套件档;
-l:显示套件的文件列表;
-p<套件档>+:查询指定的RPM套件档;
-q:使用询问模式,当遇到任何问题时,rpm指令会先询问用户;
-R:显示套件的关联性信息;
-s:显示文件状态,本参数需配合"-l"参数使用;
-U<套件档>或--upgrade<套件档>:升级指定的套件档;
-v:显示指令执行过程;
-vv:详细显示指令执行过程,便于排错。
参数
软件包:指定要操纵的rpm软件包。

实例
如何安装rpm软件包

rpm软件包的安装可以使用程序rpm来完成。执行下面的命令:

rpm -ivh your-package.rpm
其中your-package.rpm是你要安装的rpm包的文件名,一般置于当前目录下。

安装过程中可能出现下面的警告或者提示:

... conflict with ...
可能是要安装的包里有一些文件可能会覆盖现有的文件,缺省时这样的情况下是无法正确安装的可以用rpm --force -i强制安装即可

... is needed by ...
... is not installed ...
此包需要的一些软件你没有安装可以用rpm --nodeps -i来忽略此信息,也就是说rpm -i --force --nodeps可以忽略所有依赖关系和文件问题,什么包都能安装上,但这种强制安装的软件包不能保证完全发挥功能。

如何安装.src.rpm软件包

有些软件包是以.src.rpm结尾的,这类软件包是包含了源代码的rpm包,在安装时需要进行编译。这类软件包有两种安装方法:

方法一:

rpm -i your-package.src.rpm
cd /usr/src/redhat/SPECS
rpmbuild -bp your-package.specs #一个和你的软件包同名的specs文件
cd /usr/src/redhat/BUILD/your-package/ #一个和你的软件包同名的目录
./configure #这一步和编译普通的源码软件一样,可以加上参数
make
make install
方法二:

rpm -i you-package.src.rpm
cd /usr/src/redhat/SPECS
前两步和方法一相同

rpmbuild -bb your-package.specs #一个和你的软件包同名的specs文件
这时在/usr/src/redhat/RPM/i386/(根据具体包的不同,也可能是i686,noarch等等)在这个目录下,有一个新的rpm包,这个是编译好的二进制文件。

执行rpm -i new-package.rpm即可安装完成。

如何卸载rpm软件包

使用命令rpm -e包名,包名可以包含版本号等信息,但是不可以有后缀.rpm,比如卸载软件包proftpd-1.2.8-1,可以使用下列格式:

rpm -e proftpd-1.2.8-1
rpm -e proftpd-1.2.8
rpm -e proftpd-
rpm -e proftpd
不可以是下列格式:

rpm -e proftpd-1.2.8-1.i386.rpm
rpm -e proftpd-1.2.8-1.i386
rpm -e proftpd-1.2
rpm -e proftpd-1
有时会出现一些错误或者警告:

... is needed by ...
这说明这个软件被其他软件需要,不能随便卸载,可以用rpm -e --nodeps强制卸载

如何不安装但是获取rpm包中的文件

使用工具rpm2cpio和cpio

rpm2cpio xxx.rpm | cpio -vi
rpm2cpio xxx.rpm | cpio -idmv
rpm2cpio xxx.rpm | cpio --extract --make-directories
参数i和extract相同,表示提取文件。v表示指示执行进程,d和make-directory相同,表示根据包中文件原来的路径建立目录,m表示保持文件的更新时间。

如何查看与rpm包相关的文件和其他信息

下面所有的例子都假设使用软件包mysql-3.23.54a-11

1、我的系统中安装了那些rpm软件包。

rpm -qa 讲列出所有安装过的包
如果要查找所有安装过的包含某个字符串sql的软件包

rpm -qa | grep sql
2、如何获得某个软件包的文件全名。

rpm -q mysql
可以获得系统中安装的mysql软件包全名,从中可以获得当前软件包的版本等信息。这个例子中可以得到信息mysql-3.23.54a-11

3、一个rpm包中的文件安装到那里去了?

rpm -ql 包名
注意这里的是不包括.rpm后缀的软件包的名称,也就是说只能用mysql或者mysql-3.23.54a-11而不是mysql-3.23.54a-11.rpm。如果只是想知道可执行程序放到那里去了,也可以用which,比如:

which mysql
4、一个rpm包中包含那些文件。

一个没有安装过的软件包,使用rpm -qlp ****.rpm
一个已经安装过的软件包,还可以使用rpm -ql ****.rpm
5、如何获取关于一个软件包的版本,用途等相关信息?

一个没有安装过的软件包,使用rpm -qip ****.rpm
一个已经安装过的软件包,还可以使用rpm -qi ****.rpm
6、某个程序是哪个软件包安装的,或者哪个软件包包含这个程序。

rpm -qf `which 程序名` #返回软件包的全名
rpm -qif `which 程序名` #返回软件包的有关信息
rpm -qlf `which 程序名` #返回软件包的文件列表
注意,这里不是引号,而是`,就是键盘左上角的那个键。也可以使用rpm -qilf,同时输出软件包信息和文件列表。

7、某个文件是哪个软件包安装的,或者哪个软件包包含这个文件。

注意,前一个问题中的方法,只适用与可执行的程序,而下面的方法,不仅可以用于可执行程序,也可以用于普通的任何文件。前提是知道这个文件名。首先获得这个程序的完整路径,可以用whereis或者which,然后使用rpm -qf例如:

whereis ftptop
ftptop: /usr/bin/ftptop /usr/share/man/man1/ftptop.1.gz

rpm -qf /usr/bin/ftptop
proftpd-1.2.8-1

rpm -qf /usr/share/doc/proftpd-1.2.8/rfc/rfc0959.txt
proftpd-1.2.8-1

=======================================================================================================================================================================================

yum命令:
是在Fedora和RedHat以及SUSE中基于rpm的软件包管理器,它可以使系统管理人员交互和自动化地更细与管理RPM软件包,能够从指定的服务器自动下载RPM包并且安装,可以自动处理依赖性关系,并且一次安装所有依赖的软体包,无须繁琐地一次次下载、安装。

yum提供了查找、安装、删除某一个、一组甚至全部软件包的命令,而且命令简洁而又好记。

语法
yum(选项)(参数)
选项
-h:显示帮助信息;
-y:对所有的提问都回答“yes”;
-c:指定配置文件;
-q:安静模式;
-v:详细模式;
-d:设置调试等级(0-10);
-e:设置错误等级(0-10);
-R:设置yum处理一个命令的最大等待时间;
-C:完全从缓存中运行,而不去下载或者更新任何头文件。
参数
install:安装rpm软件包;
update:更新rpm软件包;
check-update:检查是否有可用的更新rpm软件包;
remove:删除指定的rpm软件包;
list:显示软件包的信息;
search:检查软件包的信息;
info:显示指定的rpm软件包的描述信息和概要信息;
clean:清理yum过期的缓存;
shell:进入yum的shell提示符;
resolvedep:显示rpm软件包的依赖关系;
localinstall:安装本地的rpm软件包;
localupdate:显示本地rpm软件包进行更新;
deplist:显示rpm软件包的所有依赖关系。
实例
部分常用的命令包括:

自动搜索最快镜像插件:yum install yum-fastestmirror
安装yum图形窗口插件:yum install yumex
查看可能批量安装的列表:yum grouplist
安装

yum install #全部安装
yum install package1 #安装指定的安装包package1
yum groupinsall group1 #安装程序组group1
更新和升级

yum update #全部更新
yum update package1 #更新指定程序包package1
yum check-update #检查可更新的程序
yum upgrade package1 #升级指定程序包package1
yum groupupdate group1 #升级程序组group1
查找和显示

yum info package1 #显示安装包信息package1
yum list #显示所有已经安装和可以安装的程序包
yum list package1 #显示指定程序包安装情况package1
yum groupinfo group1 #显示程序组group1信息yum search string 根据关键字string查找安装包
删除程序

yum remove &#124; erase package1 #删除程序包package1
yum groupremove group1 #删除程序组group1
yum deplist package1 #查看程序package1依赖情况
清除缓存

yum clean packages #清除缓存目录下的软件包
yum clean headers #清除缓存目录下的 headers
yum clean oldheaders #清除缓存目录下旧的 headers


=======================================================================================================================================================================================

在Windows系统下安装软件很简单,只要双击后缀为.exe的文件,然后根据提示连续单击“下一步" 按钮即可。 然而在Linux系统下安装软件就没那么容易了,因为我们不是在图形界面下。所以,你必须学会如何在Linux下安装软件

前面我们多次提到了yum命令,它是Red Hat所特有的安装RPM程序包的工具。使用RPM工具安装某一个程序包时,有可能会因为该程序包依赖另一个程序包而无法安装;而使用yum工具时,就可以连同依赖的程序包一起安装,很方便。在centos里使用yum工具是免费的,但在Red Hat里,使用yum工具是需要付费的。

7.2 rpm包介绍

RPM是Red Hat Package Manager的缩写,由Red Hat公司开发。它是以一种数据库记录的方式将我们所需要的套件安装到Linux主机的一套管理程序。也就是说,你的Linux系统中存在着一个关于RPM 的数据库,它记录了安装的包以及包与包之间的依赖关系。RPM包是预先在Linux机器上编译并打包的文件,安装非常快捷。但它也有一些缺点,比如安装环境必须与编译时的环境一致或者相当,包与包之间存在着相互依赖的情况,卸载包时需要先把依赖的包卸载。如果依赖的包是系统所必需的,就不能卸载这个包,否则系统会崩溃。


如果你的虚拟机光驱中还有系统安装盘镜像,就可以通过执行如下命令把光驱挂载到/mnt目录下。先检查一下VMware右下角的小光驱图标是否点亮,如果没有,点击一下,再点击“连接"就可以点亮它。当挂载光驱后,会在/mnt/Packages目录下看到很多后缀为.rpm的文件,这些文件就是RPM包

rpm包格式:包名、版本号、发布版本号、平台

7.3 rpm工具用法

安装:rpm -ivh rpm包文件

各个选项的含义如下:

-i:表示安装。

-v:表示可视化。

-h:表示显示安装进度。

另外,在安装RPM包时,常用的附带参数还包括如下几项。

--force:表示强制安装,即使覆盖属于其他包的文件也要安装。

--nodeps:表示当要安装的RPM包依赖于其他包时,即使其他包没有安装,也要安装这个包

升级RPM包的命令:rpm -Uvh filename,其中-U选项表示升级。

卸载RPM包的命令:rpm -e filename,这里的filename是通过rpm的查询功能所查询到的

卸载时,-e选项后面的filename和安装时是有区别的。安装时,是把一个存在的文件作为参数,而卸载时只需要包名即可。

查询安装的包的命令:rpm -q 包名,这里的“包名"是不带平台信息和后缀名的。

选项含义如下:

-qa:查询当前系统所有已安装的

技术分享图片

-qi 包名:查询指定包信息。

技术分享图片

-ql 包名:列出包安装的文件

技术分享图片

-qf 文件绝对路径:查看一个文件是由哪个包安装的


【`】使用,如果一个命令比如“cd“不知道它的路径,就可以用which命令,直接找出哪个包安装的

不能用于有alias别名的命令,如”ls“,

【ls】which下来有alias的分成两行,系统不认

7.4 yum工具用法

yum工具比RPM更加方便。yum工具最大的优势在于可以联网去下载所需要的RPM包,然后自动安装。如果安装的RPM包有依赖关系,会帮助我们以此安装所有相关的RPM包。

列出可用rpm包命令:yum list

已安装的软件包列表中可以看到分成三列:RPM包名 版本信息 安装信息(仓库名字)

如果已安装最右侧就会显示@开头的,如果未安装则没有@;如果RPM包已安装但需要升级,则显示updates。

yum list命令会先列出已经安装的包,再列出可以安装的包

仓库名字怎么来的

查看yum的配置文件,在“/etc/yum.repos.d/“中

搜索包命令:yum search [相关关键词]

还可以用grep来过滤,从而找到相应的RPM包。

安装RPM包的命令:yum install [-y],如果不加-y选项,则会以与用户交互的方法安装。

在安装过程中,它首先会把需要安装的RPM包列出来,如果有依赖关系,也会把所有依赖的包列出来 然后洵问用户是否需要安装,输入y则安装,输入则不安装。但这样太麻烦,所以会直接加上-y选项,这样就省略了询问用户是否安装的那一步。

列出可用的组的命令:yum grouplist

安装组套件的命令:yum groupinstall [-y]

卸载包的命令:yum remove [-y] [RPM包名]

升级包的命令:yum update [-y] [RPM包名],如果不加包名,就会自动全部升级,包括升级系统,内核。

搜寻命令的安装包:yum provides “/*/命令”,前提是命令在系统中没有安装

7.5 yum搭建本地仓库

有时候,Linux系统不能联网,此时当然就不能很便捷地使用联网的yum源了,这时就需要我们自己在Linux系统下使用光盘制作yum源,具体操作步骤如下

1. 挂载镜像到/mnt目录

2. 删除/etc/yum.repos.d目录下所有的repo文件(删除之前,最好先做一个备份)

3. 创建新文件dvd.repo

vim /etc/yum.repos.d/dvd.repo / /加入以下内容:

[dvd]

name=install dvd

baseurl=file:///mnt

enabled=1

gpgcheck=0

4. 刷新repos生成缓存

# yum makecache

可以用清除缓存命令:yum clean all

然后就可以使用yum命令安装你所需要的软件包了。

5. yum list查看


=======================================================================================================================================================================================
dhclient-4.2.5-47.el7.centos.x86_64
crontabs-1.11-6.20121102git.el7.noarch
libdrm-2.4.67-3.el7.x86_64
pciutils-3.5.1-1.el7.x86_64
[root@localhost Packages]# rpm -q ppp
ppp-2.4.5-33.el7.x86_64
[root@localhost Packages]# rpm -q ppp1
未安装软件包 ppp1
[root@localhost Packages]# rpm -qi vim-enhanced
Name : vim-enhanced
Epoch : 2
Version : 7.4.160
Release : 2.el7
Architecture: x86_64
Install Date: 2018年01月03日 星期三 20时52分37秒
Group : Applications/Editors
Size : 2292098
License : Vim
Signature : RSA/SHA256, 2017年08月11日 星期五 04时15分38秒, Key ID 24c6a8a7f4a80eb5
Source RPM : vim-7.4.160-2.el7.src.rpm
Build Date : 2017年08月02日 星期三 08时46分12秒
Build Host : c1bm.rdu2.centos.org
Relocations : (not relocatable)
Packager : CentOS BuildSystem <http://bugs.centos.org>
Vendor : CentOS
URL : http://www.vim.org/
Summary : A version of the VIM editor which includes recent enhancements
Description :
VIM (VIsual editor iMproved) is an updated and improved version of the
vi editor. Vi was the first real screen-based editor for UNIX, and is
still very popular. VIM improves on vi by adding new features:
multiple windows, multi-level undo, block highlighting and more. The
vim-enhanced package contains a version of VIM with extra, recently
introduced features like Python and Perl interpreters.

Install the vim-enhanced package if you'd like to use a version of the
VIM editor which includes recently added enhancements like
interpreters for the Python and Perl scripting languages. You'll also
need to install the vim-common package.
[root@localhost Packages]# rpm -ql vim-enhanced
/etc/profile.d/vim.csh
/etc/profile.d/vim.sh
/usr/bin/rvim
/usr/bin/vim
/usr/bin/vimdiff
/usr/bin/vimtutor
[root@localhost Packages]# rpm -qf /usr/bin/vim
vim-enhanced-7.4.160-2.el7.x86_64
[root@localhost Packages]# rpm -qf `which cd`
bash-4.2.46-20.el7_2.x86_64
[root@localhost Packages]# yum install texlive
事务概要
=============================================================================================
安装 10 软件包 (+37 依赖软件包)
升级 221 软件包

总下载量:222 M
Is this ok [y/d/N]: n
Is this ok [y/d/N]: Is this ok [y/d/N]: Is this ok [y/d/N]: Is this ok [y/d/N]: Is this ok [y/d/N]: Exiting on user command
您的事务已保存,请执行:
yum load-transaction /tmp/yum_save_tx.2018-01-08.21-57.oPlDu7.yumtx 重新执行该事务
[root@localhost Packages]# ls /etc/yum.
yum.conf yum.repos.d/
[root@localhost Packages]# ls /etc/yum.
yum.conf yum.repos.d/
[root@localhost Packages]# ls /etc/yum.repos.d/
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo
[root@localhost Packages]# cat /etc/yum.repos.d/CentOS-Base.repo
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

[root@localhost Packages]# yum search vim
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
===================================== N/S matched: vim ======================================
protobuf-vim.x86_64 : Vim syntax highlighting for Google Protocol Buffers descriptions
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-filesystem.x86_64 : VIM filesystem layout
vim-minimal.x86_64 : A minimal version of the VIM editor

名称和简介匹配 only,使用“search all”试试。
[root@localhost Packages]# yum search network
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
=================================== N/S matched: network ====================================
NetworkManager.x86_64 : Network connection manager and user applications
NetworkManager-adsl.x86_64 : ADSL device plugin for NetworkManager
NetworkManager-bluetooth.x86_64 : Bluetooth device plugin for NetworkManager
NetworkManager-config-server.noarch : NetworkManager config file for "server-like" defaults
NetworkManager-dispatcher-routing-rules.noarch : NetworkManager dispatcher file for advanced
: routing rules
NetworkManager-glib.i686 : Libraries for adding NetworkManager support to applications (old
: API).
NetworkManager-glib.x86_64 : Libraries for adding NetworkManager support to applications (old
: API).
NetworkManager-glib-devel.i686 : Header files for adding NetworkManager support to
: applications (old API).
NetworkManager-glib-devel.x86_64 : Header files for adding NetworkManager support to
: applications (old API).
NetworkManager-libnm.x86_64 : Libraries for adding NetworkManager support to applications
: (new API).
NetworkManager-libnm.i686 : Libraries for adding NetworkManager support to applications (new
: API).
NetworkManager-libnm-devel.i686 : Header files for adding NetworkManager support to
: applications (new API).
NetworkManager-libnm-devel.x86_64 : Header files for adding NetworkManager support to
: applications (new API).
NetworkManager-libreswan.x86_64 : NetworkManager VPN plug-in for IPsec VPN
NetworkManager-libreswan-gnome.x86_64 : NetworkManager VPN plugin for libreswan - GNOME files
NetworkManager-ppp.x86_64 : PPP plugin for NetworkManager
NetworkManager-team.x86_64 : Team device plugin for NetworkManager
NetworkManager-tui.x86_64 : NetworkManager curses-based UI
NetworkManager-wifi.x86_64 : Wifi plugin for NetworkManager
NetworkManager-wwan.x86_64 : Mobile broadband device plugin for NetworkManager
cockpit-networkmanager.noarch : Cockpit user interface for networking, using NetworkManager
dracut-network.x86_64 : dracut modules to build a dracut initramfs with network support
glib-networking.x86_64 : Networking support for GLib
glib-networking.i686 : Networking support for GLib
glib-networking-tests.x86_64 : Tests for the glib-networking package
kde-plasma-networkmanagement.x86_64 : NetworkManager KDE 4 integration
kde-plasma-networkmanagement-libreswan.x86_64 : Libreswan support for
: kde-plasma-networkmanagement
kde-plasma-networkmanagement-libs.i686 : Runtime libraries for kde-plasma-networkmanagement
kde-plasma-networkmanagement-libs.x86_64 : Runtime libraries for kde-plasma-networkmanagement
kde-plasma-networkmanagement-mobile.x86_64 : Mobile support for kde-plasma-networkmanagement
kdenetwork.x86_64 : KDE Network Applications
kdenetwork-common.noarch : Common files for kdenetwork
kdenetwork-devel.noarch : Development files for kdenetwork
kdenetwork-kget-libs.i686 : Runtime libraries for kdenetwork
kdenetwork-kget-libs.x86_64 : Runtime libraries for kdenetwork
kdenetwork-kopete-libs.i686 : Runtime libraries for kdenetwork
kdenetwork-kopete-libs.x86_64 : Runtime libraries for kdenetwork
kdenetwork-krdc-devel.i686 : Developer files for kdenetwork
kdenetwork-krdc-devel.x86_64 : Developer files for kdenetwork
kdenetwork-krdc-libs.i686 : Runtime libraries for kdenetwork
kdenetwork-krdc-libs.x86_64 : Runtime libraries for kdenetwork
kdenetwork-krfb-libs.i686 : Runtime libraries for kdenetwork
kdenetwork-krfb-libs.x86_64 : Runtime libraries for kdenetwork
libproxy-networkmanager.x86_64 : Plugin for libproxy and networkmanager
libvirt-daemon-driver-network.x86_64 : Network driver plugin for the libvirtd daemon
network-manager-applet.x86_64 : A network control and status applet for NetworkManager
openlmi-networking.x86_64 : CIM providers for network management
openlmi-networking-doc.noarch : Documentation for openlmi-networking
sblim-cmpi-network.i686 : SBLIM Network Instrumentation
sblim-cmpi-network.x86_64 : SBLIM Network Instrumentation
sblim-cmpi-network-devel.i686 : SBLIM Network Instrumentation Header Development Files
sblim-cmpi-network-devel.x86_64 : SBLIM Network Instrumentation Header Development Files
sblim-cmpi-network-test.x86_64 : SBLIM Network Instrumentation Testcases
systemd-networkd.x86_64 : System service that manages networks.
yum-NetworkManager-dispatcher.noarch : NetworkManager script which tells yum to check its
: cache on network change
amanda.x86_64 : A network-capable tape backup solution
arpwatch.x86_64 : Network monitoring tools for tracking IP addresses on a network
authconfig.x86_64 : Command line tool for setting up authentication from network services
authconfig-gtk.x86_64 : Graphical tool for setting up authentication from network services
avahi.i686 : Local network service discovery
avahi.x86_64 : Local network service discovery
cgdcbxd.x86_64 : DCB network priority management daemon
corosync-qnetd.x86_64 : The Corosync Cluster Engine Qdevice Network Daemon
crda.x86_64 : Regulatory compliance daemon for 802.11 wireless networking
dnssec-trigger.x86_64 : NetworkManager plugin to update/reconfigure DNSSEC resolving
fence-agents-eaton-snmp.x86_64 : Fence agent for Eaton network power switches
fence-agents-ipdu.x86_64 : Fence agent for IBM iPDU network power switches
fence-agents-wti.x86_64 : Fence agent for WTI Network power switches
flannel.x86_64 : Etcd address management agent for overlay networks
golang-googlecode-net-devel.noarch : Supplementary Go networking libraries
iproute.x86_64 : Advanced IP routing and network device configuration tools
iptraf-ng.x86_64 : A console-based network monitoring utility
iputils.x86_64 : Network monitoring tools including ping
ipxe-bootimgs.noarch : Network boot loader images in bootable USB, CD, floppy and GRUB
: formats
ipxe-roms.noarch : Network boot loader roms in .rom format
ipxe-roms-qemu.noarch : Network boot loader roms supported by QEMU, .rom format
iwl1000-firmware.noarch : Firmware for Intel? PRO/Wireless 1000 B/G/N network adaptors
iwl3945-firmware.noarch : Firmware for Intel? PRO/Wireless 3945 A/B/G network adaptors
iwl4965-firmware.noarch : Firmware for Intel? PRO/Wireless 4965 A/G/N network adaptors
iwl5000-firmware.noarch : Firmware for Intel? PRO/Wireless 5000 A/G/N network adaptors
iwl5150-firmware.noarch : Firmware for Intel? PRO/Wireless 5150 A/G/N network adaptors
kdenetwork-fileshare-samba.x86_64 : Share files via samba
kdenetwork-kdnssd.x86_64 : Kdnssd
kdenetwork-kget.x86_64 : A downloader manager
kdenetwork-kopete.x86_64 : A chat client
kdenetwork-kopete-devel.i686 : Development files for Kopete
kdenetwork-kopete-devel.x86_64 : Development files for Kopete
kdenetwork-krdc.x86_64 : A client for Desktop Sharing and other VNC servers
kdenetwork-krfb.x86_64 : Desktop Sharing server, allow others to access your desktop via VNC
libdnet.i686 : Simple portable interface to lowlevel networking routines
libdnet.x86_64 : Simple portable interface to lowlevel networking routines
libmng.i686 : Library for Multiple-image Network Graphics support
libmng.x86_64 : Library for Multiple-image Network Graphics support
libmng-devel.i686 : Development files for the Multiple-image Network Graphics library
libmng-devel.x86_64 : Development files for the Multiple-image Network Graphics library
libnm-gtk.i686 : Private libraries for NetworkManager GUI support
libnm-gtk.x86_64 : Private libraries for NetworkManager GUI support
libnm-gtk-devel.i686 : Private header files for NetworkManager GUI support
libnm-gtk-devel.x86_64 : Private header files for NetworkManager GUI support
libnma.i686 : Private libraries for NetworkManager GUI support
libnma.x86_64 : Private libraries for NetworkManager GUI support
libnma-devel.i686 : Private header files for NetworkManager GUI support
libnma-devel.x86_64 : Private header files for NetworkManager GUI support
libreport-web.i686 : Library providing network API for libreport
libreport-web.x86_64 : Library providing network API for libreport
libteam.x86_64 : Library for controlling team network device
libteam.i686 : Library for controlling team network device
libtnc.i686 : Library implementation of the Trusted Network Connect (TNC) specification
libtnc.x86_64 : Library implementation of the Trusted Network Connect (TNC) specification
libvirt-daemon-config-network.x86_64 : Default configuration files for the libvirtd daemon
libvirt-daemon-config-nwfilter.x86_64 : Network filter configuration files for the libvirtd
: daemon
libwvstreams.i686 : WvStreams is a network programming library written in C++
libwvstreams.x86_64 : WvStreams is a network programming library written in C++
mtr.x86_64 : A network diagnostic tool
net-snmp-utils.x86_64 : Network management utilities using SNMP, from the NET-SNMP project
net-tools.x86_64 : Basic networking tools
netcf.x86_64 : Cross-platform network configuration library
nm-connection-editor.x86_64 : A network connection configuration editor for NetworkManager
nmap.x86_64 : Network exploration tool and security scanner
nss.x86_64 : Network Security Services
nss.i686 : Network Security Services
nss-devel.i686 : Development libraries for Network Security Services
nss-devel.x86_64 : Development libraries for Network Security Services
nss-pem.i686 : PEM file reader for Network Security Services (NSS)
nss-pem.x86_64 : PEM file reader for Network Security Services (NSS)
nss-softokn.x86_64 : Network Security Services Softoken Module
nss-softokn.i686 : Network Security Services Softoken Module
nss-softokn-devel.i686 : Development libraries for Network Security Services
nss-softokn-devel.x86_64 : Development libraries for Network Security Services
nss-softokn-freebl.x86_64 : Freebl library for the Network Security Services
nss-softokn-freebl.i686 : Freebl library for the Network Security Services
nss-tools.x86_64 : Tools for the Network Security Services
nss-util.x86_64 : Network Security Services Utilities Library
nss-util.i686 : Network Security Services Utilities Library
nss-util-devel.i686 : Development libraries for Network Security Services Utilities
nss-util-devel.x86_64 : Development libraries for Network Security Services Utilities
pcp-pmda-bonding.x86_64 : Performance Co-Pilot (PCP) metrics for Bonded network interfaces
pcp-pmda-snmp.x86_64 : Performance Co-Pilot (PCP) metrics for Simple Network Management
: Protocol
perl-CPANPLUS.noarch : Ameliorated interface to the Comprehensive Perl Archive Network
perl-Socket.x86_64 : Networking constants and support functions
pngcrush.x86_64 : Optimizer for PNG (Portable Network Graphics) files
python-IPy.noarch : Python module for handling IPv4 and IPv6 Addresses and Networks
python-gevent.x86_64 : A coroutine-based Python networking library
python-libteam.x86_64 : Team network device library bindings
python-netaddr.noarch : A pure Python network address representation and manipulation library
python-netifaces.x86_64 : Python library to retrieve information about network interfaces
python-nss.x86_64 : Python bindings for Network Security Services (NSS)
python-twisted-core.x86_64 : Asynchronous networking framework written in Python
rsync.x86_64 : A program for synchronizing files over a network
rusers.x86_64 : Displays the users logged into machines on the local network
rwho.x86_64 : Displays who is logged in to local network machines
sntp.x86_64 : Standard Simple Network Time Protocol program
strongimcv.i686 : Trusted Network Connect (TNC) Architecture
strongimcv.x86_64 : Trusted Network Connect (TNC) Architecture
syslinux-tftpboot.x86_64 : SYSLINUX modules in /var/lib/tftpboot, available for network
: booting
systemd-journal-gateway.x86_64 : Gateway for serving journal events over the network using
: HTTP
systemd-resolved.i686 : Network Name Resolution manager.
systemd-resolved.x86_64 : Network Name Resolution manager.
tang.x86_64 : Network Presence Binding Daemon
tcpdump.x86_64 : A network traffic monitoring tool
teamd.x86_64 : Team network device control daemon
teamd.i686 : Team network device control daemon
tncfhh.i686 : An open source implementation of the Trusted Network Connect (TNC) framework
tncfhh.x86_64 : An open source implementation of the Trusted Network Connect (TNC) framework
traceroute.x86_64 : Traces the route taken by packets over an IPv4/IPv6 network
usbredir.i686 : USB network redirection protocol libraries
usbredir.x86_64 : USB network redirection protocol libraries
wireshark.i686 : Network traffic analyzer
wireshark.x86_64 : Network traffic analyzer
ypserv.x86_64 : The NIS (Network Information Service) server

名称和简介匹配 only,使用“search all”试试。
[root@localhost Packages]#

 

 

Transaction Summary
=============================================================================================
Install 66 Packages (+186 Dependent packages)
Upgrade 1 Package (+ 34 Dependent packages)

Total download size: 100 M
Is this ok [y/d/N]: n
Exiting on user command
Your transaction was saved, rerun it with:
yum load-transaction /tmp/yum_save_tx.2018-01-08.22-31.IjuKnR.yumtx
[root@localhost Packages]# yum remove ppp
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
Resolving Dependencies
--> Running transaction check
---> Package ppp.x86_64 0:2.4.5-33.el7 will be erased
--> Processing Dependency: ppp = 2.4.5 for package: 1:NetworkManager-1.4.0-12.el7.x86_64
--> Running transaction check
---> Package NetworkManager.x86_64 1:1.4.0-12.el7 will be erased
--> Processing Dependency: NetworkManager = 1:1.4.0-12.el7 for package: 1:NetworkManager-tui-1.4.0-12.el7.x86_64
--> Processing Dependency: NetworkManager(x86-64) = 1:1.4.0-12.el7 for package: 1:NetworkManager-team-1.4.0-12.el7.x86_64
--> Processing Dependency: NetworkManager(x86-64) = 1:1.4.0-12.el7 for package: 1:NetworkManager-wifi-1.4.0-12.el7.x86_64
--> Running transaction check
---> Package NetworkManager-team.x86_64 1:1.4.0-12.el7 will be erased
---> Package NetworkManager-tui.x86_64 1:1.4.0-12.el7 will be erased
---> Package NetworkManager-wifi.x86_64 1:1.4.0-12.el7 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================
Package Arch Version Repository Size
=============================================================================================
Removing:
ppp x86_64 2.4.5-33.el7 @anaconda 852 k
Removing for dependencies:
NetworkManager x86_64 1:1.4.0-12.el7 @anaconda 10 M
NetworkManager-team x86_64 1:1.4.0-12.el7 @anaconda 53 k
NetworkManager-tui x86_64 1:1.4.0-12.el7 @anaconda 266 k
NetworkManager-wifi x86_64 1:1.4.0-12.el7 @anaconda 144 k

Transaction Summary
=============================================================================================
Remove 1 Package (+4 Dependent packages)

Installed size: 11 M
Is this ok [y/N]: n
Exiting on user command
Your transaction was saved, rerun it with:
yum load-transaction /tmp/yum_save_tx.2018-01-08.22-43.O9wNHO.yumtx
[root@localhost Packages]# yum provides "/*/vim/"
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
base/7/x86_64/filelists_db | 6.7 MB 00:00:01
extras/7/x86_64/filelists_db | 528 kB 00:00:00
updates/7/x86_64/filelists_db | 3.0 MB 00:00:00
2:vim-common-7.4.160-2.el7.x86_64 : The common files needed by any version of the VIM editor
Repo : @base
Matched from:
Filename : /usr/share/vim/

 

2:vim-filesystem-7.4.160-2.el7.x86_64 : VIM filesystem layout
Repo : @base
Matched from:
Filename : /usr/share/vim/

2:vim-filesystem-7.4.160-2.el7.x86_64 : VIM filesystem layout
Repo : @base
Matched from:
Filename : /usr/share/vim/

 

[root@localhost Packages]# cd
[root@localhost ~]# cp -r /etc/yum.repos.d/ /etc/yum.repos.d.bak
[root@localhost ~]# cd /etc/yum.
yum.conf yum.repos.d/ yum.repos.d.bak/
[root@localhost ~]# cd /etc/yum.repos.d
[root@localhost yum.repos.d]# ls
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Sources.repo CentOS-fasttrack.repo
CentOS-CR.repo CentOS-Media.repo CentOS-Vault.repo
[root@localhost yum.repos.d]# em -rf ./*
-bash: em: 未找到命令
[root@localhost yum.repos.d]# rm -rf ./*
[root@localhost yum.repos.d]# vi dvd.repo
[root@localhost yum.repos.d]# yum clean all
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
Cleaning repos: dvd
Cleaning up everything
Cleaning up list of fastest mirrors
[root@localhost yum.repos.d]# yum list
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
file:///mut/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /mut/repodata/repomd.xml"
Trying other mirror.


One of the configured repositories failed (install dvd),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:

1. Contact the upstream for the repository and get them to fix the problem.

2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).

3. Run the command with the repository temporarily disabled
yum --disablerepo=dvd ...

4. Disable the repository permanently, so yum won't use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use --enablerepo for temporary usage:

yum-config-manager --disable dvd
or
subscription-manager repos --disable=dvd

5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:

yum-config-manager --save --setopt=dvd.skip_if_unavailable=true

failure: repodata/repomd.xml from dvd: [Errno 256] No more mirrors to try.
file:///mut/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /mut/repodata/repomd.xml"
[root@localhost yum.repos.d]# vi dvd.repo
[root@localhost yum.repos.d]# yum list
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
file:///mut/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /mut/repodata/repomd.xml"
Trying other mirror.


One of the configured repositories failed (install dvd),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:

1. Contact the upstream for the repository and get them to fix the problem.

2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).

3. Run the command with the repository temporarily disabled
yum --disablerepo=dvd ...

4. Disable the repository permanently, so yum won't use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use --enablerepo for temporary usage:

yum-config-manager --disable dvd
or
subscription-manager repos --disable=dvd

5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:

yum-config-manager --save --setopt=dvd.skip_if_unavailable=true

failure: repodata/repomd.xml from dvd: [Errno 256] No more mirrors to try.
file:///mut/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /mut/repodata/repomd.xml"
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]# ls
dvd.repo
[root@localhost yum.repos.d]# ls /media/mnt
ls: cannot access /media/mnt: No such file or directory
[root@localhost yum.repos.d]# ls /media/mnt/
ls: cannot access /media/mnt/: No such file or directory
[root@localhost yum.repos.d]# cd
[root@localhost ~]# ls /media/mnt/
ls: cannot access /media/mnt/: No such file or directory
[root@localhost ~]# ls /mnt/
CentOS_BuildTag EULA LiveOS RPM-GPG-KEY-CentOS-7 TRANS.TBL isolinux
EFI GPL Packages RPM-GPG-KEY-CentOS-Testing-7 images repodata
[root@localhost ~]# cp -r /etc/yum.repos.d /etc/yum.repos.d.bak
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ls
dvd.repo
[root@localhost yum.repos.d]# cat dvd.repo
[dvd]
name=install dvd
baseurl=file:///mut
neable=1
gpcheck=0

[root@localhost yum.repos.d]# vim /etc/yum.repos.d/dvd.repo
[root@localhost yum.repos.d]# yum list
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror


File contains parsing errors: file:///etc/yum.repos.d/dvd.repo
[line 6]: �yum cean all

[line 7]: �yum list

[root@localhost yum.repos.d]# vim /etc/yum.repos.d/dvd.repo
[root@localhost yum.repos.d]# yum list
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
file:///%2A/%2A/mut/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /%2A/%2A/mut/repodata/repomd.xml"
Trying other mirror.


One of the configured repositories failed (install dvd),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:

1. Contact the upstream for the repository and get them to fix the problem.

2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).

3. Run the command with the repository temporarily disabled
yum --disablerepo=dvd ...

4. Disable the repository permanently, so yum won't use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use --enablerepo for temporary usage:

yum-config-manager --disable dvd
or
subscription-manager repos --disable=dvd

5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:

yum-config-manager --save --setopt=dvd.skip_if_unavailable=true

failure: repodata/repomd.xml from dvd: [Errno 256] No more mirrors to try.
file:/*/*/mut/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /%2A/%2A/mut/repodata/repomd.xml"
[root@localhost yum.repos.d]# LANG=on
[root@localhost yum.repos.d]# vim /etc/yum.repos.d/dvd.repo
[root@localhost yum.repos.d]# yum list
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
file:///%2A/%2A/mut/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /%2A/%2A/mut/repodata/repomd.xml"
Trying other mirror.


One of the configured repositories failed (install dvd),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:

1. Contact the upstream for the repository and get them to fix the problem.

2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).

3. Run the command with the repository temporarily disabled
yum --disablerepo=dvd ...

4. Disable the repository permanently, so yum won't use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use --enablerepo for temporary usage:

yum-config-manager --disable dvd
or
subscription-manager repos --disable=dvd

5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:

yum-config-manager --save --setopt=dvd.skip_if_unavailable=true

failure: repodata/repomd.xml from dvd: [Errno 256] No more mirrors to try.
file:/*/*/mut/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /%2A/%2A/mut/repodata/repomd.xml"
[root@localhost yum.repos.d]# yum clean all
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
Cleaning repos: dvd
Cleaning up everything
[root@localhost yum.repos.d]# yum list
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
file:///%2A/%2A/mut/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /%2A/%2A/mut/repodata/repomd.xml"
Trying other mirror.


One of the configured repositories failed (install dvd),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:

1. Contact the upstream for the repository and get them to fix the problem.

2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).

3. Run the command with the repository temporarily disabled
yum --disablerepo=dvd ...

4. Disable the repository permanently, so yum won't use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use --enablerepo for temporary usage:

yum-config-manager --disable dvd
or
subscription-manager repos --disable=dvd

5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:

yum-config-manager --save --setopt=dvd.skip_if_unavailable=true

failure: repodata/repomd.xml from dvd: [Errno 256] No more mirrors to try.
file:/*/*/mut/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /%2A/%2A/mut/repodata/repomd.xml"
[root@localhost yum.repos.d]#

 

posted @ 2018-01-09 00:02  两颗白菜  阅读(1055)  评论(0编辑  收藏  举报