Structure of a rpm package and rpm commands




RPM stands for RED-HAT Package Manager.


1. Structure of a .rpm packages:-



2. Arctecture type:-
a) x86 = i386 for 32 bit of motherboards.
b) x64_x86 = i686 for 64 bit of motherboards.


3.Working with RPM packages :-
rpm –ivh telnet.2.5.6-i386.rpm
options
      1. –i [install pkgs]
      2. –h [it generate hash while installation of pkgs]
      3. –v [verbose{means it show the output}]
      4. –V [verifying pkgs ]
      5. –e or --replacepkgs [uninstall or remove]
      6. –q [to check]
      7. –Urh [upgrade]
      8. –K [check sing. Of the pkgs]
      9. –F [sometimes –U install the pkgs ,if you want to upgrade use –F ]
      10. --test [to check pkgs]
     11. --nodeps [install or upgrade the pkgs without checking dependencies]
     12. --noscripts [do not executes any of the script before or after installation,upgrade or removal]
     13. --excludedocs [do not install pkgs marked as docs ,file such as man pages]
     14. –oldpackage [allow a pkg to be replaced with old one]


4. RPM verification codes:-
1. S - file size has changed
2. M - mode change include file perm & type.
3. 5 - MD5 sum has changed.
4. D - device major or minor no. has changed.
5. L - the path of symbolic link has changed.
6. U - owner of file has changed.
7. G - group of file has changed.
8. T - last modified time has changed


5. More options:-
1. -qc [to see conf.files]
2. -qd [to see doc. Files]
            3. -q --changelog [each time pkg is change : to see pkg log files]
          
            4. --q –changelog –p full structure of .rpm [-p shows the full path or relative path to the pkg file]
           
            5. -qF or –freshen [only upgrade]



Use Red Hat Enterprise Linux Installation DVD as a Software Repository in RHEL-5x & 6x



Use a Red Hat Enterprise Linux installation DVD as a base software repository in RHEL-5x & 6x, either in the form of a physical disc, or in the form of an ISO image file.

  • If you are using a physical DVD, insert the disc into your computer.
  • Create a mount point for the repository:

[root@yum6 ~]# mkdir /home/repo

  • where /home/repo is a location for the repository, for example,
  • Mount the DVD on the mount point that you just created.

[root@yum6 ~]# mount /dev/cdrom /home/repo/

  • If you are using an ISO image file of a disc, mount the image file like this:

[root@yum6 ~]# mount -o loop /var/ftp/pub/rhel6.iso /home/repo/

  • If you are not sure whether a storage device is mounted, run the mount command to obtain a list of current mounts. If you are not sure of the device name or partition number of a storage device, run fdisk -l and try to identify it in the output.
  • Create a new repo file in the /etc/yum.repos.d/ directory. The name of the file is not important, as long as it ends in .repo.

[root@yum6 ~]# vi /etc/yum.repos.d/ser.repo 


[server]
name=pkgs
baseurl=file:///home/repo/Server
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release


  •  save the file
  • Now check your base repository with following command.


[root@yum6 ~]# yum list | grep bind*

[root@yum6 ~]# yum install bind -y



How to fix “GNOME 3 Failed to Load” Error in FEDORA 16




  • when I Install & start fedora first time, I see this error.




Step to fix this error.

  • open terminal  >> Create a directory


[Yogesh@client ~]$ mkdir .config/autostart/

  • Now create a file in .config/autostart/ directory.

[Yogesh@client ~]$ vi .config/autostart/gnome3.desktop


[Desktop Entry]
Type=Application
Exec=gnome-shell --replace
Hidden=false
NoDisplay=false
X-Gnome-Autostart-enabled=true
Name[en_US]=Gnome Shell
Name=Gnome Shell
Comment[en_US]=
Comment=

  • Save & exit from file.

  • Now logout & then login again, U will see your cool gnome3 desktop.


DNS-SERVER & DNS-RECORDS



DNS is the Domain Name System. DNS converts machine names to the IP addresses that
 all machines on the net have. It translates (or "maps") from name to address and from address
 to name, and some other things. A mapping is simply an association between two things,
 in this case a machine name, like ftp.domainname.org, and the machine's IP number
 (or address) 192.168.X.X. DNS also contains mappings the other way, from the IP number
 to the machine name; this is called a "reverse mapping".  DNS is a directory of resource
 records organized as a tree.



DNS Records



Records Description
1.A {Address} records
DNS A resource records map host names to their 32 bit IPv4 address.
The A record mainly associate a hostname with an IP address,
 It also used for storing subnet mask.
2.AAAA records
DNS AAAA resource records map hostnames to their
128 bit IPv6 address.
3.PTR
{pointer} records
DNS PTR resource records map IP address to their
corresponding hostname. The most common use is for
implementing reverse DNS lookups.
4.CNAME
{canonical name} records
DNS CNAME resource records denote the “canonical name”.
It create an Alias of one name to another which maps a name
to another hostname which has an A or AAAA records.
 This helps when running multiple services {like a FTP
 server & a web server, each running on different posts}
 from a single IP address. Each service can have its own entry in
DNS server {like ftp.domainname.com.& www.domainname.com .}.
 Network administrators also use CNAMEs when running
multiple HTTP servers on the same port, with different names,
on the same physical host. The DNS lookup will continue
by retrying the lookup with the new name.
5.DNAME
{delegation name} records
DNAME creates an alias for a name and all its sub-names,
unlike CNAME, which aliases only the exact name in its
 label. Like the CNAME record, the DNS lookup will continue
 by retrying the lookup with the new name.
5.MX records
DNS MX resource records denote the “MAIL EXCHANGER”.
 It used to maps a domain name to a list of message transfer agents
 {MTAs} for that domain. The MX records specifies a
 mail server responsible for accepting email messages on
 behalf of a recipient’s domain and a preference value used to
 prioritize mail delivery if multiple mail servers are available. 
The set of MX records of a domain name specifies how
 email should be routed with the Simple Mail Transfer Protocol
 {SMTP}.
6.NS records
DNS NS resource records denote the authoritative name
 server for a domain. All public masters & slave servers 
should have a NS record for the domains zones they manage.
7.SOA records
{start of authority record}
Specifies authoritative information about a DNS zone, including
 the primary name server, the email of the domain administrator
, the domain serial number, and several timers relating to refreshing
 the zone.





SAMBA PASSWORD {smbpasswd}





    The smbpasswd program has several different functions, depending on whether it is run by the root user or not. When run as a normal user it allows the user to change the password used for their SMB sessions on any machines that store SMB passwords.

     By default (when run with no arguments) it will attempt to change the current user´s SMB password on the local machine. This is similar to the way the passwd program works. smbpasswd differs from how the passwd program works however in that it is not setuid root but works in a client-server mode and communicates with a locally running smbd. As a consequence in order for this to succeed the smbd daemon must be running on the local machine. On a UNIX machine the encrypted SMB passwords are usually stored in the smbpasswd file.

     When run by an ordinary user with no options, smbpasswd will prompt them for their old SMB password and then ask them for their new password twice, to ensure that the new password was typed correctly. No passwords will be echoed {seen} on the screen whilst being typed. If you have a blank SMB password (specified by the string "NO PASSWORD" in the smbpasswd file) then just press the <Enter> key when asked for your old passwd.

     smbpasswd can also be used by a normal user to change their SMB password on remote machines, such as Windows NT Primary Domain Controllers.

     When run by root, smbpasswd allows new users to be added and deleted in the smbpasswd file, as well as allows changes to the attributes of the user in this file to be made. When run by root, smbpasswd accesses the local smbpasswd file directly, thus enabling changes to be made even if smbd is not running.


Smbpasswd Options



No. Options Description
1. -a This option specifies that the username should be added to the local
 smbpasswd file, with the new password typed
 (type <Enter> for the old password).
2. -x This option specifies that the username should be deleted from
 the local smbpasswd file.
3. -d This option specifies that the username should be disabled in the
 local smbpasswd file.
4. -e This option specifies that the username should be enabled in the
 local smbpasswd file, if the account was previously disabled.
 If the account was not disabled this option has no effect.
5. -n This option specifies that the username should have their password
 set to null (i.e. a blank password) in the local smbpasswd file.
6. -L This specifies the username for all of the root only options to operate on.
 Only root can specify this parameter as only root has the permission
 needed to modify attributes directly in the local smbpasswd file.



Some examples



     Deepti now needs to be allocated a password for accessing the Samba server. Remember, this is a separate password to her UNIX account any may be different if necessary.

[root@lan ~]# smbpasswd -a deepti
New SMB password:
Retype new SMB password:
Added user deepti.
[root@lan ~]#



The above command adds (-a) an entry into the "smb password file" and encrypts the password. Type "smbpasswd deepti" to simply change passwords.



     deepti can now access the server over the network, however there are still no shares defined.



[root@lan ~]# grep deepti /etc/samba/smbpasswd
deepti:501:96E0D1709FC223FAAAD3B435B51404EE:D27916F620BA786CE3EF222565D6F691:[U          ]:LCT-4F4E7754:
[root@lan ~]#



###################################################


How to install and use VMware Workstation 8 on RHEL 6x / CentOS 6x (x86_64)




############################################################


1.Go to VMware <dot> com to download VMware workstation.

2.Select support and downloads and download VMware-Workstation-Full-8.x.x.x86_64.bundle format instead rpm package.

3.Open Terminal and switch to root user to execute VMware-Workstation-Full-8.x.x.x86_64.bundle file & Change the file permission to make it executable.


[yogesh@PC ~]$ su -
Password:

[root@PC Downloads]# ./VMware-Workstation-Full-8.0.2-591240.i386.bundle
-bash: ./VMware-Workstation-Full-8.0.2-591240.i386.bundle: Permission denied

[root@PC Downloads]# chmod 755 VMware-Workstation-Full-8.0.2-591240.i386.bundle

[root@PC Downloads]# ./VMware-Workstation-Full-8.0.2-591240.i386.bundle
Extracting VMware Installer...done.


4.After performing Vmware...... command, this dialog box will shown, Agree this AGREEMENT.











5.click yes to check for product updates on startup.





6.click next.




7.Enter user name for your VMware workstation, which will initially connect to workstation.


8.Now choose a dir for your shared virtual machines.







9.Enter the port to use for https access to workstation server.


10.click next


11.Now product is ready to installed >> click install.



12.At this point sit back....because installation of VMware workstation take several minutes.
















13.Installation of VMware is finished > click close.

14.After this go-to Applications > system Tools > VMware workstation.




15.accept this agreement.


16.VMware first time open like this.....


17.Enter License Key. click on Enter the License Key...  >> Enter License Key


18.Enter root passwd.







19.Enter key.



20.Now your Vmware gets its reg.... key. 


click on Create a New virtual machine.



21.choose Typical > click next.


22.Now U can choose a physical drive or an ISO image for Installation.


23.I choose an iso > browse... your Image.








24.Insert your user information and click next.


25.Insert virtual machine Name & its Location > next








26.Enter disk size > next.


27.Now click on customize hardware.....



28.decrease Ram { This step is not important}




29.click on Network Adapter > Bridged.



30.click on sound card > connect at power on.


31.you can manually set resolution for your monitor  >> close.



32.Click to finish.



33.Now installation is start. {This is easy installation, but you can also install manually.}




34.click inside of virtual machine and press enter.


35.anacoda is start.


36.Now Installation of RHEL-6.x is start in VMware workstation 8.











How to open pre-installed, installation files of operating system.



37.click on "open a Virtual machine".


38.Browse your installation files.


39.open pre-installed "RHEL6 yum6 {.245.vmx" os.


40.Now you can see pre-installed os.


41.Now I am back to installation of RHEL-6.x in VMware workstation 8.





############################################################



############################################################



How to add more virtual Network in VMware workstation 8.



43.Enter root passwd.


44.click "Add network".


45.click add.


46.Now you can see vmnets2 is added >> save.


47.I am back to Installation, it is going to finish.














48.Now log-in with your user.








49.This is my physical os ip addr.


50.set ip addr in virtual os.














check it out :- how to change hostname without restart.









52.Now log-out & then log-in again.




53.Now the hostname of the virtual PC is "web".


Now I am going to change virtual machine configuration take a look on this too....







############################################################



############################################################


how to add 1 more HDD. click Add...



56.choose HDD > click next.


57.choose create a virtual disk... > next







58.click next.


59.Enter disk size... > next


60.click finish.



61.Now you can see second HDD  >> click save.



62.click "Power on this virtual machine".


63.click yes.








64.Now RHEL6 booting will start in your VMware.







65.Select user and enter passwd.




66.You can see that this RHEL6 have two HDD.

67.First is /dev/sda and second is /dev/sdb HDD.








68.At the end suspend or pause your virtual machine to use it latter.











69.Now to start again suspended virtual machine click "Resume this virtual machine".



############################################################




############################################################

plz share this article