Linux 7 中Yum 配置 说明

简介:

在之前的Blog中写了Linux Yum 的配置方法,参考:

Linux 平台下 YUM 源配置 手册

http://www.cndba.cn/account/article/details/154

 

 

刚安装的Linux 7中测试发现有点注意事项。 在安装完系统之后,默认只有一个yum的配置文件。

 

1
2
3
4
5
6
7
[root@cndba.cn mnt]# lsb_release -a
LSB Version:     :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: RedHatEnterpriseServer
Description:     Red Hat Enterprise Linux Server release 7.2 (Maipo)
Release:  7.2
Codename:      Maipo
[root@cndba.cn mnt]#

如果没有lsb_release 命令,使用yum 安装即可,命令:yum install redhat-lsb*

 

 

在Yum的默认只有redhat.repo文件:

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
[root@cndba.cn yum.repos.d]# pwd
/etc/yum.repos.d
[root@cndba.cn yum.repos.d]# ll
total 8
-rw-r--r--. 1 root root 358 Mar  1 17:02 redhat.repo
[root@cndba.cn yum.repos.d]# cat redhat.repo
#
# Certificate-Based Repositories
# Managed by (rhsm) subscription-manager
#
# *** This file is auto-generated.  Changes made here will be over-written. ***
# *** Use "subscription-manager repo-override --help" if you wish to make changes. ***
#
# If this file is empty and this system is subscribed consider
# a "yum repolist" to refresh available repos
  
[root@cndba.cn yum.repos.d]#

 

 

根据里面的说明,这个redhat.repo 文件是自动生成的,不能在这里面写YUM的配置信息,否则会被覆盖掉。

 

所以我们这里直接touch 一个文件:dave.repo, 然后添加如下内容:

1
2
3
4
5
6
7
8
9
10
11
12
13
[root@cndba.cn yum.repos.d]# cat dave.repo
[dave]
name=dave
baseurl=file: ///mnt
enabled=1
gpgcheck=0
  
[root@cndba.cn yum.repos.d]# yum clean all
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This  system  is not registered to Red Hat Subscription Management. You can use subscription-manager to  register .
Cleaning repos: dave
Cleaning up everything
[root@cndba.cn yum.repos.d]#

 

然后就可以正常使用YUM了。

 

 

这里以安装Teamviewer为例:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
[root@cndba.cn ~]# rpm -ivh teamviewer_11.0.53191.i686.rpm
warning: teamviewer_11.0.53191.i686.rpm: Header V4 DSA/SHA1 Signature, key ID 72db573c: NOKEY
error: Failed dependencies:
          libSM.so.6 is needed by teamviewer-11.0.53191-0.i686
          libXdamage.so.1 is needed by teamviewer-11.0.53191-0.i686
          libXext.so.6 is needed by teamviewer-11.0.53191-0.i686
          libXfixes.so.3 is needed by teamviewer-11.0.53191-0.i686
          libXinerama.so.1 is needed by teamviewer-11.0.53191-0.i686
          libXrandr.so.2 is needed by teamviewer-11.0.53191-0.i686
          libXrender.so.1 is needed by teamviewer-11.0.53191-0.i686
          libXtst.so.6 is needed by teamviewer-11.0.53191-0.i686
          libasound.so.2 is needed by teamviewer-11.0.53191-0.i686
          libc.so.6(GLIBC_2.4) is needed by teamviewer-11.0.53191-0.i686
          libdbus-1.so.3 is needed by teamviewer-11.0.53191-0.i686
          libfontconfig.so.1 is needed by teamviewer-11.0.53191-0.i686
          libfreetype.so.6 is needed by teamviewer-11.0.53191-0.i686
          libgcc_s.so.1 is needed by teamviewer-11.0.53191-0.i686
          libjpeg.so.62 is needed by teamviewer-11.0.53191-0.i686
          libpng12.so.0 is needed by teamviewer-11.0.53191-0.i686
          libz.so.1 is needed by teamviewer-11.0.53191-0.i686
[root@cndba.cn ~]#
  
这里少了很多的包,我们打上:
[root@cndba.cn ~]# yum install libSM.so.6 libXdamage.so.1 libXext.so.6 libXfixes.so.3 libXinerama.so.1 libXrandr.so.2 libXrender.so.1 libXtst.so.6 libasound.so.2 libc.so.6 libdbus-1.so.3 libfontconfig.so.1 libfreetype.so.6 libgcc_s.so.1 libjpeg.so.62 libpng12.so.0 libz.so.1  -y
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This  system  is not registered to Red Hat Subscription Management. You can use subscription-manager to  register .
dave                                                                                                                                  | 4.1 kB  00:00:00    
(1/2): dave/group_gz                                                                                                                  | 136 kB  00:00:00    
(2/2): dave/primary_db                                                                                                                | 3.6 MB  00:00:00    
Resolving Dependencies
--> Running transaction check
---> Package alsa-lib.i686 0:1.0.28-2.el7 will be installed
---> Package dbus-libs.i686 1:1.6.12-13.el7 will be installed
---> Package fontconfig.i686 0:2.10.95-7.el7 will be installed
--> Processing Dependency: libexpat.so.1  for  package: fontconfig-2.10.95-7.el7.i686
---> Package freetype.i686 0:2.4.11-11.el7 will be installed
---> Package glibc.i686 0:2.17-105.el7 will be installed
--> Processing Dependency: libfreebl3.so  for  package: glibc-2.17-105.el7.i686
--> Processing Dependency: libfreebl3.so(NSSRAWHASH_3.12.3)  for  package: glibc-2.17-105.el7.i686
---> Package libSM.i686 0:1.2.2-2.el7 will be installed
--> Processing Dependency: libICE.so.6  for  package: libSM-1.2.2-2.el7.i686
--> Processing Dependency: libuuid.so.1  for  package: libSM-1.2.2-2.el7.i686
--> Processing Dependency: libuuid.so.1(UUID_1.0)  for  package: libSM-1.2.2-2.el7.i686
---> Package libXdamage.i686 0:1.1.4-4.1.el7 will be installed
--> Processing Dependency: libX11.so.6  for  package: libXdamage-1.1.4-4.1.el7.i686
---> Package libXext.i686 0:1.3.3-3.el7 will be installed
---> Package libXfixes.i686 0:5.0.1-2.1.el7 will be installed
---> Package libXinerama.i686 0:1.1.3-2.1.el7 will be installed
---> Package libXrandr.i686 0:1.4.2-2.el7 will be installed
---> Package libXrender.i686 0:0.9.8-2.1.el7 will be installed
---> Package libXtst.i686 0:1.2.2-2.1.el7 will be installed
--> Processing Dependency: libXi.so.6  for  package: libXtst-1.2.2-2.1.el7.i686
---> Package libgcc.i686 0:4.8.5-4.el7 will be installed
---> Package libjpeg-turbo.i686 0:1.2.90-5.el7 will be installed
---> Package libpng12.i686 0:1.2.50-6.el7 will be installed
---> Package zlib.i686 0:1.2.7-15.el7 will be installed
--> Running transaction check
---> Package expat.i686 0:2.1.0-8.el7 will be installed
---> Package libICE.i686 0:1.0.9-2.el7 will be installed
---> Package libX11.i686 0:1.6.3-2.el7 will be installed
--> Processing Dependency: libxcb.so.1  for  package: libX11-1.6.3-2.el7.i686
---> Package libXi.i686 0:1.7.4-2.el7 will be installed
---> Package libuuid.i686 0:2.23.2-26.el7 will be installed
---> Package nss-softokn-freebl.i686 0:3.16.2.3-13.el7_1 will be installed
--> Running transaction check
---> Package libxcb.i686 0:1.11-4.el7 will be installed
--> Processing Dependency: libXau.so.6  for  package: libxcb-1.11-4.el7.i686
--> Running transaction check
---> Package libXau.i686 0:1.0.8-2.1.el7 will be installed
--> Finished Dependency Resolution
  
Dependencies Resolved
  
=============================================================================================================================================================
  Package                                     Arch                          Version                                       Repository                     Size
=============================================================================================================================================================
Installing:
  alsa-lib                                    i686                          1.0.28-2.el7                                  dave                          391 k
  dbus-libs                                   i686                          1:1.6.12-13.el7                               dave                          151 k
  fontconfig                                  i686                          2.10.95-7.el7                                 dave                          229 k
  freetype                                    i686                          2.4.11-11.el7                                 dave                          388 k
  glibc                                       i686                          2.17-105.el7                                  dave                          4.2 M
  libSM                                       i686                          1.2.2-2.el7                                   dave                           39 k
  libXdamage                                  i686                          1.1.4-4.1.el7                                 dave                           20 k
  libXext                                     i686                          1.3.3-3.el7                                   dave                           39 k
  libXfixes                                   i686                          5.0.1-2.1.el7                                 dave                           18 k
  libXinerama                                 i686                          1.1.3-2.1.el7                                 dave                           14 k
  libXrandr                                   i686                          1.4.2-2.el7                                   dave                           25 k
  libXrender                                  i686                          0.9.8-2.1.el7                                 dave                           25 k
  libXtst                                     i686                          1.2.2-2.1.el7                                 dave                           20 k
  libgcc                                      i686                          4.8.5-4.el7                                   dave                          103 k
  libjpeg-turbo                               i686                          1.2.90-5.el7                                  dave                          137 k
  libpng12                                    i686                          1.2.50-6.el7                                  dave                          181 k
  zlib                                        i686                          1.2.7-15.el7                                  dave                           90 k
Installing  for  dependencies:
  expat                                       i686                          2.1.0-8.el7                                   dave                           80 k
  libICE                                      i686                          1.0.9-2.el7                                   dave                           64 k
  libX11                                      i686                          1.6.3-2.el7                                   dave                          610 k
  libXau                                      i686                          1.0.8-2.1.el7                                 dave                           29 k
  libXi                                       i686                          1.7.4-2.el7                                   dave                           40 k
  libuuid                                     i686                          2.23.2-26.el7                                 dave                           75 k
  libxcb                                      i686                          1.11-4.el7                                    dave                          202 k
  nss-softokn-freebl                          i686                          3.16.2.3-13.el7_1                             dave                          187 k
  
Transaction Summary
=============================================================================================================================================================
Install  17 Packages (+8 Dependent packages)
  
Total download size: 7.3 M
Installed size: 22 M
Downloading packages:
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                         39 MB/s | 7.3 MB  00:00:00    
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
   Installing : libgcc-4.8.5-4.el7.i686                                                                                                                  1/25
   Installing : nss-softokn-freebl-3.16.2.3-13.el7_1.i686                                                                                                2/25
   Installing : glibc-2.17-105.el7.i686                                                                                                                  3/25
   Installing : libICE-1.0.9-2.el7.i686                                                                                                                  4/25
   Installing : libuuid-2.23.2-26.el7.i686                                                                                                               5/25
   Installing : libXau-1.0.8-2.1.el7.i686                                                                                                                6/25
   Installing : libxcb-1.11-4.el7.i686                                                                                                                   7/25
   Installing : libX11-1.6.3-2.el7.i686                                                                                                                  8/25
   Installing : libXext-1.3.3-3.el7.i686                                                                                                                 9/25
   Installing : libXi-1.7.4-2.el7.i686                                                                                                                  10/25
   Installing : libXfixes-5.0.1-2.1.el7.i686                                                                                                            11/25
   Installing : libXrender-0.9.8-2.1.el7.i686                                                                                                           12/25
   Installing : zlib-1.2.7-15.el7.i686                                                                                                                  13/25
   Installing : freetype-2.4.11-11.el7.i686                                                                                                             14/25
   Installing : expat-2.1.0-8.el7.i686                                                                                                                  15/25
   Installing : fontconfig-2.10.95-7.el7.i686                                                                                                           16/25
   Installing : libpng12-1.2.50-6.el7.i686                                                                                                              17/25
   Installing : libXrandr-1.4.2-2.el7.i686                                                                                                              18/25
   Installing : libXdamage-1.1.4-4.1.el7.i686                                                                                                           19/25
   Installing : libXtst-1.2.2-2.1.el7.i686                                                                                                              20/25
   Installing : libXinerama-1.1.3-2.1.el7.i686                                                                                                          21/25
   Installing : libSM-1.2.2-2.el7.i686                                                                                                                  22/25
   Installing : libjpeg-turbo-1.2.90-5.el7.i686                                                                                                         23/25
   Installing : 1:dbus-libs-1.6.12-13.el7.i686                                                                                                          24/25
   Installing : alsa-lib-1.0.28-2.el7.i686                                                                                                              25/25
   Verifying  : libXext-1.3.3-3.el7.i686                                                                                                                 1/25
   Verifying  : fontconfig-2.10.95-7.el7.i686                                                                                                            2/25
   Verifying  : libICE-1.0.9-2.el7.i686                                                                                                                  3/25
   Verifying  : glibc-2.17-105.el7.i686                                                                                                                  4/25
   Verifying  : libXrandr-1.4.2-2.el7.i686                                                                                                               5/25
   Verifying  : libgcc-4.8.5-4.el7.i686                                                                                                                  6/25
   Verifying  : libXdamage-1.1.4-4.1.el7.i686                                                                                                            7/25
   Verifying  : nss-softokn-freebl-3.16.2.3-13.el7_1.i686                                                                                                8/25
   Verifying  : libxcb-1.11-4.el7.i686                                                                                                                   9/25
   Verifying  : libSM-1.2.2-2.el7.i686                                                                                                                  10/25
   Verifying  : libXinerama-1.1.3-2.1.el7.i686                                                                                                          11/25
   Verifying  : libuuid-2.23.2-26.el7.i686                                                                                                              12/25
   Verifying  : libjpeg-turbo-1.2.90-5.el7.i686                                                                                                         13/25
   Verifying  : libXau-1.0.8-2.1.el7.i686                                                                                                               14/25
   Verifying  : libXfixes-5.0.1-2.1.el7.i686                                                                                                            15/25
   Verifying  : libpng12-1.2.50-6.el7.i686                                                                                                              16/25
   Verifying  : libXtst-1.2.2-2.1.el7.i686                                                                                                              17/25
   Verifying  : zlib-1.2.7-15.el7.i686                                                                                                                  18/25
   Verifying  : freetype-2.4.11-11.el7.i686                                                                                                             19/25
   Verifying  : 1:dbus-libs-1.6.12-13.el7.i686                                                                                                          20/25
   Verifying  : alsa-lib-1.0.28-2.el7.i686                                                                                                              21/25
   Verifying  : libXrender-0.9.8-2.1.el7.i686                                                                                                           22/25
   Verifying  : libX11-1.6.3-2.el7.i686                                                                                                                 23/25
   Verifying  : expat-2.1.0-8.el7.i686                                                                                                                  24/25
   Verifying  : libXi-1.7.4-2.el7.i686                                                                                                                  25/25
  
Installed:
   alsa-lib.i686 0:1.0.28-2.el7         dbus-libs.i686 1:1.6.12-13.el7         fontconfig.i686 0:2.10.95-7.el7         freetype.i686 0:2.4.11-11.el7       
   glibc.i686 0:2.17-105.el7            libSM.i686 0:1.2.2-2.el7               libXdamage.i686 0:1.1.4-4.1.el7         libXext.i686 0:1.3.3-3.el7          
   libXfixes.i686 0:5.0.1-2.1.el7       libXinerama.i686 0:1.1.3-2.1.el7       libXrandr.i686 0:1.4.2-2.el7            libXrender.i686 0:0.9.8-2.1.el7     
   libXtst.i686 0:1.2.2-2.1.el7         libgcc.i686 0:4.8.5-4.el7              libjpeg-turbo.i686 0:1.2.90-5.el7       libpng12.i686 0:1.2.50-6.el7        
   zlib.i686 0:1.2.7-15.el7           
  
Dependency Installed:
   expat.i686 0:2.1.0-8.el7     libICE.i686 0:1.0.9-2.el7 libX11.i686 0:1.6.3-2.el7                   libXau.i686 0:1.0.8-2.1.el7 libXi.i686 0:1.7.4-2.el7
   libuuid.i686 0:2.23.2-26.el7 libxcb.i686 0:1.11-4.el7  nss-softokn-freebl.i686 0:3.16.2.3-13.el7_1
  
Complete!
[root@cndba.cn ~]#
  
  
[root@cndba.cn ~]# rpm -ivh teamviewer_11.0.53191.i686.rpm
warning: teamviewer_11.0.53191.i686.rpm: Header V4 DSA/SHA1 Signature, key ID 72db573c: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
    1:teamviewer-11.0.53191-0          ################################# [100%]
[root@cndba.cn ~]#

 

Teamviewer安装成功。


本文转自 张冲andy 博客园博客,原文链接:http://www.cnblogs.com/andy6/p/5840741.html   ,如需转载请自行联系原作者

http://www.cnblogs.com/andy6/p/5840741.html


相关文章
|
17天前
|
Linux C语言
linux yum安装ffmpeg 图文详解
linux yum安装ffmpeg 图文详解
38 0
|
17天前
|
Linux
linux yum 安装rar和unrar
linux yum 安装rar和unrar
57 0
|
18天前
|
安全 Ubuntu Java
Linux配置使用篇
Linux配置使用篇
|
19天前
|
Ubuntu Linux 编译器
【Linux】4. 开发工具的使用(yum/vim)
【Linux】4. 开发工具的使用(yum/vim)
44 2
|
17天前
|
网络协议 Linux
在Linux中,管理和配置网络接口
在Linux中管理网络接口涉及多个命令,如`ifconfig`(在新版本中被`ip`取代)、`ip`(用于网络设备配置)、`nmcli`(NetworkManager的CLI工具)、`nmtui`(文本界面配置)、`route/ip route`(处理路由表)、`netstat/ss`(显示网络状态)和`hostnamectl/systemctl`(主机名和服务管理)。这些命令帮助用户启动接口、设置IP地址、查看连接和路由信息。不同发行版可能有差异,建议参考相应文档。
19 4
|
1天前
|
Oracle Java 关系型数据库
Linux环境安装配置JDK11
Linux环境安装配置JDK11
16 0
|
1天前
|
Ubuntu Linux
Linux(Ubuntu)系统临时IP以及静态IP配置(关闭、启动网卡等操作)
请注意,以上步骤是在临时基础上进行配置的。如果要永久保存静态IP地址,通常还需要修改 `/etc/network/interfaces`文件,以便在系统重启后保持配置。同时,确保备份相关配置文件以防止出现问题。
12 1
|
3天前
|
人工智能 数据可视化 Linux
【linux基础(五)】Linux中的开发工具(上)---yum和vim
【linux基础(五)】Linux中的开发工具(上)---yum和vim
|
3天前
|
Ubuntu Linux 测试技术
Linux(32)Rockchip RK3568 Ubuntu22.04上部署 Docker: 详细配置与功能测试(下)
Linux(32)Rockchip RK3568 Ubuntu22.04上部署 Docker: 详细配置与功能测试
35 1
|
3天前
|
运维 网络协议 Linux
Linux(28) Linux双网卡配置为连接到Linux主机的PC提供外网访问
Linux(28) Linux双网卡配置为连接到Linux主机的PC提供外网访问
30 1