Installing Software Over a Terminal

Courant
With the advancements in package management made in the past few years many people have overlooked the old standby commandline apt-get and apt-cache in favor of graphical tools like Synaptic, but sometimes you just need to install something from the terminal, and this brief tutorial should help you learn a little about these commands. First and foremost, apt-get will require root access.

You can gain root access either by typing 'su' at the terminal and entering the root password when prompted, type 'sudo' and a space before the command, which will require that your account has rights to use sudo (this will require that you type in YOUR password at the prompt, or simply by logging in as root from the start. The second command, apt-cache, does not require root access and can be run from any account on the machine. First you will want to make sure your repository is up to date by typing the command 'apt-get update' or 'sudo apt-get update' This will update your machine's information as to what new and upgraded packages are available.

If you simply want to update the software already installed on your machine you can now enter the command 'apt-get upgrade' or 'sudo apt-get upgrade' Alternatively replacing upgrade with dist-upgrade will do a full distribution upgrade. This is useful if you are switching from one major version to another like from Debian 4.0 (etch) to Debian 5.0 (lenny) If you would like to install a new package you can use the command 'apt-cache search [your search term]' where '[your search term]' is whatever you want to search for.

For example, if I want to find out what package to install to get Firefox I would simply use the command 'apt-cache search firefox' and it will return a list of all packages related to the search term "firefox" You can also append '| more' or '| less' after the command to scroll through the results. Once I find the package I was looking for I can then install them by using the command 'apt-get install [package name]' or 'sudo apt-get install [package name]' where '[package name]' is the name of the package (left most portion of the list returned from apt-cache search) For example, if I find that the package for Firefox is called 'firefox-3.0' I can use the command 'apt-get install firefox-3.0' or 'sudo apt-get install firefox-3.0' to install it. This will go through the installation process and will most likely ask you some to confirm the installation using the 'y' or 'n' key for Yes and No respectively.

Once installed you should now see firefox in your window manager's menu screen. You can also run it by typing 'firefox &' in a terminal window inside of your window manager. Lastly, if you logged in as root to perform this installation it is very important to log out by using the 'exit' command. Root access in Linux can be a very dangerous thing and can cause big enough problems to warrant a reinstall if you mess up the wrong thing.

Published by Courant

A college student who love technology and minimal running. I have run in everything from Newtons down to Luna Sandals and love to share my minimal running knowledge  View profile

To comment, please sign in to your Yahoo! account, or sign up for a new account.