Wednesday, April 27, 2011

Linux - apt-get

The apt-get program is a command-line package manager, which should be used if the Add/Remove tool and Synaptic ever run into problems. It provides an advanced interface to APT, the underlying package management system which Ubuntu uses, but is reasonably easy to operate. Power users may find that apt-get is quicker to use and more powerful than the graphical options.

Text based methods can be used across Ubuntu, Kubuntu and Xubuntu, but require familiarity with the terminal. When helping users to install packages, you should consider using an AptURL instead of apt-get or aptitude.


Installing downloaded packages


You may wish to install a package you have downloaded from a website, rather than from a software repository. These packages are called .deb files. Because they may have been created for a different Linux distribution, you might find that there's dependency issues with Ubuntu, meaning that they may be uninstallable.

Package management via apt-get runs hand-in-hand with the /etc/apt/sources.list file.
To find a package which you have previously downloaded using Synaptic, aptitude or apt-get, look in /var/cache/apt/archives




Introduction to APT


"In the beginning there was the .tar.gz. Users had to compile each program that they wanted to use on their GNU/Linux systems. When Debian was created, it was deemed necessary that the system include a method of managing the packages installed on the machine. The name dpkg was given to this system. Thus the famous 'package' first came into being on GNU/Linux, a while before Red Hat decided to create their own 'rpm' system.

A new dilemma quickly took hold of the minds of the makers of GNU/Linux. They needed a rapid, practical, and efficient way to install packages that would manage dependencies automatically and take care of their configuration files while upgrading. Here again, Debian led the way and gave birth to APT, the Advanced Packaging Tool, which has since been ported by Conectiva for use with rpm and has been adopted by some other distributions."

Commands
 
All of these commands must be run as root or with superuser privileges, see sudo for more information. Replace with the name of the package you are attempting to install.
 
 apt-get install

to download without install

apt-get install -d


This command installs a new package.

apt-get build-dep

This command searches the repositories and installs the build dependencies for . If the package is not in the repositories it will return an error.


 
Ref : https://help.ubuntu.com/community/AptGet/Howto

Linux - MySQL Configuration

Configuration


You can edit the /etc/mysql/my.cnf file to configure the basic settings -- log file, port number, etc. For example, to configure MySQL to listen for connections from network hosts, change the bind-address directive to the server's IP address:

bind-address = 192.168.0.5


After making a change to /etc/mysql/my.cnf the mysql daemon will need to be restarted:
 
sudo /etc/init.d/mysql restart
 
If you would like to change the MySQL root password, in a terminal enter:
 
sudo dpkg-reconfigure mysql-server-5.1
 
The mysql daemon will be stopped, and you will be prompted to enter a new password.
 
 
 
Ref: https://help.ubuntu.com/10.04/serverguide/C/mysql.html

Linux - MySQL Installation

MySQL is a fast, multi-threaded, multi-user, and robust SQL database server. It is intended for mission-critical, heavy-load production systems as well as for embedding into mass-deployed software.


Installation

To install MySQL, run the following command from a terminal prompt:

sudo apt-get install mysql-server
During the installation process you will be prompted to enter a password for the MySQL root user.


Once the installation is complete, the MySQL server should be started automatically. You can run the following command from a terminal prompt to check whether the MySQL server is running:

sudo netstat -tap | grep mysql

When you run this command, you should see the following line or something similar:

tcp 0 0 localhost:mysql *:* LISTEN 2556/mysqld

If the server is not running correctly, you can type the following command to start it:

sudo /etc/init.d/mysql restart