Showing posts with label apt-get. Show all posts
Showing posts with label apt-get. Show all posts

Monday, May 26, 2014

How to add CD/DVD entry into Debian Linux source.list file

In Debian based linux(deb package management system) Linux "/etc/apt/sources.list" is the file which tells your linux box where the repository.  Regardless of the new packages installation mode (whether via terminal with apt-get command or with synaptic package manager) this file is referenced to fetch the needed .deb files.  For this method you need to have a good internet connection.

If you have installation CD/DVD you can add this to the source.list file and use that as your repository(only to install the packages available in the CD/DVD).  how to do that?

[What apt tool actually needs is a catalog file to use (packages.gz) and the original .deb packages.  As the installation CD/DVD contains it we can use the same as like online repo.]

1. Insert your CD/DVD into the drive and ensure it is mounted properly

2. Go to terminal by
Applications -> Accessories -> Terminal (Steps for BOSS GNU/Linux)

3. Type the following command

$sudo apt-cdrom add

This command will add the cdrom entry into the /etc/apt/sources.list.

4. Now update your apt file with the following command

$sudo apt-get update

5. Install the packages you need by

$sudo apt-get install

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, 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

Thursday, September 27, 2012

How to enable wireless in BOSS GNU/Linux?

 Some time wireless/wi-fi is not working in BOSS GNU/Linux[or any debian based linux like ubuntu etc].  The reason

1.  The exact firmware/driver for the wireless card, what you are using is not installed.  Because your driver may not be the popular one which is used by many laptop vendor/company/product/model.

2.  Due to the license under which the firmware/driver is released.

Note: If the license of the driver allow to distribute then by default the driver is added with the Linux Operating system.  Some drivers are free but not allowed to distribute, in this case the user manually should install that driver by his own. 

In both cases you should find and install the correct firmware.  In general the following firmwares are enough for get wi-fi access. (There are some special case, where your wi-fi card not from the vendors like b43, broadcom, intel.  If it is so, you need to get the .deb file from the vendor's site or from other distro's repository.)


Install the following firmwares from the repository using terminal(with root permission),
Applications -> Accessories -> Terminal

$sudo apt-get install firmware-b43-installer firmware-brcm80211firmware-iwlwifi firmware-linux-free

Now you can check whether these firmwares installed, by the command
$dpkg -l | grep firmware
the o/p of this command will be like the following

ii  firmware-b43-installer       4.150.10.5-4        Installer package for firmware for the b43 driver
ii  firmware-brcm80211         0.32~bpo60+1    Binary firmware for Broadcom 802.11 wireless cards
ii  firmware-iwlwifi                0.32~bpo60+1    Binary firmware for Intel Wireless 3945, 4965 and 5000-series cards
ii  firmware-linux-free            2.6.32-39            Binary firmware for various drivers in the Linux kernel


How to findout make of the wireless card:

1. After the system bootup, from termianl read the message in "/var/log/syslog" by
$sudo tail /var/log/syslog

2. $lspci

3. $lshw
4. $lsusb (if you are using wireless dongle for your PC.)

after the installation of these things in your machine(some times we need to restart) wireless thing comes into the effect.  now just click on the network icon (nm-applet) and now you can see the options like
wireless network
enable wireless
create new wireless network
connect to hidden wireless network and the menu itself shows you all the available wireless networks.

For intel wifi cards:
install firmware-iwlwifi

For broadcom lp-phy type wifi cards:
install firmware-b43-lpphy-installer


Monday, December 19, 2011

How to create a simple local apt repository?

This post is regarding debian based distros which supports .deb, so the procedures are not applicable for distros that uses .rpm like fedora, redhat etc..
Requirements:
build-essential
dpkg-scanpackages
gzip

How to do:
1. Create a directory named "repo" in your home directory.  say $mkdir /home/test/repo
2. Copy all the debs you have into the /home/test/repo
3. Open your terminal as root and do the following & change directory to /home/test/repo
    #mkdir /home/test/repo
     #cd /home/test/repo
     #dpkg-scanpackages . /dev/null | gzip -9c > ./Packages.gz

Here, '.' specifies -> present working directory
/dev/null specifies -> override file, as we not going to use override file we give /dev/null
gzip -9c>./Packages.gz -> Compresses the package details into the file Packages.gz
(Packages.gz will be created within the present working directory)
4. add the following line in your /etc/apt/sources.list file
deb file:/home/test/repo/ /
5. Update your system using apt-get update command
#apt-get update
6. Thats all now your /var/lib/apt/lists will be updated
Note: Remember now whenever you use "apt-cache search" "apt-get install" it only installs from debs inside /home/test/repo.