Sunday, January 29, 2012

Add new YUM repository Fedora

All the RPM (RedHat Package Manager) that are based linux (such as Fedora, CentOS, RHEL) use yum for software management. Yum always help you to install application through remote repository of rpms.

Yum Repository in Deeper Sense

If you want to tween yum, you can do so by editing /etc/yum.conf (I will explain the configuration next week). And by default, all the configuration of yum repository are located on /etc/yum.d and /etc/yum/repos.d dir. (defined by reposdir)

Installing RPM direct from the repo

If you know the location of an RPM on the web, you can install it by adding it’s remote repository (so RPM does not belong to any repository) just by:

        rpm -Uhv protocol://location-of-file-in-the-web

where U means upgrade; this will install the new version (if your rpm is the new version) and remove the old one.

v means verbose; this will print verbose information - error messages or warning

h means hash; this will print 50 hash marks as the package archive is unpacked.

protocol://location-of-file-in-the-web - this represent the location of your rpm to be installed on your local computer.

        rpm -Uhv


Installing 3rd party repository manually

Based on the example, Let’s say I wanted to add a repository where glibsharp2 is located. So first I will create a file on /etc/yum.repos.d named mono.repo (to make it more meaningful)

        cd /etc/yum.repos.d

        vi mon.repo

Then put:




save and close it by pressing escape and :wq and enter.


[mono] - repository name

name=mono - repository name in more human readable string

baseurl= - the url of the repository, this location must include the content which is the repodata directory. This repodata contains all the information of the repo.

enabled=1 - means this repo is enabled, 0 if disabled.

gpgcheck=1 - security feature is enabled, 0 if disabled. This uses GPG key.

gpgkey= - location of the gpg key of the repo

Sometimes you have to manually import the gpg key of the repository which is done by:

rpm --import

If you need more information about rpm, yum and it’s configuration just:

man yum.conf

man yum

man rpm

Hope this can help you.. :)

Thursday, January 26, 2012

Branching and Merging for Git

Branching is a technique wherein you can create an active line of development for your source code. Through this, you will be able to create a separate copy of your source code  that you can edit and merge to your original or other copies (branches).

In order to create a branch named “testing” on an existing git repository:

git branch testing

This will create a branch named testing.

In order to check your local branch:

        git branch -l

To check for your remote branch

        git branch -r

To check all available branch for your repo:

        git branch -a

Example you inputted git branch -l, this will list all the branch on your local repo



The asterisk marks the branch you are currently on. For you to transfer to testing just:

        git checkout testing

For you to transfer to master again, commit your changes first for testing branch then checkout master:

        git checkout master

Therefore, the change you made on the testing branch is not visible on master.You can change then commit it.

If you are on master and you want to merge the changes of master and testing, you can do so by running:

        git merge testing

If you’re on testing:

        git merge master

Sometimes, there are conflicts on merging the two branch (conflict means you edit the same file on the same line). You can see all the file that has conflict by the use of:

        git diff

If you can’t fixed the conflict on files and decided to give up you can:

        git reset --hard HEAD

or if the change is committed use:

        git reset --hard ORIG_HEAD

If you want to delete testing branch, just execute:

        git branch -d testing


Wednesday, January 25, 2012

The Promise

I promise to myself that will be active on updating this blog. Come to think of this, I learn new things everyday which means that I must have one post per day in this blog, may it be simple or chart topping, I must journal it and post it in here. :)