Data recovery Linux tools

Posted on


Data recovery is an essential part of computer usage. Data recovery tools come very handy while helping you out with your system files and resources. Data backup and recovery are very important if you’re looking to maintain the sanctity of your files. Because. anything could happen, your hard drive may crash, malware attack may erase your important data, anything! Therefore it’s ideal your data is properly backed. Here are 8 open source tools to recover your data.

1. Knoppix

Knoppix is one of the most poular recovery software available for Linux platform. It comes as bootable CD version with list of GNU/Linux software. Knoppix can auto detect the hardware and optimize the recovery tool by itself. Since it comes as bootable CD, you can use it as Linux demo, educational CD, rescue software or even a platform for commercial software product demos.

2. Trinity Rescue Kit

This is a free live Linux distribution that helps user to recovery and repair operations on Windows PCs. However it can be used as it is on Linux systems also. Trinity Rescue Kit v3.4 and later have user friendly interface with scrollable text menu. Anybody can easily use TRK to perform system maintenance and repair tasks such as password reset, disk cleanup to virus scanning on PC.

3. Avira Rescue System

This open source application can access the computer data of a damaged hard drive. It is possible to repair a damaged system, to rescue data or scan the system for viruses using Avira Rescue System. You can burn the software package on CD/DVD and use it to boot the computer.

4. GParted Live

This is a small Linux distribution designed for x86 based computers. It packs all the features of latest GParted apps. You can create a bootable CD, USB or PXE Server to boot GParted Live. GParted Live supports array of filesystem hence, it can be used to recover the damaged partition.

5. System RescueCd

This is a Linux system rescue disk with number of bootable recovery software. You can easily carry out most admin tasks on computer like creating and editing hard disk partitions, clearing memory cache etc. RescueCd packs number of Linux software, system tools, basic tools etc. It can be booted from CD/DVD or USB stick. RescueCd kernel supports all major file systems for Linux.

6. Ubuntu Rescue Remix

This is a robust yet lean system for recovery software, data recovery and forensics. Ubuntu Rescue Remix uses terminal commands UI for operations. This is the best bet for systems with low hardware configuration. The command line environment features all the functions of powerful data recovery software. It has a unique tool called ddrutility, which identifies files affected by unrecoverable blocks on disk image.

7. F-Secure Rescue CD

This data recovery tool is based on Knnopix derivative of Linux OS, which lets user run the software completely from a CD and check integrity of installed applications. It is possible to perform advance data repair and recovery using F-Secure Rescue CD. This tool is capable of recovering the system from malware infections. However, this tool cannot scan the encrypted hard drive.

8. Ddrescue

This data recovery tool from GPU comes very handy in copying data from one file or block device to another. Ddrescue can detect the memory errors, dead blocks, log file as well as rescue the good part of it. It operates automatically. If read error occurs, it automatically rescues the data. You can always terminate any automatically triggered operation in Ddrescue. The basic operation of Ddrescue remains fully automatic.

Reduce PDF file resolution in Ubuntu

Posted on


Reduce PDF file resolution in Ubuntu

Open Terminal in ubuntu and type following command

 

Make a much smaller PDF. Note that images will be quite ugly.

gs -sDEVICE=pdfwrite -dPDFSETTINGS=/screen -dCompatibilityLevel=1.4 -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

The PDF will be a bit smaller. Images remain in good quality.

gs -sDEVICE=pdfwrite -dPDFSETTINGS=/printer -dCompatibilityLevel=1.4 -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

Replace input.pdf with file name and path of your PDF file

Koha instances Administer command

Posted on


koha-create

Create a new Koha instance.

koha-create [--create-db|--request-db|--populate-db] \
     [--marcflavor marc21|normarc|unimarc] \
     [--zebralang en|nb|fr] \
     [--defaultsql /path/to/some.sql] \
     [--configfile /path/to/config] [--adminuser n] instancename

Simple example, with MySQL running on the same server as everything else:

sudo koha-create --create-db instancename

Order of precedence for config options, from lowest to highest:

  1. The defaults set in koha-create itself
  2. /etc/koha/koha-sites.conf
  3. Config file specified with –configfile
  4. Individual options set with –marcflavor, –zebralang, –defaultsql, –adminuser

See Koha 3.2 on Debian Squeeze for further details.

koha-disable

Disable a Koha instance.

koha-disable instancename

koha-enable

Enable a Koha instance. New instances are enabled by default. You only need this command if you have previously disabled a site with koha-disable.

koha-enable instancename

koha-restore

Restore a Koha site from a dump (from koha-dump).

koha-restore sqldump configdump

koha-dump

Dump all contents and configs for a Koha site right now.

koha-dump instancename

koha-run-backups

Performs backups of the koha installations on the system

This allows automation of backing up the koha data and configuration to the filesystem. It will keep the past so many backups, discarding older ones.

Options:

   --output:   the directory that the resulting files will be placed into.
               (default: /var/spool/koha)
   --days:     the number of days to keep backups around for
               (default: 2)

Note: backups produced using this tool can be restored using \`koha-restore’.

koha-remove

Remove a Koha instance.

koha-remove instance1 instance2 etc

Zebra-related

koha-start-zebra

Start Zebra for named Koha instances.

koha-start-zebra instance1 instance2 etc

koha-restart-zebra

Restart Zebra for named Koha instances.

koha-restart-zebra instance1 instance2 etc

koha-rebuild-zebra

Rebuild the Zebra database for a Koha instance.

koha-rebuild-zebra [-u|--usmarc] [-f|--full] [-...] instance1 instance2 etc
  • -u: runs the process as USMARC rather than the default of MARCXML
  • -f: does a reindex of the whole collection
  • -…: anything else is passed directly to rebuild_zebra. This is useful in particular for -v.
  • koha-rebuild-zebra currently only has the ability to do both bibs and authorities at the same time – you cannot do authorities alone.

As an example, a full, verbose reindex for one instance would look like this:

 sudo koha-rebuild-zebra -f -v  instancename

koha-stop-zebra

Stop Zebra for named Koha instances.

koha-stop-zebra instance1 instance2 etc

E-mail

koha-email-enable

Turn on the email for a Koha instance.

koha-email-enable instance1 instance2 etc

koha-email-disable

Turn off the email for a Koha instance.

koha-email-disable instance1 instance2 etc

Database-related

koha-dump-defaults

Create default contents from an existing Koha site.

koha-dump-defaults instancename

koha-upgrade-schema

Upgrade the DB schema for Koha instances. Done automatically on package upgrades.

koha-upgrade-schema instance1 instance2 etc

koha-reset-passwd

Reset password for a user in a Koha instance.

koha-reset-passwd instancename username

koha-mysql

Provide an interactive mysql shell set up for the specified koha instance.

koha-mysql instancename

To send some SQL to MySQL and get an answer back, without going into an interactive session (similar to the -e option to the mysql command):

echo "some sql" | koha-mysql instancename

(This command is new in Koha 3.6.)

Misc

koha-upgrade-to-3.4

Performs the necessary changes to upgrade a Koha system from 3.2 to 3.4.

koha-upgrade-to-3.4 [instance1] [instance2] [...]

If no instance names are provided, this will run it on all of them.

Utilities

These are scripts that are used by other scripts, you probably do not want to run them from the command line.

koha-create-dirs

Create dirs for a Koha instance.

koha-create-dirs instance1 instance2 etc

koha-list

List all Koha instances.

Lists Koha instances, optionally only those that are enabled or have
email turned on.

Usage: koha-list [--enabled] [--email] [-h]
Options:
   --enabled       only show instances that are enabled
   --email         only show instances that have email enabled
   --noemail       only show instances that do not have email enabled
   -h              this help

The filtering options can be combined, and you probably want to do this
(except --email and --noemail, that's just silly.)

koha-foreach

Run a command for each Koha instance.

Takes the same arguments as koha-list.

koha-list [--enabled] [--email | --noemail] command

Sorce: http://wiki.koha-community.org/wiki/Commands_provided_by_the_Debian_packages 

Resmastersys in Ubuntu 12.04

Posted on


Remastersys in Ubuntu 12.04As root – issue

'sudo su' 

in the terminal window prior to the following command.

wget -O - http://www.remastersys.com/ubuntu/remastersys.gpg.key | apt-key add -

sudo gedit /etc/apt/sources.list

Add the following line

#Remastersys Precise
deb http://www.remastersys.com/ubuntu precise main

Now open the terminal and type

sudo apt-get update && sudo apt-get install remastersys remastersys-gui

Screenshot of Remastersys after Installation
 



Using Remastersys

In order to learn how you can use remastersys, run

sudo remastersys

remastersys Syntax

sudo remastersys backup|clean|dist [cdfs|iso] [filename.iso]

remastersys Examples

1) to make a livecd/dvd backup of your system

sudo remastersys backup

2) to make a livecd/dvd backup and call the iso custom.iso

sudo remastersys backup custom.iso

3) to clean up temporary files of remastersys

sudo remastersys clean

4) to make a distributable livecd/dvd of your system

sudo remastersys dist

5) to make a distributable livecd/dvd filesystem only

sudo remastersys dist cdfs

6) to make a distributable iso named custom.iso but only if the cdfs is already present

sudo remastersys dist iso custom.iso

cdfs and iso options should only be used if you wish to modify something on the cd before the iso is created. An example of this would be to modify the isolinux portion of the livecd/dvd

Creating An ISO Image

To create an iso image of your installation, simply run

sudo remastersys dist

This will create an iso image called customdist.iso in the /home/remastersys directory. The dist option makes that your personal folder (e.g. /home/ruchi) will not be included in the iso image. You might have to insert your Ubuntu installation CD during the process.

This is how the end of the process looks:

[…]
92.16% done, estimate finish Wed DEC 28 15:31:25 2007
93.39% done, estimate finish Wed DEC 28 15:31:25 2007
94.62% done, estimate finish Wed DEC 28 15:31:24 2007
95.85% done, estimate finish Wed DEC 28 15:31:24 2007
97.08% done, estimate finish Wed DEC 28 15:31:25 2007
98.31% done, estimate finish Wed DEC 28 15:31:25 2007
99.54% done, estimate finish Wed DEC 28 15:31:25 2007
Total translation table size: 2048
Total rockridge attributes bytes: 3950
Total directory bytes: 9094
Path table size(bytes): 54
Max brk space used 0
406890 extents written (794 MB)

/home/remastersys/customdist.iso is ready to be burned or tested in a virtual machine.

Check the size and if it is larger than 700MB you will need to burn it to a dvd

796M /home/remastersys/customdist.iso

Clean Up

After you’ve burnt the iso image onto a CD/DVD, you can run

sudo remastersys clean

to remove all temporary file created during the iso generation as well as the /home/remastersys directory

Koha package installation on Ubuntu 12.04

Posted on


There are three ways to install Koha: packages, git and tarball. These instructions focus on the packages installation. The packages method of installation is the recommended method. Packages effectively do most of the difficult work.

Pre-Installation Setup

Notation

Lines beginning with # or $ mean the suffix is a command that should be executed on the shell. That is, the part after given prompt. Don’t type or copy the # or $ part. For instance:

 

 

$ sudo su -

Koha is released monthly, so keeping documentation up to date is difficult. Rather than saying 3.8.1, 3.8.2, 3.8.3, 3.8.4, or any other specific number, the convention is to replace the last number with an x. For example, the current version is part of the 3.8.x series and the former stable version is the 3.6.x series.

Install Ubuntu

Download and install Ubuntu from the official site.

To keep your Koha installation minimal and to free resources for running, the Server edition is recommended, though the Desktop edition will work as well.

As Apache and MySQL will be installed in the instructions later, there is no need to select any extra packages during the installation of Ubuntu.

Add A Koha Community Repository

With the installation of Ubuntu done, you will need to tweak your repositories to install perl libraries which may not exist in the default Ubuntu repositories. So before we start, let’s do:

$ sudo ls

This prevents the next command from looking like it hung when it is actually waiting for a password. Now, let’s get the signing key:

$ wget -O- http://debian.koha-community.org/koha/gpg.asc | sudo apt-key add -

To install the repository for the latest stable release, which is recommended, use the following command:

$ echo deb http://debian.koha-community.org/koha squeeze main | sudo tee /etc/apt/sources.list.d/koha.list

There are currently three active repositories: oldstable, squeeze, and squeeze-dev. As of 2012-09-09, they represent 3.6.x, 3.8.x, and master respectively. This will change when 3.10.x is released. They will represent 3.8.x, 3.10.x, and master respectively.

To install the repository for the 3.8 release, which is recommended, use the following command:

echo deb http://debian.koha-community.org/koha oldstable main | sudo tee /etc/apt/sources.list.d/koha.list

It is important to note that when 3.10.0 is released, there will be no repository available for 3.6.x as 3.8.x will be moved to oldstable. This type of change happens roughly every 6 months.

If the latest version of Debian is no longer squeeze, please confirm these instructions on the mailing list or IRC channel.

Update Ubuntu

Now that you have added the appropriate repository, check to make sure Ubuntu is up to date. You may be prompted for the password of the user account you are signed in as.

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get clean

This process, particularly the upgrade step, may take a while.

Installation Method

At this point, we are doing a packages installation. It will simplify installation and upgrade steps later. If development and patching will be done, consider using a git installation. For historical purposes, there is a tarball installation method as well.

Download the latest Koha release

Do the following command:

$ sudo apt-get install koha-common

Pre-Web Install Setup

Initial Configuration

To configure your server for use with DNS names: After install, edit /etc/koha/koha-sites.conf with details about your site. You may need to create this file. Some example content would be:

DOMAIN=".framisdooby.org"  # Change this to be your domain. Any instance will be a subdomain of this string.
INTRAPORT="80"  # TCP listening port for the administration interface
INTRAPREFIX=""  # For administration interface URL: Prefix to be added to the instance name.
INTRASUFFIX="-intra"  # For administration interface URL: Suffix to be added to the instance name.
DEFAULTSQL=""  # a value is generally not needed.
OPACPORT="80"  # TCP listening port for the users' interface (if you skip this, the apache default of 80 will be used)
OPACPREFIX=""  # For users' interface URL: Prefix to be added to the instance name.
OPACSUFFIX=""  # For users' interface URL: Suffix to be added to the instance name.
ZEBRA_MARC_FORMAT="marc21"  # Specifies format of MARC records to be indexed by Zebra. Possible values are 'marc21', 'normarc' and 'unimarc'
ZEBRA_LANGUAGE="en"  # Primary language for Zebra indexing. Possible values are 'en', 'fr' and 'nb'

Next, you will need to enable the Apache mod_rewrite module:

$ sudo a2enmod rewrite

Instance Creation

Now you need to create your first koha instance. This instance will need a database. It can be external or local. If you are uncertain, do a local installation.

If you will have a local database install mysql-server:

$ sudo apt-get install mysql-server

Replace “library” with the name of your library. If you want to have library.framisdooby.org, then instancename can probably be “library“. Then use the following command to create a local database to create an instance called library:

$ sudo koha-create --create-db library

If you will be using an external database refer to the documentation

Ubuntu MySQL Security Tweak

There is a security risk in Ubuntu’s MySQL default set up. Type the following commands:

$ mysql -u root -p
> USE mysql;
> SELECT host,user FROM user;

Under Ubuntu, newer versions of MySQL include anonymous connections. This is a security risk. They are listed with no username. Continue entering MySQL commands.

> DELETE FROM user WHERE user='';
> SELECT host,user FROM user;

The anonymous connections should be removed now. Continue entering MySQL commands.

> FLUSH PRIVILEGES;
> QUIT

The anonymous connections are removed.

Configuring Apache

Setup Default Ports

Then type the following command:

$ sudo nano /etc/apache2/ports.conf

Make sure there is an uncommented line like this in the ports.conf file:

Listen 80

Remember you chose an OPAC prefix or suffix and an Intranet prefix or suffix in an earlier step. This is how port 80 knows which files to access, because it uses named virtual hosts.

Make sure the NameVirtualHost line is uncommented like the following:

NameVirtualHost *:80

Disable or Edit Default Site

If the default site is not needed:

$ sudo a2dissite 000-default

Now, skip to the next section.

If there is more than just one Koha website on this machine, you may wish to:

$ sudo nano /etc/apache2/sites-enabled/000-default

And change the port number it uses:

<VirtualHost *:4080>

Enable Modules and Site

Now enable the apache modules this config needs, enable koha’s configuration, and restart apache. Replace “library” with the name of your library that you used in the “Instance Creation” section when you ran koha-create..

$ sudo a2enmod rewrite
$ sudo a2enmod deflate
$ sudo a2ensite library
$ sudo /etc/init.d/apache2 restart

Determining an IP Address

Assumptions

In a home or corporate LAN, it is quite likely that your network setup has been configured with DHCP. If you are being hosted externally however, your machine likely has been given a static IP address, or it may be behind a reverse proxy. Because of the many possible complex configurations of networking involved, these instructions will attempt to guide you in the former simpler case. If you are unable to get to the Web Installation step, please consult your system administrator, network administrator, or IT Department. We are unable to assist everyone with their networking configurations.

Private IP Addresses

The following IP ranges will not be available via the Internet:

  • 10.0.0.0 – 10.255.255.255
  • 172.16.0.0 – 172.31.255.255
  • 192.168.0.0 – 192.168.255.255

Also, IP addresses in the range of 169.254.0.0 -169.254.255.255 are reserved for Automatic Private IP Addressing.

If you have a computer on the same network (as in the general home or corporate LAN scenario), you can use a nice graphical browser and the IP Address we determine to run the web install steps, and use Koha afterwards. If you have a hosted site with a fully qualified domain name, you may be able to use that. Otherwise, your scenario requires assistance from your hosting provider or network administrator. Regardless, the instructions as given and written will work to set up Koha.

Determine Address

Determine if there is at least one network card in it. Type the following:

$ sudo ifconfig

This should give output like:

eth0      Link encap:Ethernet  HWaddr 08:00:27:14:22:6c
          inet addr:192.168.69.38  Bcast:192.168.69.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe14:226c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:24087 errors:0 dropped:0 overruns:0 frame:0
          TX packets:29550 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2968198 (2.9 MB)  TX bytes:4828089 (4.8 MB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:11 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:3794 (3.7 KB)  TX bytes:3794 (3.7 KB)

In this example, there is “eth0” and “lo”. “lo” is not accessible from another machine. “eth0” has an “inet addr” (IP Address) of “192.168.69.38”.

If this IP address was not listed in the private IP addresses section above, it may be possible to use it as well. So when the web install steps are reached, instead of installing lynx and using it, Firefox (or any other browser) can be used from another machine by typing “http://&#8221; plus the name you have set for the intranet client (staff client) into the address bar. This is an external address. Attempt external addresses before private ones.

This example has a private IP address: “192.168.69.38”. So when the web install steps are reached, instead of installing lynx and using it, Firefox (or any other browser) can be used from another machine on the same network by typing “http://library-intra.framisdooby.org/” into the address bar. This is because you will have put the address (eg. 192.168.69.38) and the fully qualified domain name into the /etc/hosts file of that other machine. If there is more than one network card (e.g. eth1, eth2, etc.), attempt the IP Addresses in order until you have success or all fail. A typical failure is some sort of “time out” page. Eventually, you may just have to do a local install using 127.0.0.1, because other machines could not reach it.

Tweak Hosts File

The default configuration for the packages installation is based on fully qualified domain name set up. Since your fully qualified domain name may not be active yet, edit the /etc/hosts file to include it:

$ sudo nano /etc/hosts

Add at the bottom, and the address you determined and what should be the fully qualified domain name. For example:

127.0.0.1		library.framisdooby.org
127.0.0.1		library-intra.framisdooby.org

If you were able to determine an IP address in the previous step, edit the other machine’s /etc/hosts file with that IP address instead of 127.0.0.1.

Fully Qualified Domain Name

If you are hosted and you happen to know the fully qualified domain name (e.g. library-intra.frammisdoobie.org), you can attempt “http://library-intra.frammisdoobie.org:80/“. This should not fail, if you have put the correct information into the hosts file.

Web Installation

Now you can visit your admininstration website to continue with the Koha web installer.

The username to log in with will be koha_library and the password will be near the end of /etc/koha/sites/library/koha-conf.xml, where library is the instance name used by the koha-create command in the Instance Creation section. Make sure to replace library with your instance name. You will need to be root to view this You could also use this command:

$ sudo xmlstarlet sel -t -v 'yazgfs/config/pass' /etc/koha/sites/library/koha-conf.xml

to print it out.

Do this by navigating to your staff client page. The INTRAPREFIX, instance name, and INTRASUFFIX you used followed by the DOMAIN, a colon, and the INTRAPORT you gave in the Initial Configuration section make up the url. For example: http://library-intra.framisdooby.org:80

If you do not know how to do this, try installing lynx:

$ sudo apt-get install lynx
$ lynx http://library-intra.framisdooby.org:80

Lynx navigational keys include: tab to go between fields, enter (when not on text fields) to toggle or click, space to change pages (when not on text fields), Q to quit (when not on text fields). Arrows also work.

Web Installer Step 1

Choose Language

Use en for English.

Click Next

It will check to make sure all dependencies are installed. You will have to install all items listed here, before you can continue.

It should say: All dependencies installed.

Click Next.

Web Installer Step 2

This shows the Database Settings. All of the entries listed on this page were given to it when you ran the file Makefile.PL.

Click Next

It will check to make sure it can connect to mysql, that the kohadata database exists, and the user koha has all of the required privileges on the database kohadata.

It should say:

Connection established.

Database kohadata exists.

User koha has all required privileges on database kohadata.

Click Next.

Web Installer Step 3

We are now ready to create the database tables and fill them with some default data.

Click Next.
It should say:

Success

*Database tables created

Click Next.

We are ready to do some basic configuration. Please install basic configuration settings to continue the installation.

Click on the link install basic configuration settings.

Select your MARC flavour.

Select Marc21.

Click Next.

Select Default Settings.

(Select everything, if you are testing.)

You may find it helpful to select all of the optional MARC frameworks.

The one option that would be better to leave unchecked and to setup yourself in Koha is (sample_libraries). It adds about 10 sample libraries to koha. It is easy to enter your Library’s information in Koha and you will need to do that anyway.

Click Import.

It shows a list of items added and will report any errors here as well.

Click Finish.

Congratulations , Setup Complete.

Your page will be redirected ot the login page after completing installation.

Setup Your Library in Koha

After the web install, you should be redirected to the staff client login screen.

Login with koha user name and password.

Click on the More dropdown menu.

Select Administration.

Select Libraries, branches and groups under the “Basic Parameters” heading.

Click New Library and enter your information into the form.

Click Submit.

Your Library is now setup in Koha.

Base Install Finished

The staff client, or administrative page, can be accessed at:

http://{INTRAPREFIX}{InstanceName}{INTRASUFFIX}{DOMAIN}:{INTRAPORT}

The OPAC, or client page, can be accessed at:

http://{OPACPREFIX}{InstanceName}{OPACSUFFIX}{DOMAIN}:{OPACPORT}

Where the values of {DOMAIN}, {INTRAPORT}, {INTRAPREFIX}, {INTRASUFFIX}, {OPACPORT}, {OPACPREFIX}, and {OPACSUFFIX} were defined in the Initial Configuration step, and {InstanceName} was defined in the Instance Creation step, though the example given said library.

You should now have a functional Koha Installation

Upgrade Instructions

If you are running in another language other than English, please switch to English before doing the upgrade, the templating system has changed and the templates will need to be regenerated. Once you have upgraded, please regenerate your templates in your chosen languages.

$ sudo apt-get update
$ sudo apt-get upgrade

This should generally upgrade your koha-common. However, in special cases, you may have to:

$ sudo apt-get dist-upgrade

Because the dependencies for koha have increased.

Koha 3.4.x or later no longer stores items in biblio records. If you are upgrading from a version older than Koha 3.4.x, run the following command which may take a long time (several hours) to complete for large databases: koha-upgrade-to-3.4

It is always safest to run a full reindex after an upgrade, where {instance} is the name of your instance:

$ koha-rebuild-zebra -v -f {instance}

Uninstall Instructions

The package installation method is unique in that a removal command is already provided. Determine what instances you have:

$ koha-list

And then for each instance:

$ sudo koha-remove {instance}

If you encounter any problems, please request help on the mailing list or IRC channel.

After uninstalling all the instances, uninstall the koha-common package:

$ sudo apt-get remove koha-common

Source : http://wiki.koha-community.org/wiki/Koha_on_ubuntu_-_packages

Koha 3.02.01 installation on Ubuntu 10.10 Desktop

Posted on


Installation of Koha 3.02.01 on Ubuntu 10.10

Click On Application —Accessories—Terminal:
Open a Command Terminal and type following commands,

All commands must executing the following command, (must work as root)
sudo su
Update your system,
sudo apt-get update

Creating Koha system user

groupadd koha
useradd -g koha koha
sudo mkdir /build
sudo chmod -R 777 /build
cd /build
wget http://download.koha-community.org/koha-3.02.01.tar.gz
tar zxvf koha-3.02.01.tar.gz
Installation of dependencies
sudo apt-get install zip unzip lamp-server^ yaz idzebra-2.0 dselect
sudo dpkg –set-selections <install_misc/ubuntu.packages
sudo dselect
Installation of Perl dependencies
apt-get install libmarc-crosswalk-dublincore-perl libhtml-scrubber-perl libalgorithm-checkdigits-perl libbiblio-endnotestyle-perl
apt-get install libemail-date-perl libyaml-perl libjson-any-perl libxml-writer-perl libxml-sax-writer-perl
We have to install certain dependecies using CPAN,
sudo cpan
Accept all default settings.
Enter the following command in the CPAN prompt,
install HTTP:OAI IPC::Cmd Text::CSV::Encoded
quit

Configuration of UTF-8 in MySQL and Apache
Enable UTF-8 at MySQL
Open a Terminal and type following command,

sudo gedit /etc/mysql/my.cnf
[Under the Basic settings section, add the following,]

# UTF-8 Defaults for Koha
init-connect=’SET NAMES utf8′
character-set-server=utf8
collation-server=utf8_general_ci
Save the file and close the editor.
UTF-8 encoding in Apache
Open a terminal and type the following command,

gedit /etc/apache2/conf.d/charset
[Add the following two lines in]

AddCharset UTF-8 .utf8
AddDefaultCharset UTF-8
Save the file and close the editor.

Creation of MySQL Database for KOHA
Open a terminal and login as root and enter following commands,

mysql -u root -p
[enter mysql root password here]

Then type,

create database koha;
grant all privileges on koha.* to ‘kohaadmin’@’localhost’ identified by ‘library’;
flush privileges;
quit;

Setting environment variables

gedit /etc/bash.bashrc.local
Add the following lines there,

export KOHA_CONF=/etc/koha/koha-conf.xml
export PERL5LIB=/usr/share/koha/lib

Save and close the file.
Koha Installation
Now KOHA can be installed by following commands:
Enter into Koha folder

cd /build/ koha-3.02.01
perl Makefile.PL
Answer all questions without any change. Default values are accepted for us.

Type the following commands,

make
make test
sudo make install

Add the following lines to /etc/apache2/ports.conf, just below the following line Listen 80
Open a Command Terminal and type following commands

sudo gedit /etc/apache2/ports.conf

Listen 80
Listen 8080

save the file and close.

Open a terminal and login as root
sudo su
ln -s /etc/koha/koha-httpd.conf /etc/apache2/sites-available/koha
sudo a2enmod rewrite
sudo a2ensite koha
/etc/init.d/apache2 restart

Zebra configuration
Open a terminal and login as root
sudo ln -s /usr/share/koha/bin/koha-zebra-ctl.sh /etc/init.d/koha-zebra-daemon
sudo update-rc.d koha-zebra-daemon defaults
sudo ln -s /usr/share/koha/bin/koha-zebraqueue-ctl.sh /etc/init.d/koha-zebraqueue-daemon
sudo update-rc.d koha-zebraqueue-daemon defaults
Edit the following files,
sudo gedit /usr/share/koha/bin/koha-zebra-ctl.sh
sudo gedit /usr/share/koha/bin/koha-zebraqueue-ctl.sh

Change USER and GROUP to root. Result is,
#!/bin/bash
USER=root
GROUP=root
Set following folders ownership to Koha user
sudo chmod -R 777 /var/lock/koha
sudo chown -R koha:koha /var/lock/koha
sudo chmod -R 777 /var/lib/koha/
sudo chown -R koha:koha /var/lib/koha
Cronjob Settings
sudo su
cd /usr/share/koha/bin/cronjobs
crontab -u root crontab.example
crontab -u username crontab.example [Username denotes name of your home user]
crontab -e

Change the locations in following lines ,

#Environment
PERL5LIB=/usr/share/koha/lib
KOHA_CONF=/etc/koha/koha-conf.xml

#Some additional variables
KOHA_CRON_PATH=/usr/share/koha/bin/cronjobs

Save the file by pressing ctrl+o buttons
Press enter
Quit the editor by pressing ctrl+X buttons
Some settings for Apaache,
sudo gedit /etc/koha/koha-httpd.conf
Find the following line,
## OPAC

Change the port number
## OPAC

Find this line too,
## Intranet

Change to
## Intranet

Add the following line at the end of the file,
ServerName localhost
Restart the Apaches server,
sudo /etc/init.d/apache2 restart
Run the Web installer

http://127.0.0.1:8080

URL of OPAC is http://127.0.0.1:8001 or localhost:8080 or your local machine IP:8080
User name : kohaadmin
Password: library