RedHat

RPM quickies

rpm -ivh apache2.i386.rpm Install package apache2 already download on the system.
rpm -i ftp://ftp.mynitor.com/apache-3.i386.rpm You can do it with http:// as well. Simple of installing RPM from remote server.
rpm -ev apache2 Uninstall apache2 package..
rpm -Uvh apache2-1.i386.rpm Upgrade an existing package. You can also do rpm -Uvh ftp/http to fetch pkg.
rpm –verify apache2 List files that did not pass the verify tests.
rpm -qpl apache2.i386.rpm List location where RPM would be installed.
rpm -ql apache2 List location of files on the system where the RPM has already been installed.
rpm -qi apache2 This one is my favorite. It displays pkg information such as version, release, installed date and much more.
rpm -qf /etc/apache2/conf/httpd.conf This will tell you which package the file httpd.conf belongs to.
rpm -qa List all installed RPM packages on the system.
rpm -qa –last List all the recently installed RPM packages.
rpm -qR apache2.i386.rpm Outputs dependencies for the RPM.

source

By WladyX on 4 August, 2010 | RedHat | A comment?

CentOS / Red Hat Linux: Install and manage iSCSI Volume

# yum install iscsi-initiator-utils

or

$ sudo apt-get install open-iscsi

# vi /etc/iscsi/iscsid.conf

node.session.auth.username = My_ISCSI_USR_NAME
node.session.auth.password = MyPassword
discovery.sendtargets.auth.username = My_ISCSI_USR_NAME
discovery.sendtargets.auth.password = MyPassword

# /etc/init.d/iscsi start

# iscsiadm -m discovery -t sendtargets -p 192.168.1.5
# /etc/init.d/iscsi restart

# fdisk -l

CentOS / Red Hat Linux: Install and manage iSCSI Volume

By WladyX on 7 August, 2009 | General, RedHat, Ubuntu | A comment?

How to create a yum repository on RHEL/CentOS 5.x with CD/DVD or ISO images

We need several packages to create yum repository, you can install them from CD/DVD disks or ISO images.

# yum install createrepo wget

# cd /mnt # createrepo .
Mount your CD/DVD or ISO images
DVD Disk or DVD ISO image

* If you have DVD disk, please mount dvd-rom first, and then create yum repository:

# mkdir /mnt/dvd/
# mount /dev/cdrom /mnt/dvd/

* If you use DVD iso, please copy it to the system, and then create yum repository:

# mkdir /mnt/dvd/
# mount -o loop /root/rhel5.1-dvd.iso /mnt/dvd

CD images

If you have multiple CD image files, you should mount all iso images and then create yum repository.

* Mount all iso images:

# mkdir -p /mnt/{1,2,3,4,5}
# mount -o loop rhel5.1-disc1.iso /mnt/1
# mount -o loop rhel5.1-disc2.iso /mnt/2
# mount -o loop rhel5.1-disc3.iso /mnt/3
# mount -o loop rhel5.1-disc4.iso /mnt/4
# mount -o loop rhel5.1-disc5.iso /mnt/5

Install necessary package

* Find and install ‘createrepo’ package in /mnt directory:

# find /mnt -iname ‘createrepo*’
/mnt/dvd/Server/createrepo-0.4.11-3.el5.noarch.rpm

# rpm -ivh /mnt/dvd/Server/createrepo-0.4.11-3.el5.noarch.rpm

Create yum repository
Create metadata

* Create yum repository:

# cd /mnt/
# createrepo .

Define yum repository

Create yum repository define file /etc/yum.repos.d/dvdiso.repo:

[MailRepo]
name=MailRepo
baseurl=file:///mnt/
enabled=1
gpgcheck=0

Test it

# yum clean all
# yum list

If ‘yum list’ list all packages in DVD/CD disks or ISO images, it works. :)

Create_a_Local_Yum_Repository – iredmail – How to create a yum repository on RHEL/CentOS 5.x with CD/DVD or ISO images.

RPM install log

By WladyX on 23 June, 2009 | General, RedHat | A comment?