红联首页 凝聚Linux人的力量
菜鸟过关 | 精华文档 | 同城人(交友) | 我与Linux的故事 | Linux新闻 | Linux视频 | Linux人才 | 软件下载 | 大学校园 | English
发新话题
打印

Ubuntu 7.10Advanced package management

Ubuntu 7.10Advanced package management

Several other package managers exist in Ubuntu. These contain more advanced features than Add/Remove Applications.

Synaptic Package Manager
Synaptic is an advanced package management application that can install and remove every package available to your system. The interface is graphical like Add/Remove Applications, but presents much more information and gives you complete control over the software on your computer.

To launch Synaptic, press System → Administration → Synaptic Package Manager. You need administrative access to use Synaptic. See Administrative Tasks for more details.

If you know the name of the package you want to install or remove, click the Search button, and enter the package name or a short search term. You can also search for packages by description (for example, you can find all packages mentioning “arcade” or “mathematics”).

Use the categories on the left to filter the list of packages. To return to the list of categories after doing a search, click Sections.

To install a package, click the box next to it and choose Mark for installation. If you change your mind, choose Unmark.

To remove a package that is already installed, choose Mark for Removal.

When you have finished, click Apply and Ubuntu will make the changes you selected. If you do not want to make any changes, close the window instead.

Command-line package management with APT
If you are comfortable using the Terminal, you can use apt (Advanced Packaging Tool) to install or remove software. You need administrative access to use apt. See Administrative Tasks for more details.

To update the local list of packages, enter in a Terminal:

sudo apt-get update
To install all available updates:

sudo apt-get upgrade
To search for a package:

apt-cache search package
To install a package:

sudo apt-get install package
To remove a package:

sudo apt-get remove package
To list other apt commands and options:

apt-get help
Installing a single package file
The preferred method of installing programs is via the package managers described in this chapter. However, although the Ubuntu package archives are very large, it is possible that you may wish to install a package that is not available in the Ubuntu archives. If this happens, you can also download and install files from websites.

It is important to ensure that any files you download come from a safe source before installing them.

There are many different kinds of Linux package files. Most of these are associated with the package managers of specific Linux distributions. Examples are Debian Package files (.deb files), RPM Package Manager files (.rpm files), Tarballs (.tar files) and .run files.

This section deals with installing these single files.

It is not guaranteed that these files will be compatible with your system and you will not receive security updates if you install these files. For these reasons, if you wish to install a program, always use a native Ubuntu package of the application available through a package manager, if there is one available.

Install/uninstall .deb files
These files are Debian packages. The package files associated with Ubuntu have the .deb suffix because of Ubuntu's close relations with the Debian GNU/Linux distribution. You will need administrative privileges to install a .deb file. See Administrative Tasks for more details.

To install a .deb file, double-click on it. If you prefer using the Terminal, enter:

sudo dpkg -i package_file.deb
To uninstall a .deb file, deselect it in your package manager. Or from a Terminal, enter:

sudo dpkg -r package_name
Convert .rpm files to .deb files
Another type of package files is Red Hat Package Manager files which have the .rpm suffix. It is not recommended to install these on an Ubuntu system. In almost all cases, a native Ubuntu .deb package is available. However, if absolutely necessary, an .rpm file can be converted to a .deb package using the program alien. The resulting .deb file will be installed using dpkg as indicated above.

1.     Install the alien package.

2.     In a Terminal, enter:

sudo alien package_file.rpm
Install tarballs
Files with the .tar, .tgz, .tar.gz or .tar.bz2 suffix are package files known as tarballs which are widely used in Linux and Unix.

If there is no native Ubuntu package available in any of the Ubuntu repositories, you can use the command line to install or uninstall the tarball file.

The first step will be to uncompress and extract the tarball. If it is a .tgz or a .tar.gz, in a Terminal enter:

tar xfvz tarball_name
Then it will be necessary to follow the instructions that come with the package. These are generally located in the extracted tarball in a file called README or INSTALL.

Tarballs often contain the source code of the program, and need to be compiled in order to be used.

Compiling programs requires some packages that are not installed by default. You can install these all at once by installing the build-essential package.

Install .run packages
Sometimes you may need to install software (most often a game) which has been packaged as a .run file. These files contain the software and a small program to install the software.

Follow the procedure below to install software packaged in a .run file:

1.     Find the .run file in the File Browser

2.     Right-click the file and select Properties

3.     Under the Permissions tab, make sure that Allow executing file as program is checked and press Close

4.     Double-click the .run file to open it. A dialog box should appear

5.     Press Run in Terminal to run the installer

6.     A Terminal window will open. Follow any instructions on-screen to install the program

Once you have started the installer, it may take a while to display an installation screen. This is normally due to the installer extracting all of the files from the .run file ready for use.

TOP

发新话题