Showing posts with label debian. Show all posts
Showing posts with label debian. Show all posts

Collection of 18 Popular APT & DPKG Tips for Debian and Ubuntu

Monday, September 20, 2010 | 0 comments

This is a guide containing the most popular and useful ways of using the APT and DPKG commands, and it applies to both Ubuntu and Debian (and their derivatives). I mentioned where super user privileges are required, the ones without a mention can be executed as normal user. If you're using Ubuntu, precede a command with sudo in order to gain root privileges (and enter your user password); on Debian, type su, enter the root password, and then type in the commands as shown below.

dpkg -L package_name
This command will show what files package_name installed on your computer. Notice that this works only for already installed packages. Example:

embryo@debian:~$ dpkg -L vorbis-tools

/.

/usr

/usr/bin

/usr/bin/ogg123


apt-get build-dep package_name

(needs root privileges)
This is a very useful command, which will install all the development libraries needed by an application. So if you need to compile a newer version of a program than the one included in the repositories, use this command to fetch the dependencies. Notice that the libraries installed will be for the current version coming with the repositories, so you may need to install additional libraries if needed. However, this usually works for most of the applications. Example:

apt-get build-dep wesnoth


This will fetch all the development packages needed for Wesnoth. Keep in mind that your sources repositories must be enabled (they are enabled by default in Ubuntu).

apt-get clean (and apt-get autoclean)
(needs root privileges)
This command will remove the archives installed on your system. Whenever you install a package, it is downloaded and the DEB package is kept inside the /var/cache/apt/archives/ directory. This command removes those packages, freeing up space.

apt-get clean
apt-get autoclean


Regarding apt-get autoclean: this command will remove only the archives which are no longer available in the repositories, and will keep the ones which are currently available. Helpful if you want to get rid of old archives which have been updated, but still want to keep the upgraded ones just in case. To see how much space the archive occupy, use du -h (the -h argument stands for human readable, so it will show sizes in human readable format):

du -h /var/cache/apt/archives/


apt-cache show package_name
Will show information about any package in the repository. You only have to type in the name of it, not the entire name and version. Example:

embryo@debian:~$ apt-cache show vorbis-tools

Package: vorbis-tools

Priority: optional

Section: sound

Installed-Size: 580

...


apt-cache search pattern
Will search and list all the packages which contain pattern in their name or in their description. You can pipe this with grep for more relevant results:

embryo@debian:~$ apt-cache search gnome terminal|grep terminal

gmfsk - MFSK, RTTY and other digital mode terminal for HF/amateur radio

gnome-terminal-data - Data files for the GNOME terminal emulator

gnome-terminal - The GNOME 2 terminal emulator application


apt-get update && apt-get upgrade
(needs root privileges)
This is a one-liner to update your packages list and upgrade your system. Since it requires root privileges, if your distribution is Ubuntu use sudo apt-get update && sudo apt-get upgrade. Notice that the second command (after the double ampersand) is executed only if the first one was successful, so if fetching any of the lists fails, the second command will not be executed. If you're running a testing or beta release, use instead the following:

sudo apt-get update && sudo apt-get dist-upgrade


This will fetch updates even if they depend on newer packages.

dpkg --get-selections

This command will list all the packages installed on a system using the package manager. Example:

embryo@debian:~$ dpkg --get-selections

acpi-support-base install

acpid install

adduser install

akregator install

...


dpkg -S filename
Will list the packages which install filename. Example:

embryo@debian:~$ dpkg -S oggenc
vorbis-tools: /usr/share/man/man1/oggenc.1.gz
vorbis-tools: /usr/bin/oggenc

embryo@debian:~$


apt-get autoremove
(needs root privileges)
This command will remove unnecessary packages (e.g. orphaned packages), which are no longer needed by any of the packages installed in the system. This happens often after you uninstall a certain application, and its dependencies still remain installed on the system. Use this command to get rid of them.

apt-cache dump
This command will list every package in the cache.

apt-cache depends package_name
A very useful command which lists every dependency a package has, including recommended packages.

embryo@debian:~$ apt-cache depends vorbis-tools
vorbis-tools

Depends: libao2

Depends: libc6

Depends: libcurl3-gnutls

...


apt-cache rdepends package_name
Will show dependencies in reversed order, that is, it will list all the packages which depend on the specified package.

apt-cache rdepends mplayer

apt-cache policy package_name
This will list the repository in which a package is located. In Ubuntu, there are four such repositories: main, restricted, universe and multiverse. Debian has main, contrib and non-free. There is a certain policy for each package, and depending on that, the package is included in one of the specified repositories.

apt-cache policy amarok
apt-cache policy sun-java6-jre


apt-cache showsrc package_name
Will show information about a package source.

apt-get -f install
(needs root privileges)
Will try to fix broken dependencies. This usually comes in handy if you try to manually install a DEB package without installing first its dependencies. Run apt-get -f install to fix the missing dependencies and try to install the package again.

apt-cdrom add
(needs root privileges)
Will add a CD ROM to your sources, so you can install packages from it. This command is mostly useful if you have some ISO images, which you don't want to burn to a CD. In order to scan the ISO images, use:

apt-cdrom -d=/cdrom add

This will mount the ISO image inside the /cdrom directory, and then add its contents to the sources.list. Notice that the /cdrom directory has to be empty. You can use any empty directory for this:

apt-cdrom -d=/home/USER/mydir

dpkg -c local_file.deb
The -c argument tells dpkg to list the contents of a DEB package. Example:

embryo@debian:~$ dpkg -c google-chrome-stable_current_i386.deb
...

drwxr-xr-x root/root 0 2010-07-30 23:54 ./usr/share/man/man1/

-rwxr-xr-x root/root 3098 2010-07-30 23:54 ./usr/share/man/man1/google-chrome.1

lrwxrwxrwx root/root 0 2010-07-30 23:54 ./usr/bin/google-chrome -> /opt/google/chrome/google-chrome


dpkg -f local_file.deb
This shows the control file for a binary package. A control file is a file which provides information to the package manager about dependencies, maintainer, homepage, description, and more.

embryo@debian:~$ dpkg -f google-chrome-stable_current_i386.deb
Package: google-chrome-stable

Version: 5.0.375.126-r53802

...


These are the most popular uses of APT and DPKG. Have some more? Please, share them!

What Makes Debian One of the Most Popular Distros Out There: 5 Good Reasons

Saturday, September 18, 2010 | 0 comments

Debian is one of the oldest and most popular distributions among the Linux users. There are probably hundreds of distributions which are based on Debian, or others which are based on distributions which in turn are based on Debian. Although I'm not a Debian developer, I use it for over two years or so, and slowly got to love this OS.

This is not a 'Debian is better than X' article, it's just about Debian alone. So, let's proceed and see what makes Debian so popular and loved among the Linux users.

Stability. I know as a Debian or Ubuntu (or why not, some other distribution) user you probably heard this a million times. But yes, stability. Debian is renowned for the fact that its 'stable' version is always released only if all known critical bugs have been fixed and it's been stripped from most of the ones with a lower priority. When you install Debian stable you have the certitude that it will not give you a headache, that it is secure and that all the tools and daemons will work the right way. There is a reason for which Debian is used by so many web hosting companies as their preferred Linux distribution for their servers.

Huge community. From a user's point of view, especially a tech-oriented one, having enough persons from which at least one will know the answer is a blessing. There are the Debian mailing lists, the IRC channels (both the official OFTC one and the Freenode one), the forums. And why not say it, UbuntuForums.org does a great job too in helping Debian. How's that?, you may ask. Well, Ubuntu is so popular and used by so many people that on the online forums you can get a straight, good answer to a question in minutes. And since Ubuntu is based on Debian, over 90% of the questions which apply for Ubuntu will apply for Debian too.

Good documentation. I'm talking here books and books of official online documentation. We have the Debian Wiki, we have powerful manuals written by professionals, and to list some, here are the New Maintainers' Guide, the Debian Policy Manual or the Debian Packing Manual.To say nothing about all the third-party help sites, news sites, blogs and articles referring to Debian. This makes Debian a very rich-documented distribution, and knowing help is out there if you do a little reading is a key aspect for any user.

Debian Free Software Guidelines. The social contract is a major aspect which affected how Debian developed and continues to be developed. Debian is one of the distributions which follow a very specific code from which there is no straying. Debian will always be 100% free, it will be open, it will fulfill the community needs and it will respect the free software standards.

Debian fits perfectly both as desktop or as web server. With high security and stability standards, Debian makes the perfect fit for a web server. But Debian comes with over 17,000 from which a huge amount is made by GUI applications, desktop environments and many other user-friendly tools.

And the list goes on. The true power of Debian lies not only in the few points I listed here, but in its users and mentality. Software done this way will always be there, because it relies on an entire community to survive, and as long as the community is there, then so is Debian. A proof to this is that Debian has been around almost since the beginning of Linux, in 1993, when Ian Murdock, founder of Debian, announced the availability of Debian on August 16, and together with Slackware or Red Hat, it is at the top of the pyramid regarding tradition in the Linux world.

Tutorial: Compile and Install GIMP 2.6.10 in Debian 5.0 Lenny

Wednesday, September 15, 2010 | 0 comments

In this tutorial I will show how to compile from source and install in Debian Lenny the latest release of GIMP, the most powerful image manipulation application currently available for Linux.

First of all, Debian Lenny comes with GIMP 2.4.7 in the repositories, so if you have it installed, you should remove it first:

apt-get remove --purge gimp
apt-get autoremove --purge

Next, install the dependencies needed to compile GIMP 2.6.10:

apt-get build-dep gimp
apt-get install libbabl-0.0-0-dev libgegl-0.0-dev

Next, download the GIMP 2.6.10 source tarball from the GIMP FTP site and then uncompress it:

tar -xjf gimp-2.6.10.tar.bz2

Now change the working directory to gimp-2.6.10 and issue these commands:

./configure
make
make install

GIMP 2.6.10 in Debian Lenny

The last one as root. If you want to install GIMP as a normal user, specify a different prefix to the configure script:

./configure --prefix=/home/USER/usr
make
make install

There is no need to be root when issuing make install this time.
 
© Copyright 2011-2012 the best car 2011 All Rights Reserved.
Template Design by the best car 2011 | Published by Bloggers Templates | Powered by Blogger.com.