package managing yum repolist createrepo yum search

rpm -ivh blah.rpm #i -install, v - verbose, h - show hashes

meta package handler:
repositories -> indexes

yum install blah.rpm
---

[root@localhost ~]# yum repolist
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.mirohost.net
 * epel: epel.besthosting.ua
 * extras: mirror.mirohost.net
 * updates: mirror.mirohost.net
repo id                       repo name                                                    status
base/7/x86_64                 CentOS-7 - Base                                               9,363
epel/x86_64                   Extra Packages for Enterprise Linux 7 - x86_64               11,825
extras/7/x86_64               CentOS-7 - Extras                                               383
updates/7/x86_64              CentOS-7 - Updates                                            1,885
repolist: 23,456
[root@localhost ~]#


==========================
[root@localhost repo]# ll /repo/
total 956
-rw-r--r-- 1 root root 881948 Jan 31 10:59 nginx-1.10.3-1.el6.ngx.x86_64.rpm
-rw-r--r-- 1 root root  90548 Jun 24 15:56 tomcat-7.0.69-10.el7.noarch.rpm
[root@localhost repo]# 


[root@localhost yum.repos.d]# cat myrepo.repo 
[myrepo]
name=myrepo
baseurl=file:///repo
gpgcheck=0
enabled=1



[root@localhost yum.repos.d]# yum repolist 
Loaded plugins: fastestmirror, langpacks
file:///repo/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /repo/repodata/repomd.xml"
Trying other mirror.
file:///repo/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /repo/repodata/repomd.xml"
Trying other mirror.
repo id                       repo name                                                    status
base/7/x86_64                 CentOS-7 - Base                                               9,363
epel/x86_64                   Extra Packages for Enterprise Linux 7 - x86_64               11,825
extras/7/x86_64               CentOS-7 - Extras                                               383
myrepo                        myrepo                                                            0
updates/7/x86_64              CentOS-7 - Updates                                            1,885
repolist: 23,456


[root@localhost yum.repos.d]# createrepo /repo/
Spawning worker 0 with 2 pkgs
Workers Finished
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete

[root@localhost yum.repos.d]# yum repolist
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.mirohost.net
 * epel: epel.besthosting.ua
 * extras: mirror.mirohost.net
 * updates: mirror.mirohost.net
repo id                       repo name                                                    status
base/7/x86_64                 CentOS-7 - Base                                               9,363
epel/x86_64                   Extra Packages for Enterprise Linux 7 - x86_64               11,825
extras/7/x86_64               CentOS-7 - Extras                                               383
myrepo                        myrepo                                                            2
updates/7/x86_64              CentOS-7 - Updates                                            1,885
repolist: 23,458
[root@localhost yum.repos.d]# 

list available packages

[root@localhost yum.repos.d]# yum list all | more
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.mirohost.net
 * epel: epel.besthosting.ua
 * extras: mirror.mirohost.net
 * updates: mirror.mirohost.net
Installed Packages
GConf2.x86_64                             3.2.6-8.el7                  @base  
GeoIP.x86_64                              1.5.0-11.el7                 @anaconda
ModemManager.x86_64                       1.6.0-2.el7                  @base  
ModemManager-glib.x86_64                  1.6.0-2.el7                  @base  
NetworkManager.x86_64                     1:1.4.0-14.el7_3             @updates
NetworkManager-adsl.x86_64                1:1.4.0-14.el7_3             @updates
NetworkManager-bluetooth.x86_64           1:1.4.0-14.el7_3             @updates
NetworkManager-glib.x86_64                1:1.4.0-14.el7_3             @updates
NetworkManager-libnm.x86_64               1:1.4.0-14.el7_3             @updates
NetworkManager-team.x86_64                1:1.4.0-14.el7_3             @updates 


[root@localhost yum.repos.d]# yum list installed | wc -l
1380
[root@localhost yum.repos.d]# yum list  | wc -l
21710
[root@localhost yum.repos.d]# 


[root@localhost yum.repos.d]# yum search semanage
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.mirohost.net
 * epel: epel.besthosting.ua
 * extras: mirror.mirohost.net
 * updates: mirror.mirohost.net
===================================== N/S matched: semanage =====================================
libsemanage-python.x86_64 : semanage python bindings for libsemanage
libsemanage.i686 : SELinux binary policy manipulation library
libsemanage.x86_64 : SELinux binary policy manipulation library
libsemanage-devel.i686 : Header files and libraries used to build policy manipulation tools
libsemanage-devel.x86_64 : Header files and libraries used to build policy manipulation tools
libsemanage-static.i686 : Static library used to build policy manipulation tools
libsemanage-static.x86_64 : Static library used to build policy manipulation tools

  Name and summary matches only, use "search all" for everything.
[root@localhost yum.repos.d]# 
[root@localhost yum.repos.d]# 

in some cases yum search doesn't find what you need, then use whatprovides

[root@localhost yum.repos.d]# yum whatprovides */semanage
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.mirohost.net
 * epel: epel.besthosting.ua
 * extras: mirror.mirohost.net
 * updates: mirror.mirohost.net
base/7/x86_64/filelists_db                                                | 6.6 MB  00:00:05     
epel/x86_64/filelists_db                                                  | 8.0 MB  00:00:06     
extras/7/x86_64/filelists_db                                              | 926 kB  00:00:00     
myrepo/filelists_db                                                       | 2.2 kB  00:00:00     
updates/7/x86_64/filelists_db                                             | 3.7 MB  00:00:03     
libsemanage-devel-2.5-4.el7.i686 : Header files and libraries used to build policy manipulation
                                 : tools
Repo        : base
Matched from:
Filename    : /usr/include/semanage



libsemanage-devel-2.5-4.el7.x86_64 : Header files and libraries used to build policy manipulation
                                   : tools
Repo        : base
Matched from:
Filename    : /usr/include/semanage



libsemanage-devel-2.5-5.1.el7_3.i686 : Header files and libraries used to build policy
                                     : manipulation tools
Repo        : updates
Matched from:
Filename    : /usr/include/semanage



libsemanage-devel-2.5-5.1.el7_3.x86_64 : Header files and libraries used to build policy
                                       : manipulation tools
Repo        : updates
Matched from:
Filename    : /usr/include/semanage



policycoreutils-python-2.5-8.el7.x86_64 : SELinux policy core python utilities
Repo        : base
Matched from:
Filename    : /usr/sbin/semanage
Filename    : /usr/share/bash-completion/completions/semanage
====================================


Comments

Popular posts from this blog

HAproxy logging

tomcat catalina coyote jasper cluster

NFS mount add in fstab _netdev instead of default | firewall-cmd --list-all