不会装软件:(

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
bug
帖子: 56
注册时间: 2005-10-20 10:32

不会装软件:(

#1

帖子 bug » 2005-11-19 16:11

兴冲冲的下载的fcitx,wine,realplay,都是tar.bz2格式,以为linux下用
sudo tar jxvf ***.tar.bz2
sudo make install
或sudo ./configure
或make
就可以安装,结果在输入make后提示错误,我该怎么办?是没有安装gcc编译器吗?在ubuntu5.10默认安装是没有吗?还是其他问题。
是不是在linux每安装一个软件都要用vi看install文件,没有怎么办?有都看哪些地方,之后怎么做?所有的软件都能找到rpm包吗?
上次由 bug 在 2008-06-15 15:04,总共编辑 1 次。
头像
内存不足
论坛版主
帖子: 3277
注册时间: 2005-08-18 18:43
联系:

#2

帖子 内存不足 » 2005-11-19 16:19

终端里直接

sudo apt-get install realplay
就可以了,不用编译

fcitx也可以直接安装,
$sudo apt-get install fcitx
$sudo sh -c " echo 'export XMODIFIERS=@im=fcitx ; export GTK_IM_MODULE="fcitx" ; fcitx ' > /etc/X11/Xsession.d/95xinput "
$sudo chmod +755 /etc/X11/Xsession.d/95xinput

wine不会 :P
໌→ iCookie Gtk Theme
໌→DropPlusBluetheme
กรัก กรัก`菠萝
头像
laborer
帖子: 1016
注册时间: 2005-10-25 11:15
联系:

#3

帖子 laborer » 2005-11-19 17:21

wine用apt也能装的,不过那个版本不够新。
bug
帖子: 56
注册时间: 2005-10-20 10:32

#4

帖子 bug » 2005-11-21 16:44

我的机器没有连网,apt-get是不是不可行,只能手动安装?
rods
帖子: 181
注册时间: 2005-11-19 18:43

#5

帖子 rods » 2005-11-21 17:19

root@ubuntu:~# sudo apt-get install realplay
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
E: 无法找到软件包 realplay
头像
laborer
帖子: 1016
注册时间: 2005-10-25 11:15
联系:

#6

帖子 laborer » 2005-11-21 17:43

没有联网是麻烦一些,但也不难,举个例子,比如我要装gcc-2.95,首先:

代码: 全选

$ sudo apt-get install gcc-2.95 -s
Reading package lists... Done
Building dependency tree... Done
The following extra packages will be installed:
  cpp-2.95
Suggested packages:
  gcc-2.95-doc task-devel-common
The following NEW packages will be installed:
  cpp-2.95 gcc-2.95
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Inst cpp-2.95 (1:2.95.4-22 Ubuntu:5.10/breezy)
Inst gcc-2.95 (1:2.95.4-22 Ubuntu:5.10/breezy)
Conf cpp-2.95 (1:2.95.4-22 Ubuntu:5.10/breezy)
Conf gcc-2.95 (1:2.95.4-22 Ubuntu:5.10/breezy)
apt会自动计算依赖关系,然后告诉你哪些包需要装,在这个例子里面,apt提示

代码: 全选

The following NEW packages will be installed:
  cpp-2.95 gcc-2.95
也就是说为了装gcc-2.95需要安装cpp-2.95和gcc-2.95,你把这个记下来,然后到能上网的地方下载相应的包。你可以去http://debian.cn99.com/ubuntu/pool/里面找你要的包,比如gcc-2.95就在http://debian.cn99.com/ubuntu/pool/univ ... 4_i386.deb。下载完之后就可以通过

代码: 全选

dpkg -i *.deb
来安装,也可以把这些deb拷贝到/var/cache/apt/archives/,然后就像正常用apt装软件一样安装

代码: 全选

sudo apt-get install gcc-2.95
bug
帖子: 56
注册时间: 2005-10-20 10:32

#7

帖子 bug » 2005-11-23 8:23

非常感谢laborer的帮助,不大清楚apt与dpkg的语法,特查了一下,顺便贴了过来,给和我一样的新手一点帮助。
bug
帖子: 56
注册时间: 2005-10-20 10:32

#8

帖子 bug » 2005-11-23 8:23

APT and Dpkg 快速参考表

--------------------------------------------------------------------------------


APT and Dpkg Quick Reference Sheet

Matthew Danish
Common APT usage
apt-get install <package> Downloads <package> and all of its dependencies, and installs or upgrades them. This will also take a package off of hold if it was put on. See below for more info on hold.

apt-get remove [--purge] <package> Removes <package> and any packages that depend on it. --purge specifies that packages should be purged, see dpkg -P for more information.

apt-get update Updates packages listings from Debian mirrors, should be run at least once a day if you install anything that day, and every time after /etc/apt/sources.list is changed.

apt-get upgrade [-u] Upgrades all packages installed to newest versions available. Will not install new or remove old packages. If a package changes dependencies and requires installation of a new package, it will not be upgraded, it will be put on hold instead. apt-get upgrade will not upgrade packages put on hold (that is the meaning of hold). See below for how to manually put packages on hold. I suggest the `-u' option as well, because then you can see what packages are going to be upgraded.

apt-get dist-upgrade [-u] Similar to apt-get upgrade, except that dist-upgrade will install or remove packages to satisfy dependencies.

apt-cache search <pattern> Searches packages and descriptions for <pattern>.

apt-cache show <package> Shows the full description of <package>.

apt-cache showpkg <package> Shows a lot more detail about <package>, and its relationships to other packages.

dselect
console-apt
aptitude
gnome-apt Graphical front ends to APT (some of these may be in their own package, that must be installed before use). While dselect is arguably the most powerful, it's also the oldest and hardest to use.

Common Dpkg usage
dpkg -i <package.deb> Installs a Debian package file; one that you downloaded manually, for example.

dpkg -c <package.deb> Lists the contents of <package.deb>, a .deb file.

dpkg -I <package.deb> Extracts package information from <package.deb>, a .deb file.

dpkg -r <package> Removes an installed package named <package>

dpkg -P <package> Purges an installed package named <package>. The difference between remove and purge is that while remove only deletes data and executables, purge also deletes all configuration files in addition.

dpkg -L <package> Gives a listing of all the files installed by <package>. See also dpkg -c for checking the contents of a .deb file.

dpkg -s <package> Shows information on the installed package <package>. See also apt-cache show for viewing package information in the Debian archive and dpkg -I for viewing package information extracted from a .deb file.

dpkg-reconfigure <package> Reconfigures an installed package, if it uses debconf (debconf provides that consistent configuration interface for package installation). You can reconfigure debconf itself if you want to change the front-end or priority of questions asked. For example, to reconfigure debconf with the dialog front-end, you simply run:

dpkg-reconfigure --frontend=dialog debconf



echo ``<package> hold'' | dpkg --set-selections Put <package> on hold (command line method)

dpkg --get-selections ``<package>'' Get the current status of <package> (command line method)

dpkg -S <file> Searches for <file> in package database, telling you which packages have that file in them.

Building Debian packages from Source
apt-get source [-b] <package> Download the source Debian package for <package> and extract it. You must have deb-src lines in your /etc/apt/sources.list for this to work. If you supply the `-b' option and you are currently root, then the package will be automatically built if possible.

apt-get build-dep <package> Download and install the packages necessary to build the source Debian package <package>. This feature is only present in apt version 0.5 and up. Currently this means that woody and above contain this functionality. If you have an older version of apt then the easiest way to find out the build dependencies is to look in the debian/control file in the source package directory. A common usage of this command is in conjunction with apt-get source -b. For example (as root):

apt-get build-dep <package>
apt-get source -b <package>

Will download the source package, all of its build dependencies, and attempt to compile the source package.

dpkg-source -x <package.dsc> If you have downloaded the source package for a program manually, which includes several files such as a .orig.tar.gz (or .tar.gz if it is Debian native), a .dsc, and a .diff.gz (if it is not Debian native), then you can unpack the source package using this command on the .dsc file.

dpkg-buildpackage Builds a Debian package from a Debian source tree. You must be in the main directory of the source tree for this to work. Sample usage:

dpkg-buildpackage -rfakeroot -uc -b

Where `-rfakeroot' instructs it to use the fakeroot program to simulate root privileges (for ownership purposes), `-uc' stands for ``Don't cryptographically sign the changelog'', and `-b' stands for ``Build the binary package only''

debuild A handy wrapper script around dpkg-buildpackage that will automatically take care of using fakeroot or not, as well as running lintian and gpg for you.

Fixing dependencies
dpkg --configure --pending If dpkg quits with an error while apt-get install, upgrade, or dist-upgradeing try running this to configure the packages that were already unpacked. Then try apt-get install, upgrade, or dist-upgrade -f, and then try apt-get install, upgrade, or dist-upgrade again. Repeat as needed. This usually resolves most dependency problems (also, if it mentions a specific package for some reason, you might want to try installing or removing that package)

apt-get install -f
apt-get upgrade -f
apt-get dist-upgrade -f Attempt to fix dependencies while doing one of the above. Note that apt-get install -f does not require a <package> argument.

http://people.debian.org/~mrd/deb-ref/apt-dpkg-ref.html

--------------------------------------------------------------------------------

APT and Dpkg 快速参考表

Matthew Danish ( pye,quanliking合译 )


普通 APT 用法

apt-get install <package>
下载 <package> 以及所有倚赖的包裹,同时进行包裹的安装或升级.如果某个包裹被设置了 hold (停止标志,就会被搁在一边(即不会被升级).更多 hold 细节请看下面.

apt-get remove [--purge] <package>
移除 <package> 以及任何倚赖这个包裹的其它包裹.
--purge 指明这个包裹应该被完全清除 (purged) ,更多信息请看 dpkg -P .

apt-get update
升级来自 Debian 镜像的包裹列表,如果你想安装当天的任何软件,至少每天运行一次,而且每次修改了
/etc/apt/sources.list 后,必须执行.

apt-get upgrade [-u]
升级所以已经安装的包裹为最新可用版本.不会安装新的或移除老的包裹.如果一个包改变了倚赖关系而需要安装一个新的包裹,那么它将不会被升级,而是标志为hold .apt-get update 不会升级被标志为 hold 的包裹 (这个也就是 hold 的意思).请看下文如何手动设置包裹为 hold .我建议同时使用 '-u' 选项,因为这样你就能看到哪些包裹将会被升级.

apt-get dist-upgrade [-u]
和 apt-get upgrade 类似,除了 dist-upgrade 会安装和移除包裹来满足倚赖关系.因此具有一定的危险性.

apt-cache search <pattern>
搜索满足 <pattern> 的包裹和描述.

apt-cache show <package>
显示 <package> 的完整的描述.

apt-cache showpkg <package>
显示 <package> 许多细节,以及和其它包裹的关系.

dselect
console-apt
aptitude
gnome-apt
APT 的几个图形前端(其中一些在使用前得先安装).这里 dselect 无疑是最强大的,也是最古老,最难驾驭.

普通 Dpkg 用法
dpkg -i <package.deb>
安装一个 Debian 包裹文件;如你手动下载的文件.

dpkg -c <package.deb>
列出 <package.deb> 的内容.

dpkg -I <package.deb>
从 <package.deb> 中提取包裹信息.

dpkg -r <package>
移除一个已安装的包裹.

dpkg -P <package>
完全清除一个已安装的包裹.和 remove 不同的是, remove 只是删掉数据和可执行文件, purge 另外还删除所有的配制文件.

dpkg -L <package>
列出 <package> 安装的所有文件清单.同时请看 dpkg -c 来检查一个 .deb 文件的内容.

dpkg -s <package>
显示已安装包裹的信息.同时请看 apt-cache 显示 Debian 存档中的包裹信息,以及 dpkg -I 来显示从一个
.deb 文件中提取的包裹信息.

dpkg-reconfigure <package>
重新配制一个已经安装的包裹,如果它使用的是 debconf (debconf 为包裹安装提供了一个统一的配制界面).你能够重新配制 debconf 它本身,如你想改变它的前端或提问的优先权.例如,重新配制 debconf ,使用一个 dialog 前端,简单运行:

dpkg-reconfigure --frontend=dialog debconf (如果你安装时选错了,这里可以改回来哟

echo "<package> hold" | dpkg --set-selections
设置 <package> 的状态为 hlod (命令行方式)

dpkg --get-selections "<package>"
取的 <package> 的当前状态 (命令行方式)

支持通配符,如:
Debian:~# dpkg --get-selections *wine*
libwine hold
libwine-alsa hold
libwine-arts hold
libwine-dev hold
libwine-nas hold
libwine-print hold
libwine-twain hold
wine hold
wine+ hold
wine-doc hold
wine-utils hold

例如:
大家现在用的都是 gaim-0.58 + QQ-plugin,为了防止 gaim 被升级,我们可以采用如下方法:

方法一:
Debian:~# echo "gaim hold" | dpkg --set-selections
然后用下面命令检查一下:
Debian:~# dpkg --get-selections "gaim"
gaim hold
现在的状态标志是 hold,就不能被升级了.

如果想恢复怎么办呢?
Debian:~# echo "gaim install" | dpkg --set-selections
Debian:~# dpkg --get-selections "gaim"
gaim install
这时状态标志又被重置为 install,可以继续升级了.

同志们会问,哪个这些状态标志都写在哪个文件中呢?
在 /var/lib/dpkg/status 里,你也可以通过修改这个文件实现 hold.

有时你会发现有的软件状态标志是 purge,不要奇怪.
如:事先已经安装了 amsn, 然后把它卸了.
apt-get remove --purge amsn
那么状态标志就从 install 变成 purge.

方法二:
在/etc/apt 下手动建一个 preferences 文件
内容:
Package: gaim
Pin: version 0.58*
保存
更详细内容请看:
http://linuxsir.com/bbs/showthread....&threadid=22601

dpkg -S <file>
在包裹数据库中查找 <file>,并告诉你哪个包裹包含了这个文件.(注:查找的是事先已经安装的包裹)

从源码建立deb packages

apt-get source [-b] <package>
下载一个源码的包并解开。
你必须在你的/etc/apt/sources.list文件里写入一条 deb-src 的记录才能完成这项工作。
如果你输入了一个-b参数,并且是以root的身份,deb包会被自动的创建。

apt-get build-dep <package>
自动下载并安装通过源码创建 <package> 时需要的包。
只有apt 0.5以上版本才支持这个功能。
现在woody和以上版本包含了这个功能。
如果你使有一个旧版本的apt,查找依赖性最简单的方法是查看源码包中 debian/control 这个文件,
注意这个路径是相对的,是包内的路径。

普通的用法,结合 apt-get source -b,例子 (as root):

apt-get build-dep <package>
apt-get source -b <package>

会下载源码包,建立依赖性,然后尝试编译源码。

dpkg-source -x <package.dsc>
如果你手工下载了一个程序的源码包,其中包含了几个类似 .orig.tar.gz , .dsc ,
以及 .diff.gz 之类的文件,
那么你就可以对 .dsc 文件使用这个命令来 unpack 源码包。

dpkg-buildpackage
从 Debian 源码树建立一个deb包。你必须在source tree的主目录才能生效。例如:

dpkg-buildpackage -rfakeroot -uc -b

这里 '-rfakeroot' 指定命令使用 fakeroot 程序来模仿 root 权限 (来实现所有者(ownership)目的),
'-uc' 表示 "Don't cryptographically sign the changelog", '-b' 代表只建立二进制包.

debuild
一个快速打包脚本类似 dpkg-buildpackage ,能自动的识别是否使用 fakeroot,
同时为你运行 lintian 和 gpg

修正倚赖关系

dpkg --configure --pending
如果dpkg在apt-get install upgrade dist-uptradeing 的时候出错退出,
尝试使用此命令来配置已经unpack的包。
然后再用 apt-get install ,upgrade, or dist-upgrade -f ,
然后再用 apt-get install, upgrade, or dist-upgrade.

可能会重复多次,这样通常可以解决大多数的依赖性问题。
(同时,如果提示由于某种原因需要某个特定的包裹,你可以常识安装或卸载这个包)

apt-get install -f
apt-get upgrade -f
apt-get dist-upgrade -f
尝试修正上述过程中出现依赖性关系
注意 apt-get install -f 不需要 <package> 作为参数。
回复