Use the default Ubuntu package manager to easily install and update programs on your system.
One thing that can be difficult to get used to if you are new to Linux is package management. On one hand, the way that Ubuntu handles program installation and upgrading is much simpler than on other operating systems. On the other hand, it's rather different from what you might be used to, so it takes some time to learn the ins and outs. Luckily, all you need to learn is a single tool and you can then apply that knowledge to install and upgrade any of thousands of Ubuntu programs. In this hack, we talk about how to use the default Ubuntu package manager called Synaptic to manage all of Ubuntu's packages efficiently and easily.
The first step is to start Synaptic. Click SystemAdministrationSynaptic Package Manager to launch the program. Synaptic requires root privileges to run, so you will be prompted for your password when it starts. shows the default interface, which has a lot of information on it, but once you are familiar with its functions, you'll find it's not too difficult to navigate.
Figure 6-1. The default Synaptic window
The main window is divided into a few sections. The sidebar displays the different package categories so that you can quickly drill down to a particular group of packages (like games) and not have to read through packages in other categories. The first category, All, displays all packages. On the right side of the window along the top is the list of packages, along with information about whether they are installed and what the latest version is. If you select a particular package, detailed information is displayed in the pane below. Near the top of the screen are a few buttons that correspond to the main actions you'll want to perform when using Synaptic, described next.
Reload the Package List
In Ubuntu, packages reside in what are known as package repositories. goes into more detail about the different package repositories that exist for Ubuntu, but in short, these repositories allow different types of packages to be kept together in a central place. As a user, this means that you don't need to search around on the Internet to find a program; you just find the program in the package manager, and it retrieves that program's package, as well as any other packages that program needs from the appropriate package repositories.
There are often updates to these package repositories as new versions of software are released, so before you do anything else, you will want to get the very latest list of packages and their versions. To do so, click the Reload button at the top of the window. Synaptic will download and update its local database of packages with these new versions . Once it is finished, you are ready to install and update packages.
Figure 6-2. Click Reload to grab the latest list of packages
Install Packages
To install a package in Synaptic, find the particular package in the package list. You can either scroll down manually or, if you know the name of the package, you can start typing in that list to highlight it. If you aren't sure about the category or the name of a particular program, you can also search within Synaptic for it. More information on how to use the Synaptic search feature can be found in "Search for Packages," later in this hack.
After you identify the package you want to install, right-click on it and select "Mark for Installation." If you want to install more than one package, mark them all for installation at this point. Synaptic will prompt you if a package depends on another package to install so that you can approve the installation of it. Once all of the packages you wish to install are selected, click the Apply button, and Synaptic will display a prompt letting you know which packages it will install along with how much space it will need. Then Synaptic will automatically download and install all of the programs onto the system.
Update Packages
One particularly nice feature of a centralized package repository is that it makes upgrading all of the programs on your system a breeze. To update your system, click the Mark All Upgrades button. Synaptic will go through and mark any and all packages that have an update available. Click Apply to apply the changes, and Synaptic will download and install all available updates for your system: from desktop programs to libraries to games. You will want to periodically update the programs on your system to make sure you have the latest bug fixes and security patches.
If you have a lot of packages to upgrade and you are on a slow connection, it can take some time to download everything. Don't worry if you need to shut down your computer and can't finish the download at the momentthe downloads are resumable, so the next time you start the upgrade, it will pick up where it left off. However, note that once Synaptic finishes downloading and starts upgrading the packages, you will want to let it complete the process; otherwise, you may end up with half-installed packages, and it will take further work to complete the installation.
Remove Packages
You can remove packages in Synaptic in much the same way as you can install them. Find the package you want to remove in the package list, right-click, and select "Mark for Removal" if you want to remove the program but leave behind any configuration files you may have changed. You can also select "Mark for Complete Removal" if you want to purge even the configuration files from the system.
Search for Packages
Sometimes you know what sort of program you want to install, but you aren't completely sure what the exact name of the package is. Synaptic includes a search tool to make it simple to find the packages you need. Click the Search button at the top of the window and enter any keywords you want to search for. Synaptic will then display a filtered package list that contains only the packages that match those keywords . You can then more easily locate and install them. To get back to the standard package list, click the Sections button at the bottom of the window.
Figure 6-3. The Synaptic search interface
Edit Preferences and Add Repositories
The above steps are enough to do standard package management, but as you get used to Synaptic you may want to tweak some of its settings. Click SettingsPreferences to see the main preferences window . In the Preferences window, you can configure some of Synaptic's default behavior, such as how many undo operations to allow, what colors and fonts to use for packages, which columns to display in the main window, and the details of your network proxy settings.
Figure 6-4. Synaptic's Preferences window lets you tweak default behavior
You may also want to add extra software repositories to your system. Extra repositories such as universe and multiverse contain a much larger set of software; however, the software is packaged and supported by the Ubuntu community instead of the Ubuntu project itself, so these packages may not be as well tested. To change your repository settings, click SettingsRepositories. shows the main window that displays all of the main repositories you have configured. To add subcategories to a particular repository, select the repository and click Add. To add universe or multiverse subcategories, click their corresponding checkboxes. If you are somewhat familiar with the sources.list layout, you can also click the Edit button to more directly configure the repository settings.
If you have changed repository settings, be sure to click Reload to get the latest package lists from the new repositories you have added.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment