Sunday, April 30, 2017

How do I uncompress a tarball that uses .xz?

Modern tar recognizes the format by itself! One command works with any supported compression method.
tar xf archive.tar.xz
tar xf archive.tar.gz
tar xf archive.tar
etc.

open a GUI windows from terminal windows

In Debian (ex: Ubuntu)

In Ubuntu, with Gnome, you'd do
nautilus /tmp
Under KDE, I guess you'd do
konqueror /tmp

How to run my own program without specifying its path

What you are looking for is the PATH environmental variable. It tells the shell, where it needs to look for programs. You can see the current value of that variable using echo:
echo "$PATH"
Now... The best practice if you want use some new program is to install it using the package management program for your distribution. But in this case, I assume you are dealing with a program that is not delivered by any available software package. For such programs, you have two options:
  1. Install the program system-wide, in a place where your system does not put any files installed from packages. On most systems, such "safe" folders include /usr/local/bin/ and /opt/bin/ - those should already be in your PATH. (Look inside these folders and if there are many files in them, then it is the wrong place to put your own program and you have to look at other folders listed in your PATH.)
  2. Modify your PATH variable. This is less secure, because it defines additional folders where programs can be kept and someone might play a trick on you, putting his own program there for you to run.
    You can modify the PATH variable either temporarily, using
    export PATH="$PATH:/path/to/your/executable"
    
    (mind the $PATH after =), or permanently by adding the above line to your .bashrc file (assuming you use bash).

How To Compile and Install from Source on Ubuntu (howtogeek)

Ubuntu and other Linux distributions have extensive package repositories to save you the trouble of compiling anything yourself. Still, sometimes you’ll find an obscure application or a new version of a program that you’ll have to compile from source.
You don’t have to be a programmer to build a program from source and install it on your system; you only have to know the basics. With just a few commands, you can build from source like a pro.

Installing the Required Software

Installing the build-essential package in Ubuntu’s package repositories automatically installs the basic software you’ll need to compile from source, like the GCC compiler and other utilities. Install it by running the following command in a terminal:
sudo apt-get install build-essential

Type Y and press Enter to confirm installation when prompted.

Getting a Source Package

Now you’ll need your desired application’s source code. These packages are usually in compressed files with the .tar.gz or .tar.bz2 file extensions.
As an example, let’s try compiling Pidgin from source — maybe there’s a newer version that hasn’t been packaged yet and we want it now. Locate the program’s .tar.gz or .tar.bz2 file and save it to your computer.

A .tar.gz or .tar.bz2 is like a .zip file. To use it, we’ll have to extract its contents.
Use this command to extract a .tar.gz file:
tar -xzvf file.tar.gz
Or use this command to extract a .tar.bz2 file:
tar -xjvf file.tar.bz2

You’ll end up with a directory with the same name as your source code package. Use the cd command to enter it.

Resolving Dependencies

Once you’re in the extracted directory, run the following command:
./configure
(Note that some applications may not use ./configure. Check the “README” or “INSTALL” file in the application’s extracted folder for more specific instructions.)

(The ./ part tells the Bash shell to look inside the current directory for the “configure” file and run it. If you omitted the ./, Bash would look for a program named “configure” in system directories like /bin and /usr/bin.)
The ./configure command checks your system for the required software needed to build the program.

Unless you’re lucky (or already have a lot of required packages on your system), you’ll receive error messages, indicating you’ll need to install certain packages. Here, we see an error message saying the intltool scripts aren’t present on their system. We can install them with the following command:
sudo apt-get install intltool
After installing the required software, run the ./configure command again. If you need to install additional software, repeat this process with the sudo apt-get install command until ./configure completes successfully. Not every required package will have the exact name you see in the error message — you may need to Google the error message to determine the required packages.
If an older version of the program you’re trying to compile is already in Ubuntu’s software repositories, you can cheat with the sudo apt-get build-dep command. For example, if I run sudo apt-get build-dep pidgin, apt-get will automatically download and install all the dependencies I’ll need to compile Pidgin. As you can see, many of the packages you’ll need end in -dev.

Once ./configure completes successfully, you’re ready to compile and install the package.

Compiling and Installing

Use the following command to compile the program:
make
This process may take some time, depending on your system and the size of the program. If ./configure completed successfully, make shouldn’t have any problems. You’ll see the lines of text scroll by as the program compiles.

After this command finishes, the program is successfully compiled — but it’s not installed. Use the following command to install it to your system:
sudo make install
It’ll probably be stored under /usr/local on your system. /usr/local/bin is part of your system’s path, which means we can just type “pidgin” into a terminal to launch Pidgin with no fuss.

Don’t delete the program’s directory if you want to install it later — you can run the following command from the directory to uninstall the program from your system:
sudo make uninstall

Programs you install this way won’t be automatically updated by Ubuntu’s Update Manager, even if they contain security vulnerabilities. Unless you require a specific application or version that isn’t in Ubuntu’s software repositories, it’s a good idea to stick with your distribution’s official packages.
There are a lot of advanced tricks we haven’t covered here — but, hopefully, the process of compiling your own Linux software isn’t as scary anymore.

How to Compile and Install Software from Source Code on Linux (howtogeek)

While yum, apt-get, rpm are very handy to install a package that is already compiled, you still might encounter some situations where you have to install a software from source code.
This article explains on a very high level how to compile and install a software from source code.

Download the Source Code Package and Unpack it

The source code for software on Linux comes in the form of compressed tar files, which typically have either .tar.gz or .tar.bz2 extensions. The tools that are used for packing the source code into these tar balls are ‘tar’ (used for combining multiple files into one), ‘gzip’ or bzip2 (used for compression). To fetch the source code tarball for a particular software you need to know the URL to the tarball.
Once you have the download link, use ‘wget’ to fetch the tarball from command line.
$ wget <link to the tarball>
The above command will download the tarball into the current directory. wget command is very flexible and has lot of options. To learn more about wget, refer to the 15 wget examples.
Next you needs to unpack the tarball in order to get access to the source code and other files. Depending on the extension, use one of the following commands:
$ tar -xvfz <name of tarball with .tar.gz extension>
(or)
$ tar -xvfj <name of tarball with tar.bz2 extension>
tar command is very flexible and has lot of options. To learn more about tar, refer to the 10 tar examples.

Read Install Documentation

Once the software source code is downloaded and extracted, the very first thing that one should do is to go through the documentation. This may sound boring to most of us but this is a very important step as doing this step thoroughly would save you from most of the future problems. The documentation provides information about the software, changes since last version, links to more documentation, information regrading the author of the software, steps for compilation and installation of software etc. So we can see that lots of valuable information is present in the documentation.
This whole information is broadly divided into two files : ‘Readme’ and ‘Install’. While ‘Install’ covers all the information required for compilation and installation, all the other information is covered in the ‘Readme’ file. Please note that the name of file and it case may vary.

Configuration

Once the above step is over then we can assume that we have sufficient theoretical knowledge about this software and now we can move forward and configure the environment for compiling and installing the software on our system. Most of the packages come along with a configuration script that can be used for configuring the environment. The file name for configuration file is mostly ‘configure’. This script usually accepts parameters that can be used to control some features of this software. Also this script makes sure that all the tools required for compilation are present in the system.
To learn about the options provided by a specific configuration file, run the following command:
$ configure --help
To start configuring the build environment, execute the following command :
$ ./configure
The above command will check and/or create the build environment and if everything goes fine then it produces a file called ‘makefile’. The file ‘makefile’ is used in the compilation of the software.

Compilation

Once the makefile is generated, then in the same directory just run the following command:
$ make
The above command will compile all the source code related to the software. If compilation encounters some problem then error is thrown on the console.

Installation

Once the compilation is done successfully then all the required binaries are created. Now is the time to install these binaries in the standard paths so that they can be invoked from anywhere in the system. To do this run the following command :
$ make install
Note that some times installing the software may require root privileges, so one may gain the rights and then proceed with the above command.
The above 5 steps show how to fetch, unpack, configure, compile and install the software from source. Additionally one could do some cleanup by removing the directory created while unpacking the software tarball.
The following articles are few examples on how to install a software from source code.
While compiling and installing open source software from source, there could be some issues/errors that may come up. Lets look at a few of those here:
  • Missing shared library: Sometimes when you run the program you just installed, you get an error related to some .so that your program is not able to find. Firstly, .so are synonymous to the DLLs we have in windows. These are shared libraries that are required by the program. Secondly, these type of errors erupt when your program is installed in some non-standard path or the shared library is actually not present in your system. For the first case, you need to tell the shell environment the path at which these new shared libraries are installed. This can be done by using the ‘ldconfig’ command or by modifying the LD_LIBRARY_PATH variable.
  • Broken source code: No matter how much pain you take by going through all the documentation and covering all the steps building the software but if the source code gives some compilation error then it very much means that the software has broken source code. Nothing much can be done in this case except referring this problem back to the author of this software. Meanwhile, if you think you can you may debug the errors and see if these are trivial errors that can be fixed (like syntactical errors).
  • No configure script: Though rare, but sometimes you’ll find that there is no configuration script present in the source code directory. If this happens that does not mean that you are stuck. In this case all you need is to go through the documentation in detail and there you will definitely find some information regarding configuration of environment for compiling and installation of software.

How to compile and install programs from source - stackexchange

Normally, the project will have a website with instructions for how to build and install it. Google for that first.
For the most part you will do either:
  1. Download a tarball (tar.gz or tar.bz2 file), which is a release of a specific version of the source code
  2. Extract the tarball with a command like tar zxvf myapp.tar.gz for a gzipped tarball or tar jxvf myapp.tar.bz2 for a bzipped tarball
  3. cd into the directory created above
  4. run ./configure && make && sudo make install
Or:
  1. Use git or svn or whatever to pull the latest source code from their official source repository
  2. cd into the directory created above
  3. run ./autogen.sh && make && sudo make install
Both configure and autogen.sh will accept a --prefix argument to specify where the software is installed. I recommend checking out Where should I put software I compile myself? for advice on the best place to install custom-built software.

10 Best Web Browsers For Linux

Web browsers have taken over the desktop. For many people, the browser is the most used application, which is why it’s so important to choose a stable browser that suits all your needs. Linux users can pick from a dozen web browsers of different kinds – from lightweight and command-line to cross-platform and extremely extensible ones.



All browsers on this list are free to download, install and use, and they earned their place on this list because they’re reliable in everyday use and/or actively developed.

Here is the list of 10 best browsers for Linux

1. Firefox

linux-browsers-firefox

Firefox is the third most popular browser in the world, and likely the most popular Linux browser, since it ships with many Linux distributions by default. Its initial release in 2002 marked the rebirth of Netscape Navigator, though it wasn’t until 2004 that it became known as “Firefox”, having previously been known as first “Phoenix” and then “Firebird”. It’s one of the most customizable browsers, and the ocean of user add-ons and themes created for it will likely never be surpassed by other projects. It also performs well – tests show Firefox is the most memory-efficient of the mainstream browsers, in addition to having the best Javascript performance.

However, Mozilla has a history of making things difficult for add-on developers and users by introducing backwards-incompatible changes, one of which was a complete revamp of the UI. The new interface called Australis left many users unhappy and incurred a loss of market share. It wouldn’t be unfair to say Mozilla went through a direction crisis, and time will tell if the direction they’ve chosen will serve them well.

Download



2. Chrome

linux-browsers-chrome

Chrome is Google’s answer to Microsoft’s Internet Explorer and Mozilla’s Firefox. Chrome took everyone by surprise, offering a lightweight, responsive experience, and a fast Javascript engine. This affected all other browsers, as everyone had to scramble to catch up. Today, it’s the most popular browser, holding just over half the market share.

On Linux, you’re more likely to see Chromium, which is the open source project that Chrome is based on. However, Chromium still lacks a few potentially useful features, such as H.264 support and Google’s version of the Flash plugin. On the other side, it doesn’t feature Google’s tracking software. Following its main competitors, Chrome ships with only the most basic functionality, but it’s very extensible, and the number of add-ons has risen dramatically over the years.

Download

3. Opera

linux-browsers-opera

Opera has never had much market share, despite being one of the more innovative browsers – it was the first browser that had the Speed Dial feature. In recent times, they’ve abandoned their proprietary layout engine, Presto, in favor of Google’s fork of WebKit, Blink. This essentially means Opera is now a version of Chromium, a move which disappointed some old users, as some of the customization options have been lost in the transition. However, it retains much of the look and feel of the older versions, and offers mouse gestures, a download manager, extensions, Private Browsing and Turbo Mode. If you still can’t get over this change, try Vivaldi – a revival of Opera 12 with many new, exciting features.

Download

4. Konqueror

linux-browsers-konqueror

Konqueror is KDE’s one-stop solution for both file and web browsing. By default it uses the KHTML rendering engine, but it also supports KHTML’s progeny, WebKit. In somewhat typical KDE fashion, it’s an application that does a great deal many things. It features most of the amenities you’d expect in a modern browser, such as tabs, pop-up blocking, ad filtering, bookmark management, and mouseless browsing. Those are just a part of its functionality, though: with KDE’s KIO plugins, it’s possible to use it for FTP, SAMBA and IMAP browsing, or even as a ISO image viewer. Konqueror is without a doubt the most advanced file / web browser combo application on any platform.

Download

5. Web

linux-browsers-epiphany

The official browser of the GNOME project, Web was previously known as Epiphany. It’s a WebKit-based browser which adheres to the design tenets of the GNOME project, offering a clean, simple interface and tight integration with the desktop environment. More recent versions have dropped support for user extensions, but a number of the most popular add-ons have become a core part of the browser. These include ad filtering, Greasemonkey support and mouse gestures.

Download

6. Conkeror

linux-browsers-conkeror

Conkeror is a representative of the wave of minimalist, keyboard-driven GUI browsers. Vimperator was an attempt to transform Firefox into a Vim-like environment. Conkeror, on the other hand, is inspired by the Emacs approach. This is reflected not only in keyboard shortcuts, but also the inherent extensibility. Many Firefox extensions work with Conkeror, and you can customize its appearance with simple CSS scripts. It’s a great browser for programmers and fans of mouse-less browsing. Conkeror is not related to Konqueror; it’s based on Mozilla’s technologies.

Download

7. Pale Moon

linux-browsers-palemoon

Pale Moon started out as an optimized Firefox build for Windows, but has since expanded onto other platforms, and has moved away from Firefox in a number of ways. The most obvious is the decision to retain the classic Firefox UI instead of switching to Australis. This makes Pale Moon a desirable alternative for dissatisfied Firefox users, but there are a few caveats. Its Windows-centric legacy shows in a number of places, notably in the fact that the profile migration tool is not available for Linux. Pale Moon also isn’t fully compatible with Firefox add-ons, and some of the more popular extensions don’t work with it. If that’s not an obstacle for you, Pale Moon is an easy recommendation for anyone tired of Mozilla’s antics.

Download

8. Midori

linux-browsers-midori

Midori is a lightweight alternative browser for GTK-based desktop environments, such as GNOME or Xfce. It supports both GTK+ 2 and GTK+ 3, and it’s based on WebKit. Due to its fast startup time and responsiveness, it has become the default browser for a number of Linux distributions. Like many browsers on this list, it follows the Opera rather than Firefox approach to providing features out-of-the-box: it comes with support for user scripts and styles, smart bookmarks, ad blocking, mouse gestures, and a speed dial, among other things.

Download

9. QupZilla

linux-browsers-qupzilla

QupZilla could be viewed as Midori’s Qt counterpart in the context of this list. Although the name sounds similar, it has no relation to Mozilla. It offers a lightweight yet feature-packed alternative to its better-known competitors. QupZilla is based on WebKit, and comes with with its own ad blocker and speed dial. It also offers an interesting approach to viewing bookmarks, history and RSS feeds – it unifies them all in a single window. Another distinguishing feature is that QupZilla tries to seamlessly integrate with the user’s environment.

Download

10. Lynx

linux-browsers-lynx

Lynx is a text-based browser – it runs in the terminal. In case you’re wondering why would anyone bother, there are a few situations where it might come in handy: maybe X has crashed and you need to Google how to fix it, or perhaps the documentation for some other console application is in HTML, and it’s a lot more elegant to just open in it in another tab. Lynx is the oldest such project still around, dating all the way back from 1992. Lynx doesn’t do much: it renders text from web pages. It has no support for images or video or Javascript. Consequently, it’s blazing fast, and fairly secure.

Download

What’s your favorite web browser for Linux? Do you know of any other browsers worth mentioning? Tell us about them in the comments.