This post records some useful operations regarding repo and package management of the redhat, centos, and enterprise linux like system.
List all the available repositories
1
2
3
4
5
6
7
8
9
10yum repolist
Loaded plugins: priorities, update-motd, upgrade-helper
amzn-updates/latest/primary_db | 675 kB 00:00
repo id repo name status
!amzn-main/latest amzn-main-Base 5541
!amzn-updates/latest amzn-updates-Base 845
!mesosphere/x86_64 Mesosphere Packages for EL 6 - x86_64 76
!mesosphere-noarch Mesosphere Packages for EL 6 - noarch 5
repolist: 6467List available packages from selected repository
1
2
3
4
5yum --disablerepo="*" --enablerepo="mesosphere-noarch" list available
Loaded plugins: priorities, update-motd, upgrade-helper
Available Packages
mesosphere.noarch 0.1.0-0.el6 mesosphere-noarchSearch package by name
1
2
3
4yum list mesos
Installed Packages
mesos.x86_64 0.28.2-2.0.27.centos65 @mesosphereSearch package when you don’t know the exact name
1
2
3
4
5
6
7
8
9
10
11
12
13
14yum provides ntp
ntp-4.2.6p5-36.29.amzn1.x86_64 : The NTP daemon and utilities
Repo : amzn-main
ntp-4.2.6p5-40.30.amzn1.x86_64 : The NTP daemon and utilities
Repo : amzn-updates
ntp-4.2.6p5-40.30.amzn1.x86_64 : The NTP daemon and utilities
Repo : @amzn-updatesDisplay package info
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19yum info mesos
Loaded plugins: priorities, update-motd, upgrade-helper
Installed Packages
Name : mesos
Arch : x86_64
Version : 0.28.2
Release : 2.0.27.centos65
Size : 88 M
Repo : installed
From repo : mesosphere
Summary : Cluster resource manager with efficient resource isolation
URL : https://mesos.apache.org/
License : Apache-2.0
Description : Cluster resource manager with efficient resource isolation
: Apache Mesos is a cluster manager that offers efficient resource isolation
: and sharing across distributed applications, or frameworks. It can run
: Hadoop, MPI, Hypertable, Spark (a new framework for low-latency interactive
: and iterative jobs), and other applications.List Files Contained in a Package
1
2
3
4repoquery --list marathon
/etc/init/marathon.conf
/usr/bin/marathonRemove yum repository and yum package
1
2
3
4# repo
rpm -qf /etc/yum.repos.d/REPONAME.repo
# package
yum remove PACKAGENAMEClean yum cache
1
yum clean all