Книга: Fedora™ Unleashed, 2008 edition

Extracting a Single File from an RPM File

Extracting a Single File from an RPM File

Occasionally, it is useful to extract a single file from an RPM package. You can do so using the command-line version of mc, the Midnight Commander. In Figure 34.1, the Midnight Commander displays the contents of the yum RPM file. The Midnight Commander is a UNIX clone of the famous DOS Norton Commander, a file management utility. Using mc, just highlight the RPM file and press Enter; the contents of the RPM file are displayed. In the listing, you can browse the file structure of the RPM file and use mc to copy files from it.


FIGURE 34.1 A classic two-panel directory view and drop-down menus betray Midnight Commander's DOS inspiration, but it's a full-featured Linux file manager.

You might want to know what an .rpm script will do before you install the application. You can use the F3 key in mc to view the script files. If you want to look at the scripts without using mc, use this command:

# rpm -q --scripts filename > scripts.txt

This command pipes the scripts into a file, where you can examine it with a text editor. You could also pipe it to the less pagination command to view the scripts on your display:

# rpm -q -scripts filename| less

Оглавление книги


Генерация: 2.017. Запросов К БД/Cache: 3 / 1
поделиться
Вверх Вниз