Howto install manage packages rhel8: Difference between revisions

From Vidalinux Wiki
Jump to navigation Jump to search
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
= subscribe to redhat network =
register your server to redhat network
subscription-manager register
subscription-manager config --rhsm.auto_enable_yum_plugins=0
subscription-manager attach --auto
display repos:
subscription-manager repos
= rpm =
= rpm =
perform an rpm query to list all packages installed:
perform an rpm query to list all packages installed:
  rpm -qa
  rpm -qa
grep specific name from query list:
rpm -qa |grep vim
list what version of the package is currently installed:
list what version of the package is currently installed:
  rpm -q yum
  rpm -q yum
Line 19: Line 14:
list just the configuration files installed by the package:
list just the configuration files installed by the package:
  rpm -qc openssh-clients
  rpm -qc openssh-clients
list just the configuration files installed by the package:
manpages or documentation files installed by the package:
  rpm -qd openssh-clients
  rpm -qd openssh-clients
list shell scripts that run before or after the package is installed or removed:
list shell scripts that run before or after the package is installed or removed:
Line 37: Line 32:
list total space consume by rpm archive after install:
list total space consume by rpm archive after install:
  rpm -q -p application.rpm -i
  rpm -q -p application.rpm -i
install rpm package:
rpm -ivh application.rpm
remove rpm package:
rpm -e application.rpm
installing rpm from internet:
installing rpm from internet:
  rpm -ivh https://dl.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/e/epel-release-8-8.el8.noarch.rpm
  rpm -ivh https://dl.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/e/epel-release-8-8.el8.noarch.rpm
installing local rpm:
 
yum -ivh application.rpm
= Dnf =
= Dnf =
install package:
install package:
Line 52: Line 50:
check for available updates:
check for available updates:
  dnf check-update
  dnf check-update
list groups available:
dnf grouplist
obtain info about group:
obtain info about group:
  dnf group info "Server with GUI"
  dnf groupinfo "Server with GUI"
install group of application:
install group of application:
  dnf group install "Server with GUI"
  dnf groupinstall "Server with GUI"
update all packages on system:
update all packages on system:
  dnf update -y
  dnf update -y
install security updates:
dnf updateinfo list sec
search for an application:
search for an application:
  dnf seach httpd
  dnf seach httpd
Line 68: Line 70:
list package dependencies:
list package dependencies:
  dnf deplist httpd
  dnf deplist httpd
list how many package you have installed:
dnf list installed | wc -l
list how many package are available to install:
dnf list available | wc -l
show package info:
show package info:
  dnf info httpd
  dnf info httpd
view dnf transaction history:
dnf history
view dnf specific transaction history using id:
dnf history info 10
undo specific transaction from history using id:
dnf history undo 10 -y
you can redo the history transaction using id:
dnf history redo 10 -y
view dnf log:
tail /var/log/dnf.log
list packages update available:
list packages update available:
  dnf list updates
  dnf list updates
Line 76: Line 92:
clean all yum cache:
clean all yum cache:
  dnf clean all
  dnf clean all
build dnf cache:
dnf makecache
find which package provides specific file:
find which package provides specific file:
  dnf whatprovides /usr/lib/libstdc++.so.6
  dnf whatprovides /usr/lib/libstdc++.so.6
Line 82: Line 100:
  dnf --exclude=php* update
  dnf --exclude=php* update
  dnf --exclude=kernel* update
  dnf --exclude=kernel* update
= references =
* https://en.wikipedia.org/wiki/DNF_(software)

Latest revision as of 01:17, 24 November 2021

rpm

perform an rpm query to list all packages installed:

rpm -qa

grep specific name from query list:

rpm -qa |grep vim

list what version of the package is currently installed:

rpm -q yum

find out what package provides filename:

rpm -qf /etc/yum.repos.d

get detailed information about the package:

rpm -qi  yum

list the files installed by the package:

rpm -ql yum

list just the configuration files installed by the package:

rpm -qc openssh-clients

manpages or documentation files installed by the package:

rpm -qd openssh-clients

list shell scripts that run before or after the package is installed or removed:

rpm -q --scripts

list change information for the package:

rpm -q --changelog audit

list documentation on rpm archive:

rpm -q -p application.rpm -d

list configuration files on rpm archive:

rpm -q -p application.rpm -c

list archives on rpm archive:

rpm -q -p application.rpm -l

list rpm archive scripts:

rpm -q -p application.rpm --scripts

list rpm archive changelog:

rpm -q -p application.rpm --changelog

list total space consume by rpm archive after install:

rpm -q -p application.rpm -i

install rpm package:

rpm -ivh application.rpm

remove rpm package:

rpm -e application.rpm

installing rpm from internet:

rpm -ivh https://dl.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/e/epel-release-8-8.el8.noarch.rpm

Dnf

install package:

dnf install httpd-manual -y

download rpm package without installing:

dnf download httpd

perform local rpm installation:

dnf install httpd-2.4.6-45.el7.centos.x86_64.rpm

remove installed package:

dnf remove httpd -y

check for available updates:

dnf check-update

list groups available:

dnf grouplist

obtain info about group:

dnf groupinfo "Server with GUI"

install group of application:

dnf groupinstall "Server with GUI"

update all packages on system:

dnf update -y

install security updates:

dnf updateinfo list sec

search for an application:

dnf seach httpd

list packages available to install:

dnf list 

list packages installed:

dnf list installed

use grep to find an specific package:

dnf list |grep samba

list package dependencies:

dnf deplist httpd

list how many package you have installed:

dnf list installed | wc -l

list how many package are available to install:

dnf list available | wc -l

show package info:

dnf info httpd

view dnf transaction history:

dnf history

view dnf specific transaction history using id:

dnf history info 10

undo specific transaction from history using id:

dnf history undo 10 -y 

you can redo the history transaction using id:

dnf history redo 10 -y 

view dnf log:

tail /var/log/dnf.log

list packages update available:

dnf list updates

clean yum cache:

dnf clean packages

clean all yum cache:

dnf clean all

build dnf cache:

dnf makecache

find which package provides specific file:

dnf whatprovides /usr/lib/libstdc++.so.6

you can skip yum command updates on command line itself using following syntax:

dnf --exclude=package* update
dnf --exclude=php* update
dnf --exclude=kernel* update

references