Thursday, June 28, 2007

Search missing Packages With apt-file On Debian and Ubuntu

This article describes how you can search for missing packages with apt-file on Debian and Ubuntu systems. apt-file allows you to search for a file name, and it gives back the name(s) of the package(s) containing that file so that you can install the appropriate package.


NOTE:Tried this on a Ubuntu 7.04(feisty fawn)distribution in my Intel 1.6GHz machine.

*I do not issue any guarantee that same will work for you in Debian Sarge.But worth a try !

*Try out as root user as no linux distro allows another poweruser as root...:)

You all know this: you try to compile some software from the sources, and suddenly the compilation stops because it complains that some file is missing of which you have never heard before.I had a new Ubuntu PC edition running fine until i stumbled upon such messages during some installs and upgrades:

(The example is just for demonstration.Some messages masked)

root@ajith:~/avant-window-navigator-0.1.1# make
make all-recursive
make[1]: Entering directory `/root/avant-window-navigator-0.1.1'
Making all in src
make[2]: Entering directory `/root/avant-window-navigator-0.1.1/src'
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -DORBIT2=1 -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/libwnck-1.0 -I/usr/include/gconf/2 -I/usr/include/orbit-2.0 -DDATADIR=\""/usr/local/share"\" -DGNOMELOCALEDIR=\""/usr/local/share/locale"\" -g -O2 -Wall -pedantic -std=c99 -fno-strict-aliasing -fmessage-length=0 -D_FORTIFY_SOURCE=2 -MT main.o -MD -MP -MF ".deps/main.Tpo" -c -o main.o main.c; \
then mv -f ".deps/main.Tpo" ".deps/main.Po"; else rm -f ".deps/main.Tpo"; exit 1; fi
main.c:21:21: error: gtk/gtk.h: No such file or directory
In file included from main.c:25:
awn-gconf.h:69: error: expected â)â before â*â token
In file included from main.c:26:
awn-bar.h:43: error: expected specifier-qualifier-list before âGtkWindowâ
awn-bar.h:45: warning: struct has no members
awn-bar.h:48: error: expected specifier-qualifier-list before âGtkWindowClassâ
awn-bar.h:49: warning: struct has no members
awn-window.h:45: warning: struct has no members
awn-window.h:48: error: expected specifier-qualifier-list before âGtkWindowClassâ
awn-window.h:49: warning: struct has no members
awn-window.h:55: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before â*â token
In file included from main.c:28:
awn-app.h:30:29: error: libwnck/libwnck.h: No such file or directory
In file included from main.c:28:
awn-app.h:60: error: expected specifier-qualifier-list before âWnckWindowâ
awn-app.h:80: warning: struct has no members
awn-app.h:83: error: expected â)â before â*â token
In file included from main.c:29:
awn-win-manager.h:35: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before â*â token
main.c:32: error: expected â)â before â*â token
main.c: In function âmainâ:
main.c:48: error: âGtkWidgetâ undeclared (first use in this function)
main.c:48: error: (Each undeclared identifier is reported only once
main.c:48: error: for each function it appears in.)
main.c:48: error: âwinâ undeclared (first use in this function)
main.c:49: error: âbarâ undeclared (first use in this function)
main.c:50: error: âboxâ undeclared (first use in this function)
main.c:51: error: âwinmanâ undeclared (first use in this function)
main.c:52: error: âlabâ undeclared (first use in this function)
main.c:54: warning: implicit declaration of function âgtk_initâ
main.c:56: warning: implicit declaration of function âawn_bar_newâ
main.c:58: warning: implicit declaration of function âawn_window_newâ
main.c:59: warning: implicit declaration of function âgtk_window_set_policyâ
main.c:59: warning: implicit declaration of function âGTK_WINDOWâ
main.c:76: warning: implicit declaration of function âgtk_window_set_transient_forâ
main.c:79: warning: implicit declaration of function âgtk_mainâ
make[2]: *** [main.o] Error 1
make[2]: Leaving directory `/root/avant-window-navigator-0.1.1/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/avant-window-navigator-0.1.1'
make: *** [all] Error 2

So how do you know which (obviously missing) package contains that file so that you can install the package and try the compilation again? For Debian based systems (like Ubuntu) the solution is apt-file. apt-file lets you search for file names and gives back the package(s) containing that file.

2) Install apt-file

apt-file is installed as follows:

#apt-get install apt-file

After the installation, we must update apt-file's package database like this:

#apt-file update

You must also do this whenever you modify /etc/apt/sources.list.

3) Search For Packages

Now let's search for the package containing the file gtk/gtk.h. You could search like this:

#apt-file search gtk.h

but this would give back lots of packages, so let's narrow down the search by running

#apt-file search gtk/gtk.h

The output looks like this:

#root@ajith:~/avant-window-navigator-0.1.1#apt-file search gtk/gtk.h

libgfcui-dev: usr/include/gfc-2.0/gfc/gtk/gtk.hh
libgtk+2.0-directfb-dev: usr/include/directfb/gtk-2.0/gtk/gtk.h
libgtk1.2-dev: usr/include/gtk-1.2/gtk/gtk.h
libgtk2.0-dev: usr/include/gtk-2.0/gtk/gtk.h
libgtk2.0-doc: usr/share/doc/libgtk2.0-doc/gtk/gtk.html

root@ajith:~/avant-window-navigator-0.1.1#

As you see there are three packages containing gtk/gtk.h (one contains gtk/gtk.hh, another one gtk/gtk.html which is not what we are looking for), and it's now up to you to install the right one. If you are unsure, you can install all three packages, or you install one after the other and check after each one if the compilation error still occurs. In our case the right package is libgtk2.0-dev, so we install that one:

#apt-get install libgtk2.0-dev

Now we try the compilation again:

root@ajith:~/avant-window-navigator-0.1.1# make
make all-recursive
make[1]: Entering directory `/root/avant-window-navigator-0.1.1'
Making all in src
make[2]: Entering directory `/root/avant-window-navigator-0.1.1/src'
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -DORBIT2=1 -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/libwnck-1.0 -I/usr/include/gconf/2 -I/usr/include/orbit-2.0 -DDATADIR=\""/usr/local/share"\" -DGNOMELOCALEDIR=\""/usr/local/share/locale"\" -g -O2 -Wall -pedantic -std=c99 -fno-strict-aliasing -fmessage-length=0 -D_FORTIFY_SOURCE=2 -MT main.o -MD -MP -MF ".deps/main.Tpo" -c -o main.o main.c; \
then mv -f ".deps/main.Tpo" ".deps/main.Po"; else rm -f ".deps/main.Tpo"; exit 1; fi
In file included from /usr/include/gtk-2.0/gtk/gtk.h:170,
from main.c:21:
/usr/include/gtk-2.0/gtk/gtktextbuffer.h:52: warning: ISO C restricts enumerator values to range of âintâ
/usr/include/gtk-2.0/gtk/gtktextbuffer.h:53: warning: ISO C restricts enumerator values to range of âintâ
/usr/include/gtk-2.0/gtk/gtktextbuffer.h:55: warning: ISO C restricts enumerator values to range of âintâ
In file included from main.c:28:
awn-app.h:30:29: error: libwnck/libwnck.h: No such file or directory
In file included from main.c:28:
awn-app.h:60: error: expected specifier-qualifier-list before âWnckWindowâ
awn-app.h:80: warning: struct has no members
awn-app.h:83: error: expected â)â before â*â token
main.c: In function âmainâ:
main.c:52: warning: unused variable âlabâ
make[2]: *** [main.o] Error 1
make[2]: Leaving directory `/root/avant-window-navigator-0.1.1/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/avant-window-navigator-0.1.1'
make: *** [all] Error 2
root@falko-desktop:~/avant-window-navigator-0.1.1#

As you see, the initial error is now gone, but still another file is missing, libwnck/libwnck.h, so let's search for the missing package:

#apt-file search libwnck/libwnck.h

This time we're lucky, there's only one package containing that file:

root@ajith:~/avant-window-navigator-0.1.1# apt-file search libwnck/libwnck.h
libwnck-dev: usr/include/libwnck-1.0/libwnck/libwnck.h
root@falko-desktop:~/avant-window-navigator-0.1.1#

So let's install the missing package:

#apt-get install libwnck-dev

I think this handy post can help you from a lot of headaches sporting a debian distribution.


Thanks to article reference by Falko Timme ()at Howtoforge.com.Ubuntu and Canonical are registered trademarks of Canonical Ltd

Saturday, June 16, 2007

Apple's Smartphone - iPhone





















T
he long-awaited Apple iPhone, which hits store shelves on June 29, marks Apple's formal entry into the cell phone world. Steve Jobs announced the iPhone at Macworld 2007 to a frenzied reception and the handset has continued to attract wide interest since then.



iPhone combines three amazing products — a revolutionary mobile phone, a widescreen iPod with touch controls, and a breakthrough Internet communications device with desktop-class email, web browsing, maps, and searching — into one small and lightweight handheld device(also rumoured that the latest addition to gadget would be youtube). iPhone also introduces an entirely new user interface based on a large multi-touch display and pioneering new software, letting you control everything with just your fingers.



Features:



* A full iPod MP3 player with a wide screen, the iPhone also packs in a version of OS X




* True push e-mail via Yahoo Mail (plus compatibility with your office e-mail)



* A 2-megapixel cameraA 3.5-inch display with higher resolution than any current iPod.



* Only one physical controller and only a touch screen for a keypad



* Storage: 4 or 8 GB Flash memory



* Quad band GSM (GSM 850, GSM 900, GSM 1800, GSM 1900)



* WiFi (802.11b/802.11g), EDGE and Bluetooth 2.0 with EDR





Go thru the official gallery at Apple home



Apple received FCC approval for the iPhone on May 17, 2007.
The iPhone will be available in 4GB and 8GB configurations for $499 and $599, respectively, and will be carried by AT&T starting on June 29, 2007 on the US.



The logo apple and all gadgets connected with it are Copyright © 2007 Apple Inc. All rights reserved.Images used for informative purposes.

Monday, June 11, 2007

Adding a hard drive to Linux



I am chalking out a way to add a drive to a linux system.Please note that it is sporting the RedHat flavour of linux and can work with both Enterprise and Fedora versions.The entire process may contain a hardware and software configuration parts.



The physical Stuff



To add the disk drive to the system,first shut down the system, power it off and attach a new drive.For IDE drives, be sure to set the drive as master or slave as appropriate in the BIOS settings.For SCSI drives, you must select an unused SCSI id for the new device and ensure proper termination of SCSI bus to which the drive will be attached.When the system is powered up, watch the output from the kernel during its initialization.If you dont see any references to the new drive, check /var/log/mesg once the system has booted.If the drive doesn't show up there, try restarting the system and checking the system BIOS.The drive may not be recognized there.



The command stuff



Once recognized,run fsck or one of its variants to create the partitions you need.If the partition is going to be a swap partition, change the partition id type to 0x82



Once the partition table on disk is modified, it may be necessary to also update the in-memory copy of the partition table.Use the partprobe command to do this.



Use mkfs(for help #man mkfs) to create filesystems on each of your new,non-swap, partitions.Swap partitions are marked with mkswap.Take into consideration the intend to use the filesystem labels to mount the filesystem later.Specify them using the -L option.Another way to label a disk is the e2label command.



Related issues



Create any needed mount points in your current filesystem hierarchy.Keep in mind that directories used as mount points need not be empty,but any files in the directory are temporarily unavailable when a filesystem is mounted on that mount point.



Add entries for the new filesystem to /etc/fstab.Check these entries with mount manually before you reboot.This will not only make filesystem management simpler, but will call the system initialization scripts to mount, check and provide information to other utilities like the dump



Checklist of files are:



1) /etc/fstab

2) /etc/mtab

3)/proc/partitions



Also refer these links as additional reference:



http://www.skullbox.net/newsda.php

http://www.yolinux.com/TUTORIALS/LinuxTutorialAdditionalHardDrive.html





The articles on filesystems management are on open domain and for reference



Powered by ScribeFire.