Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 6

==========================================================

Task-1 How we can manage the rpm using rpm command ?

=========================================================
Machine <=== Using ISO image Installation
=========================================================

How we can find out the report about available rpms and
respective command in my machine ?

=========================================================

[root@localhost ~]# history


1 ls /
2 which rpm
3 rpm -q -a
4 rpm -qa
5 rpm -qa | wc -l
6 rpm -qa tree
7 rpm -qa zip
8 rpm -qa tar
9 rpm -qa zip*
10 rpm -qa *zip*
11 rpm -qa | grep tree
12 rpm -qa | grep -w tree
13 rpm -qa | grep zip
14 rpm -qa | grep tar
15 which tree
16 which vi
17 which vim
18 rpm -qa --last
19 rpm -qa tree --last
20 rpm -qa | wc -l
21 ls /
22 ls -ld /bin
23 ls -ld /sbin
24 ls /bin
25 ls /bin | wc -l
26 ls /usr/bin | wc -l
27 ls /sbin | wc -l
28 ls /usr/sbin | wc -l
29 cat /etc/redhat-release
30 rpm -qa | wc -l
31 expr 1491 + 534
32 rpm -qa tree
33 rpm -qi tree
34 which tree
35 rpm -qa tree
36 rpm -q -f /usr/bin/tree
37 ls /
38 rpm -q -l tree
39 rpm -q -l tree | grep bin
40 rpm -q -l tree | grep bin | wc -l
41 which useradd
42 which usermod
43 which userdel
44 rpm -qf /usr/sbin/useradd
45 rpm -qf /usr/sbin/userdel
46 rpm -qf /usr/sbin/usermod
47 rpm -ql tree
48 rpm -ql tree | grep bin
49 rpm -ql shadow-utils
50 rpm -ql shadow-utils | grep bin
51 rpm -ql shadow-utils | grep bin | wc -l
52 rpm -ql tree | grep bin | wc -l
53 rpm -qa | wc -l
54 ls /bin | wc -l
55 ls /sbin | wc -l
56 expr 1491 + 534
57 which lsblk
58 rpm -qf /usr/bin/lsblk
59 rpm -qa util-linux
60 rpm -ql util-linux
61 rpm -ql util-linux | grep bin
62 rpm -ql util-linux | grep bin | wc -l
63 ls /
64 rpm -qa tree
65 rpm -ql tree
66 which crond
67 rpm -qf /usr/sbin/crond
68 rpm -qa cronie
69 rpm -ql cronie
70 cat /etc/crontab
71 rpm -qf /etc/crontab
72 rpm -qf /usr/bin/crontab
73 cat /etc/inittab
74 rpm -qf /etc/inittab
75 rpm -qf /etc/passwd
76 rpm -qf tree
77* rpm -qc tree
78 rpm -qf tree
79 rpm -qf /usr/bin/tree
80 rpm -ql tree
81 rpm -ql cronie
82 rpm -qc cronie
83 rpm -qc tree
84 tree --help
85 rpm -qc cronie
86 rpm -qa tree
87 rpm -qi tree
88 rpm -ql tree
89 rpm -qd tree
90 cat /usr/share/doc/tree/README
91 rpm -ql tree
92 man tree
93 cat /usr/share/doc/tree/README
94 rpm -qc tree
95 rpm -qc cronie
96 rpm -ql cronie
97 rpm -qc cronie
98 rpm -qd cronie
99 rpm -ql cronie

[root@localhost ~]# rpm -qf /etc/inittab


systemd-250-6.el9_0.x86_64
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# rpm -qf /etc/crontab
crontabs-1.11-27.20190603git.el9_0.noarch
[root@localhost ~]#
[root@localhost ~]# which crontab
/usr/bin/crontab
[root@localhost ~]# rpm -qf /usr/bin/crontab
cronie-1.5.7-5.el9.x86_64
[root@localhost ~]#

[root@localhost ~]# which tree


/usr/bin/tree
[root@localhost ~]# which vi
/usr/bin/vi
[root@localhost ~]# which vim
/usr/bin/vim
[root@localhost ~]# rpm -qf /usr/bin/vim
vim-enhanced-8.2.2637-15.el9.x86_64
[root@localhost ~]#
[root@localhost ~]# rpm -qf /usr/bin/vi
vim-minimal-8.2.2637-15.el9.x86_64
[root@localhost ~]#
[root@localhost ~]# rpm -qa vim
[root@localhost ~]# rpm -qa vim*
vim-filesystem-8.2.2637-15.el9.noarch
vim-common-8.2.2637-15.el9.x86_64
vim-enhanced-8.2.2637-15.el9.x86_64
vim-minimal-8.2.2637-15.el9.x86_64
[root@localhost ~]#
[root@localhost ~]# rpm -qa *vim*
vim-filesystem-8.2.2637-15.el9.noarch
vim-common-8.2.2637-15.el9.x86_64
vim-enhanced-8.2.2637-15.el9.x86_64
vim-minimal-8.2.2637-15.el9.x86_64
[root@localhost ~]#

==================================================
How we can install any packages using local ISO image ?

step-1 connect ISO image with your VM and copy rpms folders into your machine in
any directory.

116 ls /
117 lsblk
118 ls /run/media/root/RHEL-9-0-0-BaseOS-x86_64
119 mkdir /redhatisodata
120 cd /run/media/root/RHEL-9-0-0-BaseOS-x86_64
121 ls
122 cp -rf * /redhatisodata
123 cd
124 ls /redhatisodata
125 ls /redhatisodata/AppStream
126 ls /redhatisodata/BaseOS
127 ls /redhatisodata/BaseOS/Packages/
128 ls /redhatisodata/BaseOS/Packages | wc -l
129 ls /redhatisodata/AppStream/Packages | wc -l
130 expr 5272 + 1131
131 rpm -qa | wc -l
132 expr 6403 - 1170
133 ls /redhatisodata/BaseOS/Packages
134 ls /redhatisodata/AppStream/Packages
135 ls /
136 history
137 ls /bin | wc -l
138 ls /sbin | wc -l
139 expr 1491 + 534
140 lsblk
141 eject /run/media/root/RHEL-9-0-0-BaseOS-x86_64
142 lsblk

==================================================

using rpm command ?

143 history
144 rpm -qa | wc -l
145 ls /bin | wc -l
146 ls /sbin | wc -l
147 rpm -e tree
148 which tree
149 rpm -qa tree
150 rpm -qa | wc -l
151 ls /bin | wc -l
152 rpm -e vim-enhanced
153 ls /bin | wc -l
154 vim xyz
155 vi xyz
156 rpm -e tar
157 rpm -e tar --nodeps
158 rpm -qa tree
159 rpm -qa tar
160 rpm -qa vim-enahaced
161 rpm -e gunzip2
162 rpm -qa vsftpd
163 rpm -qa ftp
164 history
[root@localhost ~]#

==================================================
Querry + Erase

1- There is no need to go on any location


2- There is no need to mention rpm complete name

~ ] #

===================================================
installation + update ==> using rpm command

1- Exact Location
2- complete name need to mention
===================================================

[root@localhost ~]# history


1 ls /redhatisodata
2 find /redhatisodata -name "vsftpd*"
3 rpm -ivh /redhatisodata/AppStream/Packages/vsftpd-3.0.3-49.el9.x86_64.rpm
4 rpm -qa vsftpd
5 find /redhatisodata -name "ftp*"
6 rpm -iv /redhatisodata/AppStream/Packages/ftp-0.17-89.el9.x86_64.rpm
7 rpm -qa vsftpd ftp
8 rpm -qa | wc -l
9 find /redhatisodata -name "tree*"
10 rpm -ivh /redhatisodata/BaseOS/Packages/tree-1.8.0-10.el9.x86_64.rpm
11 find /redhatisodata -name "vim*"
12 rpm -ivh /redhatisodata/AppStream/Packages/vim-enhanced-8.2.2637-
15.el9.x86_64.rpm
13 find /redhatisodata -name "tar*"
14 cd /redhatisodata/BaseOS/Packages
15 ls | grep tar
16 rpm -ivh tar-1.34-3.el9.x86_64.rpm
17 cd
18 rpm -qa vsftpd ftp tree tar vim-enhanced
19 rpm -qa | wc -l
20 rpm -ivh /redhatisodata/AppStream/Packages/vim-enhanced-8.2.2637-
15.el9.x86_64.rpm
21 rpm -ivh /redhatisodata/AppStream/Packages/vim-enhanced-8.2.2637-
15.el9.x86_64.rpm --force
22 which vim
23 which tree
24 which tar
25 which ftp
26 which vsftpd
27 rpm -qa vsftpd
28 rpm -qi vsftpd
29 rpm -qd vsftpd
30 rpm -qc vsftpd
31 rpm -qf /etc/vsftpd/vsftpd.conf
32 rpm -ql vsftpd
33 history

=======================================================

How we can install any package with step by step depandancies resolution ?

Examples: targetcli

[root@localhost ~]# history

1 ls /redhatisodata
2 find /redhatisodata -name "targetcli*"
3 rpm -ivh /redhatisodata/AppStream/Packages/targetcli-2.1.53-
7.el9.noarch.rpm
4 find /redhatisodata -name "python3-configshell*"
5 rpm -ivh /redhatisodata/BaseOS/Packages/python3-configshell-1.1.28-
7.el9.noarch.rpm
6 find /redhatisodata -name "python3-pyparsing*"
7 find /redhatisodata -name "python3-urwid*"
9 rpm -ivh /redhatisodata/BaseOS/Packages/python3-pyparsing-2.4.7-
9.el9.noarch.rpm
10 rpm -ivh /redhatisodata/BaseOS/Packages/python3-urwid-2.1.2-
4.el9.x86_64.rpm
11 rpm -ivh /redhatisodata/BaseOS/Packages/python3-configshell-1.1.28-
7.el9.noarch.rpm
12 find /redhatisodata -name "python3-rtslib*"
13 rpm -ivh /redhatisodata/AppStream/Packages/python3-rtslib-2.1.74-
7.el9.noarch.rpm
14 find /redhatisodata -name "python3-kmod*"
15 find /redhatisodata -name "python3-pyudev8"
16 find /redhatisodata -name "python3-pyudev*"
17 rpm -ivh /redhatisodata/BaseOS/Packages/python3-kmod-0.9-32.el9.x86_64.rpm
18 rpm -ivh /redhatisodata/BaseOS/Packages/python3-pyudev-0.22.0-
6.el9.noarch.rpm
19 rpm -ivh /redhatisodata/AppStream/Packages/python3-rtslib-2.1.74-
7.el9.noarch.rpm
20 find /redhatisodata -name "target-restore*"
21 rpm -ivh /redhatisodata/AppStream/Packages/target-restore-2.1.74-
7.el9.noarch.rpm
22 rpm -ivh /redhatisodata/AppStream/Packages/targetcli-2.1.53-
7.el9.noarch.rpm
23 rpm -qpR /redhatisodata/AppStream/Packages/targetcli-2.1.53-
7.el9.noarch.rpm
24 rpm -qa targetcli
25 rpm -qR targetcli
26 rpm -qa vsftpd
27 rpm -ql vsftpd
28 systemctl start vsftpd
29 systemctl enable vsftpd
30 systemctl is-active vsftpd
31 systemctl is-enabled vsftpd
32 ls /etc/yum.repos.d
34 rpm -qa vsftpd
35 find /redhatisodata -name "vsftpd*"
36 rpm -Uvh /redhatisodata/AppStream/Packages/vsftpd-3.0.3-49.el9.x86_64.rpm
37 rpm -Uvh /redhatisodata/AppStream/Packages/vsftpd-3.0.3-49.el9.x86_64.rpm
--force
38 history

=======================================================
=======================================================

You might also like