Two ways of Installations.
Standalone: In this type, we can install the packages through any removable media (or) through the dump.
Syn: #rpm <options> <pkg-name> --force --aid
Options:
I ---> install a given package
V ---> verbose output
H ---> Shows hash progress when installing
U ---> Upgrades a given package
E ---> Removes a given package
---force ---> Install the package with forcefully
---aid ---> Install the package along with dependencies
---nodeps ---> To erase an package without dependencies
Syn: #rpm <options> <kg-name>
C ---> Lists all config files.
D ---> lists all documentation files.
I --->Displays information about the package.
L --->Lists the files in a package.
S --->status of the package.
-a ---> Queries all packages
F ---> displays information about the specified file.
---> For installing an application. #rpm -ivh nano -2.2.6-1.x86_64.rpm
# rpm -ivh nano-2.2.6-1.x86_64.rpm --force
#rpm - Uvh nano -2.2.6-1.x86_64.rpm
# rpm -e nano
#rpm - ivh -replace pkgs nano -2.26-1 .x86_64.rpm
Tip: A common situation to run into on the job is having to install a package that is already installed. You don’t have to go through the trouble of uninstalling the package first only to reinstall it. You can use the –replace pkg option alongside the regular install options to override an existing installation.
#rpm -qa / grep nano
#rpm -qi nano
#rpm -qf /etc/syslog.comf
#rpm -qd rsyslog
#rpm -qd rsyslog
#rpm -q1 rsyslog
#rpm -qr rsyslog
Inclined to build a profession as Linux Developer? Then here is the blog post on, explore Linux Training
In this level, we can install the package from the server through NFS (or) FTP services.
NFS Service:
#ping 192.168.0.254
#Mount 192.168.0.254:/var/ftp/pub/server/mnt #cd /mnt #rpm –ivh vsftpd* --force --aid
FTP Service: In this method to install the package the ftp server should have the dump of o/s under the ftp default sharable location
# ping 192/168.0.254
#rpm -ivh ftp://192.168.0.254/pub/server/<pkg-name> --force --aid
Syn: Yum <options> <command> <package name>
Options:
c --> specifies the location of the config file
q --> specifies quit, no output
y --> to always answer yes to prompts.
V --> provides verbose output.
Clean --> Removes cached data.
Erase --> Removes a package from the system.
List --> Displays available packages
Install --> Install a package on the system.
Search --> Enables you to search for a package.
Update --> Updates a package.
Group list --> Displays available packages groups.
Group installs --> Install packages with in a group.
Group remove --> Removes a packages with in a group
#mount/dev/dvd/mnt
#rpm – ivh vsftpd* --force –aid
#cp –rvf /mnt/* /var/ftp/pub *à means all the data under the mount point /mnt.
#rpm -ivh create repo* ---force --aid
#create repo -g /var/ftp/pub/server/repo data/comps-rhel5-server-core.xml/ var/ftp/pub
Note: If any errors are showing then remove #rm - fr /var/ftp/pub/repo data
#vim /etc/yum.repos.d/linux.repo
:wq!
# service vsftpd restart # yum clean all
#yum list
# yum install postfix -Y
#yum update postfix -y
#yum remove postfix
Note: One great feature about yum is that instead of updating a single package, you can list all updates that need to be installed for the system. #yum list updates
#yum update
#yum group list
#yum group installs “Development Tools”
Note: Don’t forget that Linux doesn’t handle whitespace the way that windows do. If you specify a group name, you need to enclose it in quotation marks(“ “ ).
#yum search postfix
#yum info postfix ---> To flush the cache, do the following #yum clean all
[Unique title]
Name = my custom yum repository.
Base url = ftp://192.162.0.250/opt/yum/myrepos
Enabled =1
Gpgcheck =0
:wq!
Step 1: Create a folder for the temporary mount:
# mkdir /mnt/cd
Step 2: Mount the ISO image (or) cd:
# mount -o loop /dev/cdrom / mnt/cd
Note: ---> To create a ISO image.
#dd if =/dev/scdʘ of = /os/rhe/5.iso
To check it which device is mount
#mount –o loop /OS/Rhel5.iso /DVD
Step 3: Create a repository in the temporary directory:
# cd / mnt
#createrepo.
This creates an XML file of all the packages from the mounted CD.
Step 4: You also need to clean the current repository cache:
#yum clean all
Step 5: Create a .repo file for your temporary repository:
#vim /etc/yum.repos.d/sio.repo
[ISO Repo]
Name = My Repository
Base url =file:///mnt/cd
Enabled=1
Gpgcheck=0
:wq!
Step 1: copy the file over to your private directory
#cp /usr/src/redhat/RPMS/x86_64/mysample – 1.0-0.x86_64.rpm
/opt/yum/myrepos
Step 2: Update the repository to recognize your new package:
#createrepo - update
Step1: Set the daemon to boot on system start
# chkconfig rhnsd on
Step2: You should verify whether the service is currently running
#service rhnsd status
Step3: If it is, you are all set: otherwise, start the service manually:
# service rhnsd start
You liked the article?
Like: 0
Vote for difficulty
Current difficulty (Avg): Medium
TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.