特殊:Badtitle/NS100:OtherWaysToInstall:修订间差异

来自Ubuntu中文
跳到导航跳到搜索
Wikibot留言 | 贡献
无编辑摘要
Wikibot留言 | 贡献
无编辑摘要
 
第75行: 第75行:
*[http://linuxhelp.blogspot.com/2005/12/concise-apt-get-dpkg-primer-for-new.html Concise apt-get / dpkg primer for new users]
*[http://linuxhelp.blogspot.com/2005/12/concise-apt-get-dpkg-primer-for-new.html Concise apt-get / dpkg primer for new users]
*[http://monkeyblog.org/ubuntu/installing How to Install anything in Ubuntu]
*[http://monkeyblog.org/ubuntu/installing How to Install anything in Ubuntu]
[[category:CategoryDocumentation]]


[[category:UbuntuHelp]]
[[category:UbuntuHelp]]

2009年5月12日 (二) 18:18的最新版本

{{#ifexist: :OtherWaysToInstall/zh | | {{#ifexist: OtherWaysToInstall/zh | | {{#ifeq: {{#titleparts:OtherWaysToInstall|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:OtherWaysToInstall|1|-1|}} | zh | | }}

Warning

Installing is not always straight forward. This guide should be if the program you are tying to install cannot be found using Add/Remove found under the Applications menu. A program may require additional packages from the repositories or libraries to be compiled as well. Installing a package from the repositories is the easiest and fastest method of installation.

Installing the standard ways

In Ubuntu there are several standard ways to install software. The most common is to use Synaptic Package Manager, or the command line tools "apt-get", or "dpkg". These tools download .deb files from repositories and install them. Although not all packages are visible after the install, you may need to enable extra repositories to see all available packages. To learn more about these tools see SynapticHowto, AptGetHowto, and AddingRepositoriesHowto. Users can also install .deb files manually. Once the package has been downloaded, clicking on the .deb file will open the Package Installer. The Package installer will let you know if there are any packages that must be installed before the current one can be. OtherWaysToInstall?action=AttachFile&do=get&target=PackageInstaller2.png In the above picture, the pidgin package will not install because the dependency libpurple0 is not installed. Once dependencies are installed, close and reopen Package Installer. You will then be able to install the package. Pidgin is only used as an example, Pidgin can be installed though Synaptic.

UnTaring, Compiling, and Installing

UnTaring

Most times, when software that is not packaged as a .deb file will be distributed as a tar file. Common tar file types include .tar, .tar.gz, .tar.bz, and .tar.bz2. Each of these is handled in the same way. Double click the downloaded file, Archive Manager will open as shown below: OtherWaysToInstall?action=AttachFile&do=get&target=archivemanager2.png Once archive manager is open the files can be extracted by clicking the Extract button. A dialog box will appear asking where you would like to extract your file(s) to. The best place to extract file would be a folder (or directory) in the home folder set up for installing programs. OtherWaysToInstall?action=AttachFile&do=get&target=extractdialog2.png Important: after untaring the file check to see if there is a .bin or .sh file. These files are typically installers and will install programs without the user having to follow the next steps. To get these files to run you may need to change the permissions, to do this right click on the file and select Properties. In the Permissions tab, check the run as executable box. Then double click the file again to run it. OtherWaysToInstall?action=AttachFile&do=get&target=permissions.png

Compiling

Once you have untared the files for the program, you need to compile, or translate the raw code into a form that your computer can read. You can compile software on Ubuntu or any other GNU/Linux distro. Before you proceed you need to install the build-essential package. This contains everything required for compiling on any Ubuntu version to work. It is not part of the default install. To install either use synaptic, or via the command line apt-get.

sudo apt-get install build-essential

After build-essential has been installed, you will need to change the working directory of the terminal to the directory that contains the untared files.

cd /path/to/files

For example, if the files are in /home/user/source, you would use the command

cd /home/user/source

Once the working directory has been changed to the directory where the files have are, you will be able to compile the program. To do this you will need to run two commands:

./configure

This command will create the make file. This command will also notify you of any dependencies that need to be resolved. To resolve any dependencies, search for the packages in Synaptic Package Manager. When you find the package make sure you install both the package and any -dev packages with the same name. Note: Not all program will have a ./configure script. Once the Configure script has done its work, you can run the make file. The make file does the actual compiling of the program.

sudo make

Installing

Now that you have downloaded, untared, and compiled the program, you can install the program. To install the program:

sudo make install

Checkinstall

Because installing using make install can make programs hard to install, you can use checkinstall to make the process a bit easier. First you will need to install the checkinstall and gettext packages:

sudo apt-get install checkinstall gettext

After checkinstall has been installed, it can be used by replacing the above make install command with:

sudo checkinstall packagename

More Information: CheckInstall

Uninstalling

To uninstall a program that has not been installed using apt-get or a similar installer, you must again change the working directory to where the program was installed:

cd /path/to/program

Once you have changed the working directory, you can run:

sudo make uninstall

This command may not work if the developer has not included them in the program.

Packaging Issues

Not all Linux distributions use the same style of packages to install software. Debian based distributions use .deb packages, while Red Hat based distributions use .rpm packages. A tool, Alien, does exists to convert .rpm packages to .deb packages for use in Ubuntu, but it does not always work. Alien is available in the repositories and can be installed using apt-get:

sudo apt-get install alien

The package can then be installed using this command:

sudo alien -i /path/to/package.rpm

Other Links & Sources