Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › Ubuntu Basics: For Beginners
New Posts  All Forums:Forum Nav:

Ubuntu Basics: For Beginners

post #1 of 3
Thread Starter 

Installing/Removing Software:

 

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).

 
Terminal/Command Line Cheat Sheet for APT:
 
Ubuntu comes with a non-graphical, Command Line package manager called "APT". APT is easy to use. You will need to be root or have root privileges to run these commands, to gain root privileges, typically on Ubuntu if you user account has been given full sudo access (the account you create when you first installed, will have this access).
 
You can run these commands by placing sudo in front of them, example, sudo apt-get update, or you can enter a root shell, sudo su, and they will not require sudo to be put in front of them. (if you are in Unity/Gnome/KDE/XFCE, the graphical desktops, you will need to open up a "terminal emulator").
 
  • 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.

 

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:

 

Software Center

 

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:

 

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.

 

 

1. Open up your dash menu (its the Icon on the dock area at the very top of it):
dash-menu1.png
 
2. In the search, enter: User Accounts
user-accounts.png
 
3. Click on the User Accounts to open the program. You will notice once it is open, you can't do anything with it, this is due to this being an ability reserved for root or a privileged user.
useraccount-locked.png
 
4. If you click on the unlock, a window will appear asking you for your password (if you have sudo privileges, it will unlock). Once unlocked you can now add/remove users, Change passwords.
 
useraccounts-unlocked.png
 
5. To add a user, just click on the plus button below. It will ask you for what type of account (choices are standard or administrator, if you don't want the new user to have the same rights as the primary account, choose standard), their full name, and what username they will have.
 
add-user.png
 
6.  Once you have added the new user, it didn't ask you to set a password for this user. If you highlight the new user, and look over in the password field you will see it say "Account disabled". If you click on "Account disabled" a new window will appear.
 
change-password.png
 
In the Action: drop down, you will have a few choices
  • 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).

 

remove-user.png

 

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.

 

change-password.png

 

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
Bazinga Punk
(12 items)
 
  
CPUMotherboardGraphicsRAM
Intel Xeon 3440 AsRock P55 extreme Evga 8800 GT 512 MB Gskill Ripjaws 
Hard DriveCoolingOSMonitor
Western Digital Blue Antec Khuler 620 Ubuntu 11.10 Asus vw264H 
KeyboardPowerCaseMouse
GIGABYTE KM7600 CORSAIR TX 650 Cooler Master 590 GIGABYTE GM-M6800 
  hide details  
Reply
Bazinga Punk
(12 items)
 
  
CPUMotherboardGraphicsRAM
Intel Xeon 3440 AsRock P55 extreme Evga 8800 GT 512 MB Gskill Ripjaws 
Hard DriveCoolingOSMonitor
Western Digital Blue Antec Khuler 620 Ubuntu 11.10 Asus vw264H 
KeyboardPowerCaseMouse
GIGABYTE KM7600 CORSAIR TX 650 Cooler Master 590 GIGABYTE GM-M6800 
  hide details  
Reply
post #2 of 3
Great idea! biggrin.gif

Hopefully some peeps will find this on Google - will tags help that?
 
Black 'n' blue II
(15 items)
 
 
CPUMotherboardGraphicsOptical Drive
Intel Core i5-2515E Acer Aspire 5755G NVIDIA GeForce GT630M  DVD/CD 
OSOSMonitorCase
Linux Mint 17 x64 (Cinnamon) Windows 7 Home Premium 15.6 LED screen Acer Aspire 5755G 
Audio
Intel HD Audio 
CPUMotherboardGraphicsRAM
Core i7 860 @ 1.25V MSI P55-GD65 Xpertvision Radeon HD4850 4GB G.Skill Ripjaw 
Hard DriveOptical DriveCoolingOS
150Gb Velociraptor & 1Tb WD Caviar Black Opticon Lightscribe DVD-RW DL Noctua NH-U12P SE2 Vista Home Premium x64 
MonitorKeyboardPowerCase
Hyundai BlueH H224W 22" LCD Saitek Eclipse II Thermaltake Purepower RX 550 Galaxy III 
MouseAudio
Logitech MX518 M-Audio Delta 44 
  hide details  
Reply
 
Black 'n' blue II
(15 items)
 
 
CPUMotherboardGraphicsOptical Drive
Intel Core i5-2515E Acer Aspire 5755G NVIDIA GeForce GT630M  DVD/CD 
OSOSMonitorCase
Linux Mint 17 x64 (Cinnamon) Windows 7 Home Premium 15.6 LED screen Acer Aspire 5755G 
Audio
Intel HD Audio 
CPUMotherboardGraphicsRAM
Core i7 860 @ 1.25V MSI P55-GD65 Xpertvision Radeon HD4850 4GB G.Skill Ripjaw 
Hard DriveOptical DriveCoolingOS
150Gb Velociraptor & 1Tb WD Caviar Black Opticon Lightscribe DVD-RW DL Noctua NH-U12P SE2 Vista Home Premium x64 
MonitorKeyboardPowerCase
Hyundai BlueH H224W 22" LCD Saitek Eclipse II Thermaltake Purepower RX 550 Galaxy III 
MouseAudio
Logitech MX518 M-Audio Delta 44 
  hide details  
Reply
post #3 of 3
Thread Starter 

AFAIK the tagging system is still broken, I'm unable to add custom tags, and there aren't a whole lot of useful ones for linux/ubuntu except things like "Linux-desktop" and "ubuntu-fiesty-7.0".

Bazinga Punk
(12 items)
 
  
CPUMotherboardGraphicsRAM
Intel Xeon 3440 AsRock P55 extreme Evga 8800 GT 512 MB Gskill Ripjaws 
Hard DriveCoolingOSMonitor
Western Digital Blue Antec Khuler 620 Ubuntu 11.10 Asus vw264H 
KeyboardPowerCaseMouse
GIGABYTE KM7600 CORSAIR TX 650 Cooler Master 590 GIGABYTE GM-M6800 
  hide details  
Reply
Bazinga Punk
(12 items)
 
  
CPUMotherboardGraphicsRAM
Intel Xeon 3440 AsRock P55 extreme Evga 8800 GT 512 MB Gskill Ripjaws 
Hard DriveCoolingOSMonitor
Western Digital Blue Antec Khuler 620 Ubuntu 11.10 Asus vw264H 
KeyboardPowerCaseMouse
GIGABYTE KM7600 CORSAIR TX 650 Cooler Master 590 GIGABYTE GM-M6800 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Linux, Unix
Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › Ubuntu Basics: For Beginners