Tuesday, 21 January 2014

Amazon Linux (Red Hat) and the Yum Repository

Now that I had given up on Debian Squeeze, I needed to find a different AMI, and to follow the same steps again up to the point where I try again to access it.

I choose another Linux AMI. I decided to go with Amazon Linux. I decided this as I knew the user name for this AMI, so I hoped this would not be a problem to access, and as my research had told me Koha will work on any Linux based server. I also figured that Amazon Linux would have the most support (especially in the form of user guides) from Amazon, since they put their name on it.

Once I had launched this instance on AWS (which took all of ten minutes, thanks to my previous experience), I again followed the instructions for accessing via PuTTY, and this proved no difficulty.

Now I had access to the my server through the command interface. This was a Woo hoo! moment, however short lived... I went back to the video I had found, which promised Koha in 11 Minutes (11 minutes which I was currently at least 4 hours into...). Although this video was based upon Debian Squeeze, I assumed I could work around any issues, as the two platforms are both Linux based, and so should be fairly similar.

The next problem to solve was to download and install Koha itself. Both the video and the instructions from Koha community tell you to add the Koha community repository by adding the line

deb http://debian.koha-community.org/koha squeeze main

to the file

/etc/apt/sources.list.d/koha.list

I tried this using the nano text editor, but found that there wasn't even a folder /etc/apt. Probably just a difference between Debian Squeeze and Amazon Linux, I thought. I tested out what the next step would do without having the repository added, and typed the command

$ sudo apt-get install koha-common

It, unfortunately, did not install Koha. In fact, it didn't even know what apt-get was. Neither did I, so I did some more research. To quote Wikipedia,

"The Advanced Packaging Tool, or APT, is a free user interface that works with core libraries to handle the installation and removal of software on the Debian GNU/Linux distribution and its variants."

"Amazon Linux is Linux based," I thought. "So why isn't working?" I had had enough by now, being that it was 11pm, and I had to get up at 5.30 in the morning, but was determined to have Koha at least installed. I decided to phone a friend (not literally), and I asked my husband. He said that I should look to see if I can find out what the package manger is for Amazon Linux, as it may be different. So, back to Google.
I searched for "Package manager Amazon Linux," and found this handy page. The package manager for Amazon Linux is Yum. I went back to my command line again, and now typed in

$sudo yum install koha-common

It didn't work. It said something along the lines of can't find Koha Common, which was about what I expected. I did some Googling to find out how to add a repository to yum, but the instructions I found made no sense with the information I had (yum configuration needs a lot more details to add a repository, and they're structured completely differently). As it turns out, yum is not the same as apt at all, though they fulfill the same purpose. Basically, Debian-based Linux distributions use apt and Red Hat-based Linux distributions use yum. Koha is only available either as a totally manual installation or as a Debian repository. Koha was not going to work on Amazon Linux. It was time to start over. Again.

I learned that sometimes, especially at 11pm, you need to ask for somebody to talk it through with, and you need a lot of perseverance to do something complicated on a totally unfamiliar system. I also learned that, although I had thought ahead, maybe I should have investigated this version of Linux, and consulted the Community Pages, which had no instructions for Amazon Linux, and instead chosen one that I had specific instructions for, instead of trying to merge the two. The last thing I learned is to not assume. I had made the mistake of assuming that two operating systems would be mostly compatible because they were both called Linux.

No comments:

Post a Comment