Installing Software

From PCLinuxOSHelp Knowledge Base
Jump to: navigation, search

The PCLinuxOS distribution media installs a number of the most popular Linux applications at installation time but there are large number of additional applications that you may wish to install. The best and recommended way to install additional applications is to use the Synaptic Package Manager to install it from the PCLinuxOS repository if available.

Installing software using the PCLinuxOS repository

Using Synaptic Package Manager

The recommended way of installing additional software is to install from the official PCLinuxOS repository. This has the advantage that the software has been built and tested to be compatible with PCLinuxOS and also will ensure that any additional packages (dependencies) required by the software will automatically be installed. The easiest way is to use Synaptic Package Manager which is the graphical application used to manage software on PCLinuxOS. The Synaptic and the Repositories page gives an overview of how to use Synaptic and specifically search for software to install.

Once you have found the package or packages you wish to install you first mark them for installation. You do this by right-clicking on the package in the package list panel and selecting Mark for installation from the pop-up menu. You can also get this menu by left-clicking the box next to the package name (in the S column) or from the Package drop-down menu at the top of the window.

Synaptic-Mark.png

If the package you mark for installation requires other packages to be installed or updated (dependencies) to work correctly another window will appear detailing those changes. Click Mark in this window to accept the changes.

Synaptic-Additional.png

Once you have finished marking packages to install then click the Apply button at top of the Synaptic window. A final panel summarizing the changes will appear giving you one more chance to review the changes. Click the Apply button in this panel to begin the process of downloading and installing the packages.

Using apt-get command line

For those that prefer to use the command line the apt-get command can be run as root to install packages. You must know the correct name of the package in order to do this. For example to install the Filezilla FTP file transfer program you would do:

apt-get update && apt-get install filezilla

The update sub-command ensures that apt has the latest package list available and the install sub-command begins the process of download and installation. If additional packages or updates are required as a result apt will ask for confirmation before proceeding.

If you are not sure of the package name you can use apt-cache search followed by a search expression in order to find the name of the package.

Other installation methods

Sometimes a particular application you want to use is not available in the PCLinuxOS repository. You can request that the application be added to the PCLinuxOS repository but you should only do this if it is likely to be of general use to the community and meets certain criteria (e.g. is not alpha or beta software). Full details on how to do this can be found on the Requesting New or Updated Packages page.

Failing that you may be able to install the software by downloading files directly from the website of the developer of the software. The problem with this is that there are many different methods of supplying and installing software this way. Broadly they can be divided into 2 categories:

  • Binary or executable downloads. This is often a single file that you can download to your system and then run directly either to install the software or to run it directly. Examples of this type are AppImage, Flatpak or RPM files.
  • Source downloads. These are usually an archive file containing hundreds of files which will need to be put through a build process (compiled, linked and installed) before they can be used. You need to have had previous experience of building/compiling software to be able to use this method of installing applications.
IconWarning.png
Warning!
Installing apps that aren't in the repository is not a good idea if you are new to Linux


Using an AppImage

AppImages are the best option if you can find them. This is because they are completely self contained (no dependencies) and usually run from the user home directory and therefore do not alter system files which can lead to system stability problems. AppImages don't even have to be "installed" as such, you just download the file and "run" it. The only issue is that, for security reasons, Linux does not let you just run any file downloaded from the Internet. You need to explicitly give Linux permission to run (execute) such files. This can usually be done from your File Manager via a right-click option on the file and finding the permissions settings and make sure the execute permission is set.

Dolphin-Permissions.png

Once that has been done you can usually double-click the file to run the application. Failing that you can use the command-line to set the execute permission and run the file. Here is an example using the MuseScore-3.4.2-x86_64.AppImage file:

cd Downloads
chmod +x MuseScore-3.4.2-x86_64.AppImage
./MuseScore-3.4.2-x86_64.AppImage 

Using Flatpak

Flatpak is another method application developers can use for distributing their software. It is similar to AppImage in that flatpak packages do not interfere with system software or files. It does require slightly more setup though.

First you need to install flatpak from the PCLinuxOS repository using Synaptic. Then you need to import the flathub repo before you can start installing applications. Open a terminal and run the following command:

flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

To install an application you will need to download the .flatpakref file for the application. A an example if you download the com.spotify.Client.flatpakref file you can install it by opening a terminal and doing:

cd Downloads
flatpak install com.spotify.Client.flatpakref

To run the application do:

flatpak run com.spotify.Client

Installing an RPM

If you are able to find and download an RPM file for the application then it may be possible to install it on PCLinuxOS. You will need to open a terminal and navigate to the folder containing the downloaded file and then, as root, run an apt-get command to try the installation. For example if you have downloaded a printer driver RPM file called epson-inkjet-printer-escpr-1.6.17-1lsb3.2.x86_64.rpm you need to open a terminal and do:

su
(enter password for root)
cd Downloads
apt-get update && apt-get install epson-inkjet-printer-escpr-1.6.17-1lsb3.2.x86_64.rpm

If the RPM has no dependencies or the dependencies it has can be found in the PCLinuxOS repository then the RPM should install successfully. RPMs built for other distributions might not install due to missing dependencies or different naming conventions in which case you will need to find an alternative method to get the application installed.


Install/Build from source

Sometimes the only option offered by the application developer is to download the source code and build the application. To do this successfully you need to be experienced in building software and understand the concepts and requirements for compiling, linking and installing software. It is a complex process which is why we have distributions with software repositories of ready built software so that users don't need to worry about such complexity. Below is some hints about the common steps needed but we cannot cover every possible case.

Using .tar.gz files

A tarball is simply a compressed archive. Depending on how it is compressed it may have extensions like .tar.gz or .tgz for gzip-compressed archives, and .tar.bz2 or .tbz2 for bzip-compressed archives. Other used archives is tar.xz compression.

The archive may contain anything. Some, mainly proprietary, applications come as compiled binaries, sometimes accompanied by a script or other program that installs and uninstalls them.

But the typical tarball would contain the source code of a program that you must compile yourself. When you unpack it you will usually find both the code and other necessary files in a directory with more or less the same name as the tarball itself (but naturally without the the tarball's extensions).

In that directory (or in a subdirectory) you may also find an "Info" file or an "INFO" file -- and a "README", "readme" or "Readme" file, and sometimes "INSTALL"

Before attempting compile this source code and install you should read files COPYING, LICENSE and INSTALL, README. The last two files should inform you:

  • which dependencies you should install before compile
  • how compile
  • how install

More info can be also on main page website source code.

In most cases three-step recipe

./configure
make
make install 

this is all you need to follow when you compile and install the application. Sometimes a lot more than three steps may be necessary, sometimes less.

But let's suppose that the three-step formula is all your application needs.

The first step is ./configure. The dot in the beginning means "this directory": you want to run a version of "configure" that accompanies the source code of the program you want to compile -- so you have to be in the directory containing the right "configure".
Often that is the top directory with the same name as your tarball, but it may also be a subdirectory further down in the hierarchy. Configure script will check if you have installed the build dependencies and will inform with warnings or errors if something missing. If "./configure" gives up with an error message before finishing you have to look at what happened just before the error and try to find out what went wrong.
More often than not the reason will be a missing dependency that you have to find and install before you rerun "./configure". If you see missing dependencies in output in terminal, try find name packages with a tip -devel inside Synaptic and install. Than try again run script configure.
When the script configure was successful, you should inside source code new file, Makefile, it is needed for compile.

The second step is make. Here you should not add "./" to the beginning of the command. You want to run /usr/bin/make and as /usr/bin is in your $PATH variable you can leave out the path. But you have to remain in the directory where you ran "./configure". Command "make" will read file "Makefile" and compile your source code.
For these two steps you can remain your ordinary user. But then comes make install, and for that you should be root. (Sometimes it may be possible to install a program in your home directory, and then you don't have to be root -- but why would you want to?)

Other files.
Sometimes nothing writes or INSTALL and README files not exists.
Steps looks whichever files you can find, and you can see:

autogen.sh
configure or CMakeLists.txt
Makefile

In this order should be executed.
autogen.sh and configure file you can run from terminal inside source code like this:

./autogen.sh
./configure

autogen.sh will rebuild existing or create new configure file.

For CMakeLists.txt is needed cmake package installed, then you can run commands in terminal inside source code:

mkdir build
cd build
cmake ..

Command "mkdir build" create for you folder with name "build", "cd build" takes you to this folder, and "cmake" command will read CMakeLists.txt which is ".." two levels above inside folders when we are.
Cmake doing the same what configure, this mean checks if you have installed all the dependencies needed to compile source code.

- If you have errors and you have installed all needed dependencies, just try update dependencies, to do this learn how build rpm packages.
- To check missing dependencies you can check "REAME", "INSTAL" files, website with source code, also you can check package on other linux distribution.

Next step is just:

  • make
  • su
  • make install

"make" will compile source code, "su" allows to log on root user, "make install" allows install ready files.
"make install" this is also the crux of problems, when you trying install files:

- other files can overwritten and system can be broken
- none tool does not monitoring what you're trying to install, so you can not also uninstall

However sometimes you can use with source code

make uninstall

but not always working with source code.
Second way to uninstall source code is create file with list all files in system before install source code, and after install source code, the difference file lists can be used to remove files from source code in your system. A third possibility, it use options with configure or cmake,
for example:

Cmake files.

Alternate Installation:

mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/your/path/when/you/want/install/all/files
make
make install (in most case without root)

Beforw install files I suggest create folder where you want install files.
For me this is the best way install files, because:

- you have all in one place / folder
- for uninstall you can just remove folder with app
- your system can be more save when you install apps to /opt folder or /home/your_user_name/your_apps/name_app
- you don't need use root for install files

Example with configure:

./configure --prefix=your_path_where_app_will_installed 
make 
make install
If app not working you can try debug Debug_a_Program#Debug_with_strace_command.

and if you see: app trying open/search from source code in /usr/lib ...
you can try use autoconf before ./configure or other way

autoconf
./configure --prefix=your_path_where_app_will_installed 
make 
make install

Then your app should search own libs where your app ( --prefix=your_path ... )

More options you can find in:

./configure --help
cmake .. --help

Exists also gui tools for cmake,

ccmake ..

and

cmake-gui

(for this you should install cmake-qtgui package from Synaptic)


Python files.

Alternate Installation:

 python setup.py install --user

In this case all will in home folder, but not in one new folder.

I suggest check output from install, because sometimes not all apps are installed in the same place in home folder.

More in https://docs.python.org/2/install/#inst-alt-install


More options you can find in:

 python setup.py --help

Alternate way to remove files with commands (from source code)

 python setup.py install --user --record files.txt
 cat files.txt | xargs rm -rf

After that, are still empty directories.

If you do not have any of the previously mentioned files inside source code, maybe you download portable app ?
Portable apps you don't need compile and install, just run app and enjoy.

Other way is create from source code for example rpm package for PCLinuxOS
http://pclinuxoshelp.com/index.php/Packaging_for_PCLinuxOS