Difference between revisions of "Linux package management"
Line 11: | Line 11: | ||
Display info about a package | Display info about a package | ||
apt-cache show gns3 | apt-cache show gns3 | ||
Check an available package verison in a repository | |||
'''apt-cache policy gns3''' | |||
gns3: | |||
Installed: (none) | |||
Candidate: 0.8.6-3ubuntu1 | |||
Version table: | |||
0.8.6-3ubuntu1 0 | |||
500 http://gb.archive.ubuntu.com/ubuntu/ trusty/multiverse amd64 Packages | |||
= Yum = | = Yum = |
Revision as of 13:41, 18 May 2014
Apt-get
List all installed packages, search wit dash '/'. Remove grep to display headers
dpkg -l | grep ii | less
Search within the package descriptions you've already downloaded to find the package that's got the feature you're looking for. REGEX (regular expressions) is expected after 'search' and any keystrokes that mean something to your command shell (e.g. [|?*] ) you'll need to quote them so that apt-cache will be able to see them instead of having the shell expand the term to a list of file names that mean something else entirely.
apt-cache search tunnel apt-cache search 'php.*sql' apt-cache search apache.\*perl apt-cache search elvis\|vim
Display info about a package
apt-cache show gns3
Check an available package verison in a repository
apt-cache policy gns3 gns3: Installed: (none) Candidate: 0.8.6-3ubuntu1 Version table: 0.8.6-3ubuntu1 0 500 http://gb.archive.ubuntu.com/ubuntu/ trusty/multiverse amd64 Packages
Yum
It it a default package management in the following and many other RPM-based Linux distributions:
- Amazon Linux AMI
- Red Hat Enterprise Linux
- Fedora
- CentOS
Usage
System update
sudo yum update
Install package
sudo yum install nagios
Package description
$ yum info nagios Loaded plugins: priorities, update-motd, upgrade-helper Installed Packages Name : nagios Arch : x86_64 Version : 3.5.1 Release : 1.6.amzn1 Size : 5.3 M Repo : installed From repo : amzn-main Summary : Nagios monitors hosts and services and yells if somethings breaks URL : http://www.nagios.org/ License : GPLv2 Description : Nagios is a program that will monitor hosts and services on your : network. It has the ability to send email or page alerts when a : problem arises and when a problem is resolved. Nagios is written : in C and is designed to run under Linux (and some other *NIX : variants) as a background process, intermittently running checks : on various services that you specify. : : The actual service checks are performed by separate "plugin" programs : which return the status of the checks to Nagios. The plugins are : available at http://sourceforge.net/projects/nagiosplug. : : This package provides the core program, web interface, and documentation : files for Nagios. Development files are built as a separate package.
List available packages
yum list [available|installed|extras|updates|obsoletes|all|recent] [pkgspec] yum list available | less yum list available | grep package