Showing posts with label package. Show all posts
Showing posts with label package. Show all posts

Friday, May 23, 2014

How to build a debian package from source?

1. download the source from the repository

 $apt-get source    Ex. $apt-get source scimsource

 This command will fetch the source code of the package you specified in , which will contain .dsc, .orig.tar.gz, sometimes .diff.gz.

2. Apply changes/differences with the original source

[Assume that I downloaded the packages under ~/Download/scimsource.]

$cd ~/Download/scimsource

apply the diff (changes) to the orig source by

$dpkg-source -x .dsc

[For further details about unpacking debian source you can refer this crisp & simple howto.]

Now, the changes will be applied to the source. 

3. Build/Compile the source to build installable deb package.

   a)  If you want to add some changes in the source code or add some features to the existing source code proceed with the extracted source & then update the Changelog* file accordingly. 
  b) If your aim is just to build the deb package from the source you need not to touch the Changelog file.

For building the source to deb package you need to

  i). Build dependency

  $sudo apt-get build-dep

  This command will install the needed libraries, other packages that are
  essential for compiling/building the source into deb.

  ii). Build the source by,


  $sudo dpkg-buildpackage -rfakeroot -us -uc -sa

Note:  you must issue the above command provided that you are inside the package's source directory. (first do $cd ~/Download/scimsource/scim).



* -> changelog file will be available in the extracted source under "/debian/Changelog"



Tuesday, February 25, 2014

How to solve "Package gtk+-3.0 was not found" & "fatal error: gtk/gtk.h: No such file or directory" errors in Linux

As of now some of the Linux distros don't come up with the gtk-3.0 libraries and development files by default.   Though Gnome application developers are asked to migrate to gtk3, most of the desktop applications are still in gtk2.  Due to these reasons gtk3 development files are not pre bundled with distros.  So, we have to install gtk3 development files, libraries manually to compile a gtk+-3.0 based GUI applications.

If your gtk3 program compilation ($gcc -o executable_name  program_name  `pkg-config --cflags --libs gtk+-3.0`) throws error something like this

Package gtk+-3.0 was not found
            (or)
fatal error: gtk/gtk.h: No such file or directory

which means your machine is not installed with the gtk3 development files.  
To install the package in debian based machines 

$sudo apt-get install libgtk-3-dev

To install in rpm based machines

$yum install gtk3-devel

After the successful installation your machine should return output something like following while you execute the command 
"sudo pkg-config --cflags --libs gtk+-3.0"

"-pthread -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/libpng12  -lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lgobject-2.0 -lglib-2.0 
"

Now, you can compile your gtk3 programs happily... :)

Thursday, November 1, 2012

how to view all the uninstalled packages in a debian based linux?

dpkg - > is a debian package manager command
dpkg -l - > will list all the packages with their status installed/deinstalled/removed/half-installed etc

The first 2(actually 3) letters of the output of " dpkg -l " command are significant to us, because it tells the current state of the package.  if it is
ii  - installed
rc - removed but configuration files are kept
So, " $dpkg -l | grep ^rc "
will display all the package that are removed but configuration files are still kept.

Note: if you purged configuration files of a package during removal using
"apt-get remove --purge < package_name >" then those packages will not be displayed.

For more information about dpkg :
i) man dpkg
ii) dpkg -l - > Read the first 4 lines ;-)
iii) Read this http://linuxprograms.wordpress.com/2010/05/11/status-dpkg-list/

Thursday, October 25, 2012

How to install a specific version of a debian package?

Some times the debian package version which is installed in your linux box (say foo-package-x.y.xy ) is different from what version you really want(say foo-package-y.x.yx).  Assume that both the versions are available in the repository.  So, how we install the exact version we needed..? Here comes the solution, from terminal issue the following command,

$sudo apt-get install foo-package=y.x.yx
Replace the foo-package with your packagename, y.x.yx with the version (name)number you need.  Now, the package with the given version will be installed.

If you want to see all the available versions of particular debian package in the repository.. do the following,
$sudo apt-get update 
The above command updates the package index of your machine with the repository.
$sudo apt-cache show <package-name>
The above command shows the details of package, where we find version details also.

Want to install linux debian packages without internet connection..? check this out

Monday, July 4, 2011

When a new package installed.., What are the files installed & where they are?


In Debian linux(which uses apt-get & dpkg for package mangement) we can find out what are the files
get installed when a new package installed into your system. There are two ways to do this.

GUI Way:
System -> Administration -> Synaptic Package Manager
1. Now you got a GUI window. In that window on left side select "status" button & then "Installed"
2. Now you will see all the installed packages in your system on the right side.
3. Select the package to which you want to get the information, then right click select "properties"
4. Now you will get a new window with tabs "common, dependencies, installed files.. etc". Click the installed files tab.



Now you can see all the files installed in your system regarding that particular package with the full path to those files. :)

CUI Way(Terminal):
Issue the following command in terminal
#dpkg -L "packagename" | more
Note: Replace with the package which you want without quotes. I am using the debian derived Indian linux distro "BOSS- Bharat Operating System Solutions"



This will be useful when you are not sure/know where the configuration, log files, command regarding particular package is.

Tuesday, March 22, 2011

Want to see the Recently Installed/UnInstalled packages in your system?

We know that everything is loged in Linux. The installation, Uninstallation is not exception. The full details of latest installation, removal package is stored in the file

/var/log/apt/history.log

So if one accidently uninstalls a package and not know the name, he can easily find it in this log file. :)

Tuesday, January 11, 2011

how to get the information/details about the installed packages in debian linux?

$dpkg -s "package-name"

-s <- is the option for find out the status of the given gives information like

1. The package is installed or not, removed
2. size of the installed package
3. Architecture support
4. Dependency
5 Version and so..

Monday, January 10, 2011

How to find out the package from which a command (comes) is available?

From starting of the linux usage we all using the command mkdir, copy, mv .. etc.
So do ever wish to identify from which package a certain command is (installed) availabe.

If you got a doubt like so, here is the solution how to find the package name that provide the certain command.

1. First find out the place where the command(binary) is? using

$whereis
Ex:$whereis mv
$mv: /bin/mv /usr/share/man/man1/mv.1.gz <--Out put for above command is like this

So, the command binary of the command is resides in the folder /bin/

2. Now issue the following command to find out the package which provides 'mv' command
$dpkg -S
EX:$dpkg -S /bin/mv
$coreutils: /bin/mv <-- Output for above command is like this

So, the package(name) that provides mv is "coreutils".

Thats it.. :)