[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionLast revisionBoth sides next revision | ||
slackbook:package_management [2012/09/03 22:14 (UTC)] – created with base structure mfillpot | slackbook:package_management [2012/09/17 03:11 (UTC)] – [rpm2tgz] Added original text and formatting mfillpot | ||
---|---|---|---|
Line 2: | Line 2: | ||
====== Package Management ====== | ====== Package Management ====== | ||
- | Package management is an essential part of any Linux distribution. Every piece of software included by Slackware, along with many third-party tools are distributed as source code that can be compiled, but compiling all those thousands of different applications and libraries is tedious and time consuming. That's why many people prefer to install pre-compiled software packages. In fact, when you installed Slackware, the setup program primarily worked by running package management tools on a list of packages. Here we'll look at the various tools used for handling Slackware packages. | + | Package management is an essential part of any Linux distribution. |
+ | Every piece of software included by Slackware, along with many | ||
+ | third-party tools are distributed as source code that can be compiled, | ||
+ | but compiling all those thousands of different applications and | ||
+ | libraries is tedious and time consuming. That's why many people prefer | ||
+ | to install pre-compiled software packages. In fact, when you installed | ||
+ | Slackware, the **//setup//** program primarily | ||
+ | worked by running package management tools on a list of packages. Here | ||
+ | we'll look at the various tools used for handling Slackware packages. | ||
===== pkgtool ===== | ===== pkgtool ===== | ||
+ | |||
+ | The simplest way to perform package maintenance tasks is to invoke | ||
+ | **// | ||
+ | the other tools. | ||
+ | install or remove packages as well as view the contents of those | ||
+ | packages and the list of currently installed packages in a | ||
+ | user-friendly ncurses interface. | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | **// | ||
+ | perform the most basic tasks, but for more advanced work more flexible | ||
+ | tools are needed. | ||
===== Installing, Removing, and Upgrading Packages ===== | ===== Installing, Removing, and Upgrading Packages ===== | ||
+ | |||
+ | While **// | ||
+ | **// | ||
+ | handling odd tasks, such as quickly installing a single package, | ||
+ | installing an entire disk set of packages, or scripting an install. | ||
+ | **// | ||
+ | install, and simply installs them without asking any questions. Like | ||
+ | all Slackware package management tools, it assumes that you know what | ||
+ | you're doing and doesn' | ||
+ | simplest form, **// | ||
+ | list of packages to install, and does exactly what you would expect. | ||
+ | |||
+ | |||
+ | < | ||
+ | darkstar:~# installpkg blackbox-0.70.1-i486-2.txz | ||
+ | Verifying package blackbox-0.70.1-i486-2.txz. | ||
+ | Installing package blackbox-0.70.1-i486-2.txz: | ||
+ | PACKAGE DESCRIPTION: | ||
+ | # blackbox (Blackbox window manager) | ||
+ | # | ||
+ | # Blackbox is that fast, light window manager you have been looking for | ||
+ | # without all those annoying library dependencies. | ||
+ | # | ||
+ | # Also included in this package is the bbkeys utility for controlling | ||
+ | # keyboard shortcut commands from within Blackbox. | ||
+ | # | ||
+ | # The Blackbox home page is http:// | ||
+ | # | ||
+ | Package blackbox-0.70.1-i486-2.txz installed.</ | ||
+ | |||
+ | |||
+ | You can of course install multiple packages at a time, and in fact use | ||
+ | shell wild cards.The following installs all of the //" | ||
+ | packages from a mounted CD-ROM: | ||
+ | |||
+ | |||
+ | < | ||
+ | darkstar:~# installpkg / | ||
+ | |||
+ | |||
+ | At any given time, you can see what packages are installed on your | ||
+ | system by listing the contents of / | ||
+ | which lists not only every application on your system but also the | ||
+ | version number. Should you want to know what individual files were | ||
+ | installed as a part of that package, **//cat//** | ||
+ | the contents of the package: | ||
+ | |||
+ | |||
+ | < | ||
+ | |||
+ | darkstar: | ||
+ | </ | ||
+ | |||
+ | |||
+ | This will return everything from the size of the package, a | ||
+ | description of what it does, and the name and location of every file | ||
+ | installed as a part of the package. | ||
+ | |||
+ | |||
+ | Removing a package is every bit as easy as installing one. As you | ||
+ | might expect, the command to do this is | ||
+ | **// | ||
+ | packages to remove, and **// | ||
+ | check the contents of the package database and remove all the files | ||
+ | and directories for that package with one caveat. If that file is | ||
+ | included in multiple installed packages, it will be skipped and if a | ||
+ | directory has new files in it, the directory will be left in | ||
+ | place. Because of this, removing packages takes a good while longer | ||
+ | than installing them. | ||
+ | |||
+ | |||
+ | < | ||
+ | darkstar:~# removepkg blackbox-0.70.1-i486-2.txz | ||
+ | </ | ||
+ | |||
+ | |||
+ | Finally, upgrading is just as easy with (you guessed it), | ||
+ | **// | ||
+ | package, then removes whatever files and directories are left-over from | ||
+ | the old package. One important thing to remember is that | ||
+ | **// | ||
+ | previously installed package has a higher version number than the //" | ||
+ | package, so it can also be used to downgrade to older versions. | ||
+ | |||
+ | |||
+ | < | ||
+ | darkstar:~# upgradepkg blackbox-0.70.1-i486-2.txz | ||
+ | |||
+ | +============================================================================== | ||
+ | | Upgrading blackbox-0.65.0-x86_64-4 package using | ||
+ | ./ | ||
+ | +============================================================================== | ||
+ | |||
+ | Pre-installing package blackbox-0.70.1-i486-2... | ||
+ | |||
+ | Removing package | ||
+ | / | ||
+ | --> Deleting symlink / | ||
+ | --> Deleting symlink / | ||
+ | --> Deleting symlink / | ||
+ | --> Deleting symlink / | ||
+ | --> Deleting symlink / | ||
+ | ... | ||
+ | Package blackbox-0.65.0-x86_64-4 upgraded with new package | ||
+ | ./ | ||
+ | |||
+ | |||
+ | All of these tools have useful arguments. For example, the | ||
+ | //--root// to **// | ||
+ | packages into an arbitrary directory. The // | ||
+ | will instruct **// | ||
+ | what it would attempt without actually making any changes to the | ||
+ | system. For complete details, you should (as always) refer to the man | ||
+ | pages. | ||
===== Package Compression Formats ===== | ===== Package Compression Formats ===== | ||
+ | |||
+ | In the past, all Slackware packages were compressed with the | ||
+ | **// | ||
+ | good compromise between compression speed and size.Recently, | ||
+ | compression schemes have been added and the package management tools | ||
+ | have been upgraded to handle these. Today, official Slackware | ||
+ | packages are compressed with the **//xz//** | ||
+ | utility and end with .txz extensions.Older packages (and many | ||
+ | third party packages) still use the .tgz extension. | ||
+ | |||
+ | |||
+ | It's worth emphasizing that .tgz and .txz (or, more succinctly, .t?z | ||
+ | files) are very standard, non-unique extensions for compressed .tar | ||
+ | files. This has many advantages; they' | ||
+ | UNIX system (many other package formats require special toolchains), | ||
+ | and they' | ||
+ | |||
+ | |||
+ | However, it is also important to realize that just because all Slackware | ||
+ | packages **are** .t?z files, not all .t?z files are | ||
+ | Slackware packages. **// | ||
+ | magically install just any .t?z file, only Slackware packages. | ||
==== slackpkg ==== | ==== slackpkg ==== | ||
+ | |||
+ | **// | ||
+ | management of Slackware Linux Packages. It originally appeared in | ||
+ | /extra for the release of slackware-12.1, | ||
+ | of slackware-12.2 it has been included in the ap/ series of a | ||
+ | base installation. | ||
+ | |||
+ | |||
+ | Just as you are able to use **// | ||
+ | install Slackware packages from the /extra directory included on | ||
+ | the install media, you can use **// | ||
+ | to pull packages from the Internet and install them. This is | ||
+ | particularly useful for security updates or significant application | ||
+ | upgrades that are posted to the Slackware servers, some of which you | ||
+ | may want to start using on your own system. | ||
+ | |||
+ | |||
+ | Without **// | ||
+ | - Notice in the Slackware changelog that an update has been released. | ||
+ | - Look on your local Slackware mirror to find a download link of the package. | ||
+ | - Download the package from a Slackware mirror to your hard drive. | ||
+ | - Use either **// | ||
+ | |||
+ | With **// | ||
+ | |||
+ | - Notice in the Slackware changelog that an update for **//foo//** has been released. | ||
+ | - **slackpkg** //install// foo | ||
+ | |||
+ | Clearly, this streamlines a fairly common task. | ||
+ | |||
+ | |||
+ | To use **// | ||
+ | with a Slackware mirror by editing | ||
+ | ''/ | ||
+ | the mirror that is associated with your Slackware version and | ||
+ | architecture, | ||
+ | http access, but you must uncomment **only one** | ||
+ | mirror. | ||
+ | |||
+ | Once a mirror has been selected, update the list of remote files by | ||
+ | issuing the initial command '' | ||
+ | should be done any time you notice that a new package has been | ||
+ | posted (regularly checking in with the Slackware changelog is | ||
+ | recommended; | ||
+ | |||
+ | To search for a package, use '' | ||
+ | and to install use '' | ||
+ | |||
+ | Once a package has been installed with | ||
+ | **// | ||
+ | using **// | ||
+ | management commands as detailed in[[# | ||
+ | |||
+ | For more information see the **//man//** pages | ||
+ | for slackpkg(8) and slackpkg.conf(5), | ||
+ | http:// | ||
==== rpm2tgz ==== | ==== rpm2tgz ==== | ||
+ | One of the most ubiquitous package formats for Linux software is | ||
+ | RPM; it's not uncommon to find a developer offering their | ||
+ | application for download as either source code or an RPM file, and | ||
+ | no more. In this case, you would have three options: | ||
+ | |||
+ | - Build your own Slackware package. | ||
+ | - Compile and install directly from source code. | ||
+ | - Convert and install from RPM. | ||
+ | |||
+ | Building from source code or creating your own Slackware package is | ||
+ | usually not as complex as you might think but installing directly from | ||
+ | source code is generally discouraged because there is no easy way to | ||
+ | track what has been installed on your system after issuing the | ||
+ | '' | ||
+ | packages is outside the scope of this chapter. So this leaves us with | ||
+ | the helpful tool **// | ||
+ | |||
+ | **// | ||
+ | Slackware package that can then be installed via | ||
+ | **// | ||
+ | **// | ||
+ | create your own Slackware package but grants you the benefit of | ||
+ | being able to remove, update, and track what you've installed. | ||
+ | |||
+ | |||
+ | <note warning> | ||
+ | |||
+ | While a Slackware package is just a shell script and source code, | ||
+ | an RPM package can by comparison be a maze of dependency listings | ||
+ | and special instructions. Therefore, | ||
+ | **// | ||
+ | especially on very complex applications, | ||
+ | magically resolve dependencies. | ||
+ | |||
+ | </ | ||
+ | |||
+ | To try **// | ||
+ | a trusted source and convert it: | ||
+ | |||
+ | |||
+ | < | ||
+ | |||
+ | rpm2tgz foo-x.x.xx.rpm | ||
+ | </ | ||
+ | |||
+ | |||
+ | The result is a .tgz file, so after the conversion is finished, the | ||
+ | original RPM can safely be discarded. Use | ||
+ | **// | ||
+ | package you've just created, provided that you've | ||
+ | installed all dependency code for the application to actually function. | ||
+ | ====== Chapter Navigation ====== | ||
+ | |||
+ | **Previous Chapter: [[slackbook: | ||
+ | **Next Chapter: [[slackbook: | ||
====== Sources ====== | ====== Sources ====== | ||
<!-- If you copy information from another source, then specify that source --> | <!-- If you copy information from another source, then specify that source --> | ||
- | * Original source: [[http:// | + | |
<!-- Authors are allowed to give credit to themselves! --> | <!-- Authors are allowed to give credit to themselves! --> | ||
- | * Originally written by Alan Hicks | + | |
<!-- * Contrbutions by [[wiki: | <!-- * Contrbutions by [[wiki: | ||