Installing Software in GNU/Linux
Total Page:16
File Type:pdf, Size:1020Kb
User Name Password Log in Help Register Remember Me? Home Forum Articles Marketplace Downloads Hosting Freebies Jobs Today's Posts Today's Posts | FAQ | Calendar | Community | Forum Actions | Quick Links | Unanswered Posts | Forum Rules Find the answer to your Linux question: Entire Site GET THE ANSWER Forum Linux Resources Linux Tutorials, HOWTO's & Reference Material How To Install Software in Linux If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. logged in, most ads will not be displayed. ** Linuxforums now supports the Tapatalk app for your mobile device. Results 1 to 10 of 11 Page 1 of 2 1 2 Last Installing Software in GNU/Linux Originally posted by Jason Lambert Introduction For the benefit of people new to Linux, I have written a generic explanation of howto install software in Linux. ... 3 Likes Enjoy an ad free experience by logging in. Not a member yet? Register. Thread Tools Display You may also be interested in: 07-06-2006 #1 techieMoe How To Install Software in Linux Linux Guru Installing Software in Join Date: Aug 2004 GNU/Linux Location: Texas Posts: 9,496 Originally posted by Jason Lambert Introduction For the benefit of people new to Linux, I have written a generic explanation of howto install software in Linux. Note that some software may have specific installation procedures, this HOWTO is not a substitute for reading the official installation documentation This HOWTO covers the following topics: Command-line process: Compiling and Installing software from source Installing RPM's using the Redhat Package Manager Installing using Debian's apt-get Installing mandrake things Installing with fedora / yum Installing slackware packages Installing software using Gentoo EMerge Installing binary files (.BIN/.SH) Installing .package Files (AutoPackage) Graphical (GUI) process: Using Synaptic (Fedora, Ubuntu) Using YaST2 (SuSE, openSuSE) If you have just installed GNU/Linux and would like to know how to install software on your new OS, I would recommend you read the section specifically for your GNU/Linux Distribution. Note: for new users, it is generally easiest/best to install any software using the default package tool that is included with your particular distribution. Do not worry if you don't understand or remember everything written here straight away, book mark this page and use it as a reference page later on. Last edited by techieMoe; 03-24-2010 at 02:01 PM. arunpers and ArloJamesBarnes like this. 07-06-2006 #2 techieMoe Linux Guru Compiling and Installing software from source NOTE - Installing from source code is the most difficult method for obtaining software on Linux and in most cases is not necessary. Most popular software can be found and installed quite easily using your distribution's package manager (see sections on "apt-get" and "yum"). Installing from source is recommended only for experienced Linux users and/or those who aren't afraid to break something for the purpose of learning. Join Date: Aug 2004 Location: Texas Some software is distributed in "Source form". This means you download a file containing all the source code for the application you want Posts: 9,496 to install, unpack it, and compile it on your system. Compiling is the process of turning the source code into an executable binary. The common myth and newbie assumption is that this is very hard todo, or it is only for programmers. Wrong. It is a fairly straight forward process, and you will find that a lot of software you install will need to be built from source. Typically applications you must compile from source will come as a ".tar.gz", ".tar.bz2", or ".zip" file. You'll probably want to operate from inside your home directory. If your user is (for example) username, your home directory will be /home/username/. For the rest of this section we will assume you have downloaded your zip file to /home/username/src. If you do not have a src directory, you can create it with the following "mkdir" (make directory) command: Code: mkdir /home/username/src/ So, we have our source package in /home/username/src/. Change to the /home/username/src/ directory with the "cd" (change directory) command like so: Code: cd /home/username/src/ Use the "ls" (list directory contents) command, to see the file is present: Code: ls We now need to unzip the zipped file, this is done differently depending on the file extension. for files ending in .tar.gz, use: Code: tar -zxvf <filename> (replacing <filename> with the name of the file). for files ending in .tar.bz2, use: Code: tar -jxvf <filename> for files ending in .zip, use: Code: unzip <filename> You should now have a new directory, containing all of the source files. To confirm it exists, and to get its name, use the "ls" command again. Code: ls we now need to go into the new directory, so use the cd command: Code: cd <directory> This is where things will differ. Some packages will have an INSTALL or README file which will contain installation instructions. use "ls" to see if the software has an install or readme file. If it does have one, you can use the "more" command to read it, like so: Code: more INSTALL Generally, the final 3 stages are as follows: - Configure the installation - Compile the software - Install the binaries The pre-installation configuration is done by executing ./configure: Code: ./configure This will perform some requirements testing on your system, and create a "Makefile" which will explain to the "make" utility how the software should be compiled. If you receive any error messages during this stage, you may wish to search the forums to see if they have been found and resolved by someone else already, if not, feel free to post a question on the forums - Please include all of the output including any error messages, and some details about your system - what distro you are using, what are you trying to install etc etc The next stage is to compile the software, this is done using "make". When you run "make" it will read the instructions in the Makefile and build the application binaries. Code: make The final stage is to install these binaries, ie, copy them to a more permanent location. Typically only the "root" user can do this, so you will need to swich to the root user with the "su" command: Code: su Once you are root, install the binaries using the "make" command, followed by "install", like so: Code: make install That is it! Check the user documentation of the software you installed for details of how to run the application. Remember that if you have any problems, please post in the most relevant section of the forums. - When posting, remember to include as much info as possible, including all output and error messages. Last edited by techieMoe; 03-24-2010 at 01:56 PM. Reason: Changed reference to /usr/local ArloJamesBarnes likes this. Registered Linux user #270181 TechieMoe's Tech Rants 07-06-2006 #3 techieMoe Linux Guru Installing RPM's using the Redhat Package Manager Redhat RPM's offer a flexable and easy method to install new software. Software installed from an RPM package differs from compiling from source in a few ways, but the most important one of all is the software is already compiled for you. Essentially all you are doing is extracting the pre-built binaries and copying them to their pre-selected destination. RPM's are files that have a ".rpm" extenstion. The good point about RPM's is installation of new software, and maintaining the software currently installed is much easier than doing so for individual packages compiled from source. The downside to RPM's is that you dont have as much choice about where software is installed Join Date: Aug 2004 on your system, how it is compiled, and how it is configured. Location: Texas Posts: 9,496 Using the RPM system is fairly straight forward. To install a package, you can use the following command: Code: rpm -i <filename.rpm> When using rpm, you must be logged in as the root user. The "-i" flag in the above command means "install". Un installing a package is just as easy: Code: rpm -e <package> The "-e" switch used here means "erase" (un install). Note that <package> is different from <filename> used when installing. For example, if you are installing an application called "mysoftware", you may use a command like "rpm -i mysoftware-1.0.2-i386.rpm" to install "mysoftware", when removing we dont follow the filename for installation, but rather the name of the software itself. For further uses of RPM, please use "rpm --help" and "man rpm". Also see this page, which has some fairly useful information. If you need to find & download the RPM file for a piece of software, I recommend using RPM Find and RPM Pbone Search Note that not all applications are available as RPM's, in these cases you will need to compile the software from source. (see above). Registered Linux user #270181 TechieMoe's Tech Rants 07-06-2006 #4 techieMoe Linux Guru Installing software with Apt-get APT (Advance Packaging Tool) is a wonderful package management system. It consists of different tools, which names usually begins with "apt-" : apt-get, apt-cache, apt-cdrom, etc. Unlike RPM, which equivalent in a Debian system would probably be DPKG, apt-get handles dependencies resolution and takes care of downloading the software for you (much like YUM in a Red Hat system).