Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Linux Timesaving Techniques For Dummies.pdf
Скачиваний:
59
Добавлен:
15.03.2015
Размер:
15.98 Mб
Скачать

19 Keeping Up-to-Date

with apt and

Technique Synaptic

Save Time By

Automating software updates

Using Synaptic and apt to resolve RPM package dependencies

Using a software repository to find tons of opensource software

Adding repository keys to your system key ring

Keeping your software up-to-date is important. A new release of your favorite software will likely include new features, fixes for old bugs, and most importantly, fixes for security vulnerabilities. Open-source

software evolves astonishingly fast. Given that most, if not all, of the software on your Linux computer is of the open-source variety, keeping current can be quite a chore. Although you could keep a list of your software packages and check the sites regularly for more recent versions, we know a better way.

apt (Advanced Package Tool) is a handy tool that can save you tons of time. apt by itself is good; apt coupled with Synaptic is even better. Synaptic is an attractive, friendly wrapper around the apt command line tool. Synaptic knows how to check your installed RPM packages against the most recent versions, download any updates, and automatically resolve package dependencies.

If you’ve installed many packages with RPM, you know what dependencies are: When you install a new software package, that package may require (or depend on) other packages. If you use RPM by itself, you have to satisfy a package’s dependencies before you can install the package (that is, you have to install all the other software required by the package that you really want to install). Technique 17 explains how to use RPM from the command line. Quite often, a dependency has dependencies of its own. The chain of dependencies can get very long, very fast. With Synaptic, the frustration and time lost tracking down and installing all the program dependencies are gone — Synaptic handles the process for you.

In this technique, we introduce you to Synaptic. Installing and updating your software has never been so quick or easy.

Setting Up Synaptic and apt in a Snap

apt is a wrapper around the command line tool, rpm. Synaptic is a graphical wrapper around apt. You already have rpm (it’s a fundamental Fedora

120 Technique 19: Keeping Up-to-Date with apt and Synaptic

component), but you need to install apt and Synaptic before you can use the three tools together to make quick work of package management.

If you’re using SuSE, use Google to search for the most recent versions of the apt and synaptic RPM packages. You’ll need two packages — the apt package and the synaptic package.

To download and install apt with Fedora, follow these steps:

1. Open your favorite browser and surf to

apt.freshrpms.net

2. Click the link to Fedora Linux 1 (rpm 4.2.x).

This moves you to the Index of /pub/freshrpms/ fedora/linux/1/apt.

3. Click the link to download the most recent

RPM package. Right now, that is

apt-0.5.15cnc3-0-1.fr.i386.rpm

The Download Manager opens (assuming that your browser offers a download manager).

4. Save the RPM package to your desktop.

5. Close the Download Manager and minimize the Web browser (you’ll be using it again in a minute).

6. Click the RPM Package icon on the desktop.

7. If you’re not already logged in as the superuser, a query window opens, prompting you for the root password. Enter the password and click OK.

The RPM graphical installer opens, telling you that the system is being prepared for package installation.

8. When the preparations are complete, click

Continue.

The apt package installs.

Now, download the RPM package for Synaptic:

1. Reopen your browser and surf to

dag.wieers.com/packages/synaptic

2. Click the download link for

synaptic-0.45-0.rhfc1.dag.i386.rpm

3. Save the package to your desktop.

4. Close the Download Manager and the browser window, and return to the desktop.

5. Click the desktop icon for the Synaptic RPM package.

The graphical installer begins. Again, you may be prompted for the root password.

Now that you have apt and Synaptic installed, you’re ready to update your system.

Keeping Up-to-Date with apt and Synaptic: The Basics

Using apt with Synaptic is a quick and easy way to keep your system software up-to-date. To run Synaptic and do a package update, follow these steps:

1. Open a terminal window and give yourself superuser privileges with the su command.

2. Type the following command and press Enter:

# synaptic

Synaptic starts and, after a short delay, displays the packages currently installed on your computer (see Figure 19-1). The package list is sorted by category and displayed in a tree-type control panel in the middle of the screen. Click the little arrow to the left of a category to view the packages within that category.

When Synaptic starts, it displays all the packages available at the default repository (you can add more repositories later).

Keeping Up-to-Date with apt and Synaptic: The Basics 121

Figure 19-1: The Synaptic startup screen.

3.To filter the choices in the Package list, choose one of the following options from the Show drop-down list (shown in Figure 19-2):

Installed Packages: Show only the packages that are currently installed on your computer.

Not Installed Packages: Show packages that are in the repository but not currently installed on your computer.

Tasks: Show groups of related but otherwise independent packages (such as a complete office or personal productivity suite).

Upgradable (sic): Show currently installed packages for which newer versions are available.

Broken: Show packages that are currently installed but have unsatisfied dependencies.

Programmed Changes: Show packages selected for installation, upgrade, removal, or repair.

New in Archive: Show packages that have just been added to the archive list on your computer.

One of the most useful features is the Upgrad(e)able filter. Select Upgradable from the Show drop-down list and then click a tree control to see the outdated packages in that category (see Figure 19-3).

• Figure 19-2: The package display options.

Figure 19-3: Outdated packages.

4.When you find a package that needs to be updated, click the package name to highlight it.

5.Click the Upgrade button (in the lower-right corner of the screen).

Sometimes a package might be changed to include another package in its installation. If this is the case, you need to authorize apt to remove the old package before it can update to the new version.

122 Technique 19: Keeping Up-to-Date with apt and Synaptic

In some cases, the package that needs to be removed isn’t included in the new package, but it’s blocking the installation anyway. You may need to reinstall a package after the updating is complete.

6. Depending on the package you’re updating, a

dialog may appear that shows other changes

 

that you must authorize. If the dialog does

 

appear, review the additional changes and

 

click the Apply button.

 

For example, the new version of a package may

 

have new dependencies that were not required

 

by the currently installed release. Or, you may

 

have to upgrade other packages at the same time.

 

The packages to be upgraded are highlighted in

 

the list, as shown in Figure 19-4.

• Figure 19-5: The Summary dialog.

 

Figure 19-4: Highlighted packages are ready to upgrade.

7.To carry out the upgrade (and any related changes), click the Execute button (on the toolbar).

The Summary dialog opens (see Figure 19-5).

8.Click the Proceed button in the Summary dialog to continue.

The new versions are downloaded, and the upgrade begins — pretty simple.

Upgrading Your Entire

Computer

Synaptic can install and upgrade individual packages, but its real power lies in its ability to upgrade your entire system with just a few quick clicks of the mouse. Synaptic offers two system-update modes:

Dist Upgrade: If you want to upgrade to the most recent versions of all the packages currently installed on your system, click the Dist Upgrade (Distribution Upgrade) button on the toolbar. Dist Upgrade updates all the packages on your computer and adds any new software needed to satisfy program dependencies.

Upgrade All: If you’re short on disk space, use the Upgrade All button to upgrade only those packages that can be freshened without installing extra software required by new dependencies.

Соседние файлы в предмете Операционные системы