文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Installing Software in Ubuntu [ZT]

Installing Software in Ubuntu [ZT]

时间:2006-04-13  来源:boks

Installing Software in Ubuntu

The title says this is for Ubuntu Linux, but a lot of these methods are easily adaptable to other Debian-based distributions (Debian pure, Knoppix, Mepis, Xandros, Libranet, etc.). That said, you may have to do some actual adapting--most distros, for example, use su, not sudo.

Here are the main ways to install software in order of ease (easiest to hardest):

1. apt-get/Synaptic/Adept
All Debian-based distros having something called apt-get which allows you to draw from a set of online repositories (stored in the /etc/apt/sources.list file) that house packages (i.e., programs/software). You can enable extra Ubuntu repositories by following these instructions--extra repositories means more software available to install. The apt-get command does several things at once--it downloads the appropriate files, downloads all their dependencies, and installs all of them. A single command installs the software. You don't have to download a separate installer file or unzip or go through a wizard or reboot. For example, if I wanted to install Thunderbird, I'd type these commands in a terminal:

sudo apt-get update
sudo apt-get install mozilla-thunderbird

The first command looks both at what I have installed and what's available in the repositories. The second command downloads the packages needed for Thunderbird and installs them.

Another great thing about apt-get is the ability to install several different packages at once. For example, if I wanted to install not only Thunderbird but Firefox, GIMP, Inkscape, Juk, and Wine, I could type in these commands:

sudo apt-get update
sudo apt-get install mozilla-thunderbird firefox gimp inkscape juk wine

and all of those packages would download and install themselves.

On the Ubuntu forums and in many of the Wiki and other guides, you'll often see instructions to sudo apt-get install some package or other. People will give you commands because it's easier than describing what to click in a graphical user interface, and you can just copy and paste the command.

However, there is a graphical version of apt-get. For Ubuntu, it's Synaptic Package Manager. For Kubuntu, it's Adept. In both, you're essentially doing the same thing. There's also a nice "browsing" environment in which you can search for packages by name and/or description. You can browse by categories of software or look at what's installed versus what's not installed. It's a lot like an ecommerce model of "shopping" for software, except you don't have to pay when you "check out." The equivalent of sudo apt-get update is clicking the Reload button. The sudo apt-get install command, however, is broken into different steps. Instead of listing a bunch of applications you want to install, you mark each one for installation (or removal), and then click Apply Changes or Commit Changes and then everything's downloaded and installed (or uninstalled). I've written another guide on how to use Synaptic Package Manager (complete with screenshots), in case you need pictures to see what it's all about.

2. Manual installation of a .deb
While the Ubuntu repositories are quite extensive (especially if you add extra repositories), they don't cover everything. Sometimes (for the Opera web browser, for example), you have to install a separate file. If you must do so, then try to get ahold of a .deb file. .deb is the native file format for Debian-based distributions like Ubuntu. In fact, if you actually visit the online repositories, you'll notice that the files there are mostly stored as .deb files.

The only difference between manually installing a .deb file and using apt-get to install a .deb file is that apt-get will resolve dependencies for you (if one package needs another to be installed, apt-get will install that "pre-requisite" package). If you manually install a .deb file, you will also have to manually install its dependencies. Don't worry, though--if you try to manually install a .deb file and it has dependencies, you'll soon find out what those dependencies are.

Here's what you should do.

Download the .deb file to your desktop. For this example, let's use Opera. Now, the Opera file that's currently available for Ubuntu has a quite ugly name: opera_8.50-20050916.6-shared-qt_en_etch_i386.deb. There are several ways to deal with this ugly name, seeing as how you have to type in the exact name of the .deb file in order to install it. You can rename it to something simpler (say, opera.deb), you can copy and paste the name, or you can just suck it up and retype it exactly as is. Let's assume, though, that you're going to do it the ugly way. You'd open up a terminal and type these commands:

cd Desktop
sudo dpkg -i opera_8.50-20050916.6-shared-qt_en_etch_i386.deb

That's it... well, as long as there are no dependencies.

3. Manual installation of a .rpm
Occasionally, for a program, you're just not able to find a .deb. There may seem to be, however, a plethora of .rpm files for the program. If you must use an .rpm (not native to Debian-based distros), then use an .rpm. It's a very similar procedure to the .deb one described above, just using a different command (one that converts the "alien" format of .rpm):

One-time deal, just to get alien:

sudo apt-get update
sudo apt-get install alien

Now you can actually use alien:

cd Desktop
sudo alien -i opera-8.50-20050916.5-shared-qt.i386-en.rpm

Again, no dependencies will be resolved.

4. Installing from source
Some people prefer to install from source, but I listed it last because it's what usually scares people off from Linux and makes them think "Why is it so difficult to install software in Linux?" However, it's still an option, and unfortunately it's sometimes the only option, depending on how obscure the software is you're trying to install.

The first thing you'll have to do in Ubuntu is install a meta-package called build-essential (a meta-package isn't a real package--it's a pointer that tells Synaptic/Adept/apt-get to install a bunch of other real packages):

sudo apt-get update
sudo apt-get install build-essential

I can't think of a program off the top of my head that I ever needed to install from source, so I'm just going to make something up--let's call it obscure-1.0. Most likely, it'll come as zipped file called obscure-1.0.tar.gz. Download this to your desktop. Then type this in a terminal:

tar -xvzf obscure-1.0.tar.gz
cd obscure-1.0
./configure
make
sudo make install

Installing from source, like the previous two methods, also does not resolve dependencies--you'll have to install those separately. The ./configure command may indeed tell you what dependencies you need but in a rather peculiar way; for example, it will often return with, say, a rather cryptic "gtk not found," in spite of the fact that the user has gtk installed! In fact, what is actually missing is the gtk development files, libgtkx.y-dev. In general, when it says "can't find library blah" and libary blah is already installed, it usually means that it can't find the blah development files, which can almost invariably be found and installed by searching synaptic for "blah dev."*

Note: in both Ubuntu and Kubuntu, you can "un-tar" (or unzip) a .tar.gz graphically. I've never had to use the tar terminal command. To un-tar a .tar.gz graphically, just open it (double-click usually does this), then click on Extract.

Those are the major ways to install software in Ubuntu. You may find on the Ubuntu forums, however, some great self-installer scripts and other helper programs.

*Most of this paragraph was contributed by GeneralZod from the Ubuntu Forums--thanks, GeneralZod!

Original link:
http://www.psychocats.net/ubuntu/installingsoftware

相关阅读 更多 +
排行榜 更多 +
宝宝切水果安卓版

宝宝切水果安卓版

休闲益智 下载
儿童脑筋急转弯

儿童脑筋急转弯

休闲益智 下载
袭击现场2

袭击现场2

飞行射击 下载