Welcome to the web's most helpful Online Free computer tips and tricks website. This site contains all Latest and Cool Computer tricks as well as some Internet Tricks, Registry tricks, Orkut tricks, Windows customize and Optimization tricks, Computer Tweaks. Solve your computer problems by browsing the website for related Computer solution. All tips work well in both Windows XP as well as windows vista or win 7 operating systems. Need some Computer Help? Then this website suites your must need. These windows and internet Hacks Tricks are safe and free from any Spy ware. Learn All Basic and Advanced computer tips and tricks and be a computer master. All the computer tips at Hack2011 are very interesting and are mainly meant for education purpose. Visit my new Computer Tips Blog and leave your comments and suggestions there. Enjoy your stay and read all the articles posted here.


Using apt-get to Install Programs: A Beginner’s Tutorial

The first time you use apt-get, it will probably be to make sure you’ve received all the pertinent software updates that are available.  To do this, open a Terminal and type the following:
sudo apt-get update
This could take a while, and you’ll likely see something like this, as it checks your files and downloads updates to your software lists.
Updating After Typing sudo apt get update

This command tells your system to run apt-get as the root user, and to update its software archives, which keep a record of versions and names of software that you have in your sources.list file.
When the updating is finished, type the following command:
sudo apt-get upgrade
When you do, apt-get checks for all your installed packages that have updates available.  You’ll see something like this, which will show you all the updatable files, how much you will need to download, and how much extra space the updated packages will take up on your system.
Update Information After Typing sudo apt get upgrade
You may notice that some packages have been left back during the sudo apt-get update operation.  This is because those packages have new requirements or are part of a new distribution upgrade.
When upgrading versions of Ubuntu (for instance, from Maverick to Natty), you’ll see this, but also when a program you have installed requires a library or other requisite program it didn’t require when you installed it.  To get those new requirements, or to upgrade versions of Ubuntu, type the following:
sudo apt-get dist-upgrade
This will go through the exact same process as before, and when you’re finished, all the programs on your computer will have been updatd to the newest versions available in your package lists.

Installing New Programs

In addition to simply updating what’s already there, apt-get lets you install new packages.  It doesn’t let you search quite as easily as the Ubuntu Software Center or Synapt-getic does, but if you know what you’re looking for, it’s pretty simple.
Let’s say you want to install Thunderbird, the Mozilla email client.  Installing it is as simple as typing the following:
sudo apt-get install thunderbird
After it scans your packages, you’ll see something like this:
Thunderbird Install Options
As you can see, in addition to installing Thunderbird, apt-get is also installing another package.  Called “thunderbird-globalmenu,” this package allows Thunderbird to use Ubuntu’s new Global Menu applet.  This is installed automatically, since the package is recommended, and Ubuntu now installs all recommended packages by default.  If you want to install only Thunderbird, you would type the following:
sudo apt-get –no-install-recommends thunderbird
This would install Thunderbird immediately, without even waiting for confirmation, as we’ve seen before.  This is because apt-get only asks for confirmation when packages other than what you request will be installed.  In some instances, even when using the “–no-install-recommends” modifier, apt-get will still install other libraries, as they are required for the program you want to install to operate.
And then there are the suggested packages.  If you go back to the screenshot under the original “sudo apt-get install thunderbird” command, you can see that apt-get is suggesting thunderbird-gnome-support and latex-xft-fonts, which are not required for Thunderbird to run, and are not even as highly suggested as to be in the “recommended” category, but may improve Thunderbird.  If you want, you can go back later and install them as well.

Removing Installed Software

Finally, we can use apt-get to remove software that is currently installed.  Let’s say we don’t want to use Totem, the default media player, any longer.  You would type the following:
sudo apt-get remove totem
This would result in two additional files, totem-mozilla and totem-plugins, being removed as well.  This is because those files require Totem to be installed, so with Totem being removed, they are removed as well.
Totem Being Removed
When you remove a program following this command, you leave behind any configuration options the program may have created.  This is handy if you think you’ll be installing it again at a later point, but in many instances will just be “junk” left behind.  To remove it along with the program, add the “–purge” modifer, like so:
sudo apt-get remove totem –purge
This doesn’t really change the behavior, but you will notice asterisks behind each item to be removed, indicating that the program, along with its configuration files, will be removed.
As mentioned, this is just a simple tutorial for beginning users who are new to apt-get and all that it can do.  If you want to get a more in-depth look, check out the apt-get help file by typing the following into a Terminal:
apt-get –help
This will present you with the shorthand manual for apt-get, without any real detail.
The apt-get Help Screen
Or, for something with more detail, type the following, also in the Terminal:
man apt-get
This will give you the apt-get manual.
apt-get Manual
The manual, which can also be found online, is filled with information on syntax, plus in-depth explanations on what each option does and how it will affect the installation or removal of packages.
And that’s it.  If this was your first attempt at using apt-get to install programs, you’re certainly not a “pro” at it after this guide, but you should have a basic understanding of how it works, and what’s happening when you use it.

No comments:

Post a Comment