Preparing Your System

download Preparing Your System

of 8

Transcript of Preparing Your System

  • 7/28/2019 Preparing Your System

    1/8

    Preparing Your System

    Youll need to install a package calledbuild-essentialfor creating the package from source

    and checkinstallto add it to your package manager for easy removal. This can be done quickly via the

    console, simply open up Terminal (Applications,Accessories, Terminal) and type:

    sudo apt-get install build-essential checkinstall

    Allow time for these to download and install, and once done you may also want to install version

    management software for upgrades, though you can always do this later. In any case, these three will do

    the trick:

    sudo apt-get install subversion git-core mercurial

    Next youll want a common directory to use when building these packages. You can technically put this

    anywhere, as long as it is writeable. The official Ubuntu documentation recommends

    /usr/local/src

    so well stick with that:

    sudo chown $USER /usr/local/src

    Then make sure its writeable:

    sudo chmod u+rwx /usr/local/src

    Finally well also installapt-file, which is used to resolve any dependency issues you encounter:

  • 7/28/2019 Preparing Your System

    2/8

    sudo apt-get install apt-file

    Youll probably get a pop-up telling you need to update apt-file, if not run the following command and

    let it finish:

    sudo apt-file update

    Once youve done this, youll never need to do it again as your system will be prepared for any tarballs

    you throw at it.

    Extract & Configure

    Assuming youve already downloaded a mysterious .TAR.GZ file youre first going to need to move it to

    your designated build folder (I used

    /usr/local/src

    ). You can do this with yournormal file browser, and once done, open up a new Terminal.

    http://www.makeuseof.com/tag/nautilus-elementary-simplifies-file-browsing-linux/http://www.makeuseof.com/tag/nautilus-elementary-simplifies-file-browsing-linux/http://www.makeuseof.com/tag/nautilus-elementary-simplifies-file-browsing-linux/http://www.makeuseof.com/tag/nautilus-elementary-simplifies-file-browsing-linux/
  • 7/28/2019 Preparing Your System

    3/8

    Change to the build folder by typing:

    cd /usr/local/src

    Next extract the archive. For .TAR.GZ files type:

    tar -xzvf .tar.gz

    And for .TAR.BZ2 files type:

    tar -xjvf .tar.bz2

    If all went well youll see a long list of extracted files, like in the screenshot above. Dont close the

    Terminal yet, were not done.

  • 7/28/2019 Preparing Your System

    4/8

    It is at this point I urge you to navigate to the folder your archive just created (with your usual file

    browser) and open either README or INSTALL should the files exist. If your particular software requires

    a different method to the one Im about to go into then this file will hold the key. You can save yourself

    a lot of hassle by doing this.

    You may also be able to choose different install options depending on the software, and the INSTALL orREADME will stipulate what these are. The files may have no extension, but are plain text and should

    open in Gedit or any text editor you choose.

    As a general rule, the following commands will install your software with the default installation

    method.

    Your tarball will have been extracted to a folder with the same name as the file, so change to this folder

    with the cd command you used earlier, like so:

    cd /usr/local/src/

    Replace with the name of the folder the archive created. Next youll need to

    configure the source files by typing:

    ./configure

    Note: If your software does not have a configure file, you might want to try skipping straight to the Build

    & Install section of this article, though consult your INSTALL or README documentation first.

    If you receive an error message related to autoconf, then youll need to install it by typing:

    sudo apt-get install autoconf

    Then run

    ./configure

    again.

  • 7/28/2019 Preparing Your System

    5/8

    This command will verify whether you have all the installed packages required to use your software. You

    can use apt-file which you installed earlier to fill in the blanks.

    If you do receive an error (something like

    configure: error: Library requirements ... not met

    ) have a look for the file not found above the error message, then using apt-file search by typing:

    apt-file search .

    This will tell you which package the file you require is in, so you can download it using:

    sudo apt-get install

    This wont necessarily always happen, but it is very useful if you dont have the required dependencies.

    When youre satisfied youve got the packages (if you needed any) run the

    ./configure

    command again.

  • 7/28/2019 Preparing Your System

    6/8

    If all went well youll see

    config.status: creating Makefile

    congratulations, youre very nearly there! Lots of people give up before they get to this point, but

    youre better than that.

    Build & Install

    Into the same Terminal window type:

    make

    Sit back, grab a coffee and breathe for a second. Depending on the size of your install this can take a

    while.

    Now you can install the program with the following command:

    sudo checkinstall

    Follow the on-screen prompts, add a description for your software and hit Enteron this screen:

  • 7/28/2019 Preparing Your System

    7/8

    If everything went well youll seeInstallation Successful. Pat yourself on the back. Youve done well.

  • 7/28/2019 Preparing Your System

    8/8

    Your software should now be installed to

    /usr/local/bin

    and youll be able to run it from there without any problems.

    Did you make it all the way through? Isnt it easier just waiting for a package or getting it from the

    repositories? Maybe you found it easy? Let us know in the comments.