Installing/Removing Software (Click to show)
In Most Ubuntu versions, there are typical several ways to install software, I will concentrate most of this part of the guide on the current Ubuntu release, 11.10 (most of this below should be true in older versions of Ubuntu, but I can not guarantee it).
- apt-get update : This is the "syncing" command, this will fetch the latest list of available software in the repositories. This command should be ran every few days (it automatically is ran upon every boot up, as the update-manager syncs to see if there are any updates or if you have opened up software center).
- apt-get install <package> : This command will download, and install the package you requested, and its dependencies. You do not need to know the exact name of the package, but if it fails to find the package in question, try running the update command. If that does not find it, you can search APT's cache list of available software. You can also install multiple packages from the same line: apt-get install pack1 pack2 pack3.
- apt-get install -f : this command is useful if you ever get the dreaded "broken files". Broken files happen in several ways, forcing an install via dpkg/apt, when not all the dependencies for that program can be met, a dist-upgrade/upgrade/install is interrupted by the user/power outage/freeze/crash/etc, a bad sync/install from a "iffy" source, a bad merge into sources.list. This command will attempt to fix these problems, by attempting by recovering from it, installing the missing dependencies, syncing to the repository again, etc. it will not remove any packages, but it might add more. Most of the time this should fix any of the "broken" package errors. If you take a cautious approach in installing software, this should rarely happen.
- apt-cache search <search filter> - this can be used in a few ways, the simplest way, is to use a simple search term like "browser" "graphics" "audio", etc, then it will attempt to find packages that meet that criteria, either by name, or in its description or what group it is apart of.
- apt-get remove <package> : If you ever need to remove a package.
- apt-get --purge remove <package> : This command is similar to the one above, but with the --purge switch, it will remove configuration files as well.
- apt-get autoclean : everything apt-get downloads/installs on your computer, it stores the package in a "cache" located in /var/cache/apt/archives. Usually this is not a problem, but if you have not dedicated enough space to you / partition, you can run out of space, causing other issues in the file system. This command will only remove the packages from this cache, that are no longer installed on your system.
- apt-get clean : This is similar to the command above, but instead of just removing packages to programs that are no longer installed, it empties out the cache of all packages. (note this does not effect what you have installed, this is just sort of a "backup" cache, to save on bandwidth, if you remove the program, it can be restored later without the need to redownload it).
- apt-get upgrade : This command will update all out of date packages on your system inside the release you have (if you are on Ubuntu 11.10, then it will only update packages that are available for Ubuntu 11.10), it will not remove or add any additional packages. Some refer to this as the "safe upgrade", this is similar to what the update manager does.
- apt-get upgrade <package> : If you don't want to upgrade all the packages on your system, but you would like to upgrade one individually.
- apt-get dist-upgrade : This command is probably responsible for the most headaches. This command will sync with the repository to find out the latest release, alter your sources.list to the next/latest release, sync to those repositories, and upgrade your system to the next/latest release. This command will alter configuration files (most of the times it will prompt you first before it applies changes), add and remove packages to satisfy any new or changed dependencies. This command can cause a long sleepless night, so use it with caution. (the update manger can do this too, but it will ask you if you want to switch to the next release and upgrade).
This isn't a complete run down of what APT is capable of, this is the most commonly used commands, if you wish to know more about APT and its abilities, reference the documentation for APT on Ubuntu's/Debian's websites.
Graphical Software Management:
In Ubuntu 11.10, there are two programs that are graphical that help you install/remove/upgrade the software on your system. The first one i will cover is the Update manager.
This Program runs in the background, and will check for updates every once in awhile, if it finds any it will notify that you have updates available (you can disable it so it does not check or notify you that you have the updates available, but I do not recommend you do this). Its pretty self explanatory what it does, it checks for updates, shows the is that is available, it groups them based on their "importance", you can choose which "group" to install or just which packages to update. It also gives you a description for what the update is for, (sometimes but not always, it will say what it fixes). You can bring up the program manually as well, if you wish, but most time it sets quietly in the background. Same as with APT, your user will need to have "root privileges" to update your system, this program will ask for your password.
The second program is the Software Center, this is where the real magic happens:
In the Software Center, You are greeted by a welcome screen. It will display the "latest available software" both free and paid (Ubuntu has started to offer paid content through the software center). It will also allow you to see the Top Rated programs that are available.
The Software center is unique in several ways,compared to other Graphical Software Management Tools (like synaptic, and aptitude-GTK).
- Ratings - The software center allows you to rate the software, it use a "star" rating system, the more stars a software has, the "better" it is, in the eyes of the community (as this a community driven feature, other users rate the software).
- Paid Content - AFAIK this is the first graphical/non-graphical package manager that offers Paid Content. This brings more of a "app store" feel to the program. Not saying this is a bad thing or even a good thing. It offers not an extreme selection of paid content, a few games, programs, magazine subscriptions, books, etc. I see this as a step in the right direction, as it can potentially bring in more proprietary support from third party developers. If you purchase something from here, it is forever available to you from the software center.
- User Feedback - Not only can you "rate" the software, you can also leave and read feedback about the software from other users.
- Sync/Manage Software - this feature is quite new, and isn't quite "feature complete" yet. If you have registered for any ubuntu service, like Ubuntu One or have purchased software from the Software Center, you already have "Ubuntu's One Login" (which basically allows to use the same login for all ubuntu services). You login into your One account thru the software center, from there if you have logged into your other installs on other computers, you can manage the software that is installed from that computer remotely, or "sync" what software you have on one machine to the other. Like I mentioned this "feature" was just added in 11.10, so it has a "quite not done" feel to it, hopefully in future releases they expand and integrate this feature more with other Ubuntu Services. Unfortunately this feature only works with Ubuntu's provided repositories (so no third party repositories or PPA's), so you can not sync software from those yet.
- History - This isn't exactly "unique" to the software center, but I feel it is at least worth mentioning. In synaptic, it only "tracked" synaptic had done, It appears with software center, it tracks every thing the other's have done (apt-get/synaptic/aptitude), and displays it in sections of all changes/installations/updates/removals. Not sure how useful this feature will be to everyone, but it gives you an idea when you installed or removed something.
Outside of those features, the Software Center acts more or less, like other graphical front ends. You can install and remove packages (as far as I can tell, Software Center is not capable of updating/upgrading current packages, that it still relies on the Update manager to do this, hopefully in future releases, this is added). You also have the ability to "search" for packages meeting your search criteria, it is a tad bit more robust than the one found in "synaptic" and apt-cache search. You can also manage your software sources from here (adding third party repositories, PPA's, removing PPA's/Third Party repo's). Software Center has also replaced the graphical standalone installer, like GDEBI. So if you download/create a .deb Package and double click on it in file manager, it will open up in software center, giving you the option to install (it will also inform you if this package is in the repositories, and it recommend installing from there). Similar to APT and Update Manager, you will need to have "root privileges" to install or remove programs from your system.
There are other "package management" options I did not discuss here (even tho i have mentioned them), like dpkg (this program predates APT by a few years, it serves it purposes, but for the most part, most users will never use it, or use the APT equivalent to its commands), there is also synaptic and aptitude, i did not include these two here, as of the writing date, Ubuntu 11.10 no longer includes them on a default install, as Software Center has become stable and feature complete enough to replace synaptic, and APT can fill any role that aptitude was able to. If you wish to install them, that is your choice (they are still maintained in the included repositories, not sure if this will change at a later date).
Useful Terminal/Command line tools/programs/commands:
Usefule Terminal/Command line tools/programs/commands (Click to show)
These are typically non-graphical (no GUI) tools/programs/commands that require the use of a terminal emulator (if you are in the Desktop), if you are not in the Desktop, you will already be at a command line.
- sudo : This is a program, that gives you temporary elevated privileges. By default, Ubuntu uses sudo to give a unprivileged user, root privileges to accomplish all task that root can without switching users. When you first install Ubuntu, the account you setup, is added to the "sudoers" file, giving it full access, as long as "sudo" is used in front of the command/program wanting/needing to be ran as "root". example: sudo nano /etc/fstab . Here I'm using sudo to give nano root privileges so it can edit a file in /etc, called fstab.
- nano : I disagree with my fellow linux users on choice of a basic terminal/command line text editor. nano is very basic, you can use it to make quick edits to bash scripts, config files, or anything else that is text orientated. example: nano ~/backup.sh , here i'm telling nano to open up a file in my homefolder called backup.sh, if it exist, it will open the contents of it here, if it doesn't, when i go to save it will create it. additional commands: ctrl+o will save your changes, ctrl+x will exit out of nano (note: these are both keyboard shortcuts).
- chmod +x <filename> : Unlike "other" operating systems, when you download a program or create a file, it doesn't automatically have the ability to "execute", meaning the system will prevent you from running it, even if you are trying to execute it yourself, so you have to first give the file "permission" to execute (this is a security feature, to prevent things like files that might be download by dubious websites from running without your permission). If you need to give a file execute ability, there are a few ways to do this, but this is one of the easier ways IMHO. example: chmod +x ~/backup.sh , basically this gives the file called backup.sh in your home folder, the ability to execute now (note if you use sudo before this, then only "root" and privileged users can run execute the file). so now, if you go to run this, sh ~/backup.sh , it wont spit out that error that it doesn't have that ability. Comes in handy if you create bash scripts, download .run files, or stand alone binaries.
- ls : this will list the contents of a directory, if you run ls -l , the -l switch will give you information about the contents of the folders (like creation date, file size (in bytes), the owner user name and group name, and the permissions give to the file. Ubuntu color codes the ls command, blue is typically folders, green i think is text files, red is I believe binary files, purplish is I believe picture files, there are more colors, I will find out what each mean and edit the post to include them. ls -a will display "hidden" files and folders in the listing. (a hidden file or folder in linux begins with a period).
- dir : This command can also be used to get a "directory listing" like ls can, but it is not color coded by default.
- cd <directory name> : If you ever used dos, you should remember this command. cd changes the directory you are currently in. cd .. will take you to the parent of your current directory, cd ~ will take you to your home folder, cd /, will take you to the root of the filesystem, cd ~/Downloads, will take you to the Downloads in your home folder. You don't have to use "absolute paths" with cd, like cd ~/Downloads/pics, if you are already in /home/Downloads, you can just type in cd pics, and it will take you to that subdirectory.
- ~ : The tildy isn't really a "command" or "program" but it is important to note, it is a "shortcut" of sorts to the home folder of the current user. so doing, cd ~, will take you to your home folder, but doing sudo cd ~, will take you to roots home folder. So if you are writing a bash script/cronjob/etc, that this shortcut might not be able to be used, and you will have to use the absolute path of /home/<username>/.
- su <username> : If you use multiple user accounts on your system, to alter files, or whatever you are doing. in the terminal, you can switch the user to some one else, giving you them their permission and privileges, among other things like group ID's, etc.
Manage/Add/Remove Users (Click to show)
If you ever need to manage/add/remove a user from your system, Ubuntu comes with an easy to use GUI to accomplish this.
- set password now: this is if you want to set the password yourself, and then allow them the option to set it later.
- choose password at next login: this allows the new user to select what they want their password to be the next time they attempt to log on to the computer.
- log in without password: a passwordless login (when the computer boots, and that was the last user logged in, it will immeditatly go to the desktop).
- enable this account: similar to above, but this account will have no password set or asked for.
7. Once you have set the password or give the user the choice to set their own, or no password at all, the new account will be enabled, and will have their own /home folder.
8. Removing a user. Simply highlight their name in the list, and click on the minus key, a new window will appear, asking you if you want to delete their files (their /home folder), keep their files (in the event you want to re-add them later), or to cancel. (if you don't want to delete the account, but merely disable it, preventing the user from logging in, you can click the password field in login options, and in the action drop down choose disable).
9. Changing existing users password: Highlight their name, look to the right, where it says "login options" and click on the "*****" after the password. A new Window will appear, asking you how you want to handle the password change.
This is similar to above when enabling/setting password for a new account.
I will be adding to this guide, so keep tuned :), if you have something that should be added, or believe I'm in error about something, Please PM me.
Edited by Transhour - 12/7/11 at 6:29am