Installing software (packages) on Linux

Before you install any packages it is a good idea to do an update. Now do not start groaning as this rarely takes more than a few minutes and mostly takes seconds. This is not Windows 10.

Like most things Linux there are (at least) two ways to do this, first the easy one.

Click start, system tools, software updater. This will find any updates and offer you the option of installing them later or now. Installing anything on Linux requires you to login as an administrator (if you aren't already) and enter your password. For now click 'remind me later' and we will show you how use the terminal instead.

The terminal and why you should not be afraid of it.

To get the best out of you new Linux distro it is recommended that you learn some basic terminal commands. The terminal is used to access the kernel's shell and that is often referred to as the 'Bash' or 'Bourne Again SHell'. This is because it improved on the original Unix shell written by Stephen Bourne at Bell Labs, then improved by Brian Fox (yeah Linux is quirky like that). This is the most powerful tool in Unix/Linux systems. This is the one normally shown on films with hackers bashing away merrily! Lubuntu's is called LXterminal Other versions are all called something terminal. It can also be accessed in start, system tools.  We should really say menu, system tools as we are now Linux users!

Get into the habit of the command line and using keys and you will soon see how powerful the terminal is. Press 'ctrl' + 'alt' + 't' and a terminal window will pop up. This will show your username '@' your computer name, followed by the prompt '$'. You are now in a terminal session. Now bear in mind everything Linux is caSe Sensitive and type  

sudo apt-get update 

Debian Linux's package tool is entitled A Package Tool or apt. Linux will ask for your password, then it will do it's stuff, you will see a list of repositories scrolling up. What are repositories? These are places where authorised packages and updates are stored. This means that you always know where your updates and packages are coming from. You can also add extra ones and disable any you are not sure of.

Ok, so maybe you use office software a lot. You want an alternative to MS Office. Well Linux has two at least, Open Office and LibreOffice. They both work on Windows too and can save files in .docs and .xlsx formats. We will pick LibreOffice as it is the most used one and was written my some of the team who developed Open Office.

Simply copy these commands into the terminal window.
You can copy with the mouse's right click 'copy', or press 'ctrl' + c.
To paste into the terminal you can click the mouse's middle button, or right click and select paste, your choice.


So let's assume you have done 'sudo apt-get update' and allowed any updates to install first. Let's get LibreOffice-core, that is the package name.

sudo apt-get install libreoffice-core

this will download and install in one go, which is fine for smaller packages.


Let's say you only wanted to download.

wget /home/Downloads www.example.com/somefile.zip

Now install Google chrome on a 32 bit system

wget https://dl.google.com/linux/direct/google-chrome-stable_current_i386.deb

sudo dpkg -i google-chrome-stable_current_i386.deb


if you are on 64 bit

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

sudo dpkg -i google-chrome-stable_current_amd64.deb




Do not worry if your processor is i-Intel, or amd-AMD, it's just the way packages are identified.

Notice the .deb file extension. This is pre-packaged for Debian and Unbuntu variants are Debian based. This means the it knows exactly how to install it.

dpkg  is the Debian package manager, it can install .deb packages like these it is a bit like Windows .exe files.

Linux also deals with .tar (tarball-this puts mutliple files into one container) and .bz (bzip) and .bz2 (bzip2) compressed files easilly. Most Linux files are tar'd and bzip'd so need two operations to unpack them into a new folder.


What if I do not know the name of a package?

The easiest way to install those packages is to use a package manager, this is often called Synaptic and is found in the system tool menu.This has the advantage that you can search by type of program. Lubuntu also has the Lubuntu Software Centre this will guarantee that packages will work first time. But using the terminal will teach you what went wrong and how to fix it to get most packages working as you gain experience.

More about installing packagaes here 


Removing a package

This is equally simple

sudo apt-get remove abiword

and if you want get rid of all its settings too

sudo apt-get remove abiword --purge 

with two --

There is more about uninstalling here



A little more command line fun.
in an open terminal type

cd ~ 

yes, there is a space before ~ (tilde)

hit return and this will Change Directory to your home folder. (my capitals show how to remember the command name.) This is where the terminal starts you off and where you normally work from.

type 

ls

and press return or enter, (I wont mention return again, just do it.)


this will LiSt all the files and folders in the current folder. They are usally colour coded, Blue is folder (directories in Windows speak).

cd Downloads

if it can't find that folder (and you used an upper case D)

cd ~/Downloads

the difference is that ~/ tells Linux it is an absolute reference from your /home/username folder.

If you want to compare this with a graphical representation - click 'menu', 'accessories', 'file manager PCmanFM'. It is similar to Windows' file explorer.

But the command line can do a lot more! There are many more detailed tutorials to do very powerful tasks. You can write whole programs in the command line environment and store them as scripts.

The reason it is so important in Linux to use the terminal is that every file, folder, device, hard drive, sounds card is represented by a file. This is an alien concept to windows users so let's have a peek at it.

cd /dev

ls

this is a list of all devices on your system, can you see  console (you may need to scroll up) console is the terminal you are typing into, dvd and dvdrw is your DVD writer, sda is stationary drives (hard drives), stdin and stdout are how Linux deals with the keyboard, mouse and terminal inputs and outputs, tty is keyboards, it is designed for mutliple terminals! stderr is how errors are reported and logged.


Remember files and folders are the same in Linux except that folders can contain more files and 'Downloads' is not the same as 'downloads'.


Ok now you can close the terminal by typing

exit

or you can force you pc to reboot by typing -

reboot

that is the power at your hands, use it carefully, it will close everything without asking!



Next installing Wifi and other devices 






No comments:

Post a Comment