ubuntu软件安装不上,一招解决

ubuntu软件安装不上,一招解决,第1张

1). 对source.list文件进行备份

sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup1

首先编辑sources.list这个文件

vi /etc/apt/sources.list

apt-get update

引言

在ubuntu当中,安装应用程序我所知道的有三种方法,分别是apt-get,dpkg安装deb和make install安装源码包三种。下面针对每一种方法各举例来说明。

apt-get方法

使用apt-get install来安装应用程序算是最常见的一种安装方法了,比如我要安装build-essential这个软件,使用以下,他会帮我把所有的依赖包都一起安装了。

sudo apt-get install build-essential

执行上述命令以后,我们可以看到一下信息,The following extra packages will be installed:表示所有需要再安装的依赖包。

sudo apt-get install build-essential

[sudo] password for enadmin:

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following extra packages will be installed:

binutils cpp cpp-4.6 dpkg-dev fakeroot g++ g++-4.6 gcc gcc-4.6

libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl

libc-bin libc-dev-bin libc6 libc6-dev libdpkg-perl libgomp1 libmpc2 libmpfr4

libquadmath0 libstdc++6-4.6-dev linux-libc-dev manpages-dev

Suggested packages:

binutils-doc cpp-doc gcc-4.6-locales debian-keyring g++-multilib

g++-4.6-multilib gcc-4.6-doc libstdc++6-4.6-dbg gcc-multilib autoconf

automake1.9 libtool flex bison gdb gcc-doc gcc-4.6-multilib

libmudflap0-4.6-dev libgcc1-dbg libgomp1-dbg libquadmath0-dbg

libmudflap0-dbg binutils-gold glibc-doc libstdc++6-4.6-doc

The following NEW packages will be installed:

binutils build-essential cpp cpp-4.6 dpkg-dev fakeroot g++ g++-4.6 gcc

gcc-4.6 libalgorithm-diff-perl libalgorithm-diff-xs-perl

libalgorithm-merge-perl libc-dev-bin libc6-dev libdpkg-perl libgomp1 libmpc2

libmpfr4 libquadmath0 libstdc++6-4.6-dev linux-libc-dev manpages-dev

The following packages will be upgraded:

libc-bin libc6

2 upgraded, 23 newly installed, 0 to remove and 101 not upgraded.

Need to get 36.3 MB of archives.

After this operation, 83.6 MB of additional disk space will be used.

Do you want to continue [Y/n]? y

下面给出apt-get的的各种参数:

apt-get install xxx 安装xxx 。如果带有参数,那么-d 表示仅下载 ,-f 表示强制安装

apt-get remove xxx 卸载xxx

apt-get update 更新软件信息数据库

apt-get upgrade 进行系统升级

apt-cache search 搜索软件包

Tips:建议您经常使用“apt-get update”命令来更新您的软件信息数据库

apt-get理论上是要求能够联网,但是如果制作了本地源,就不需要联网,制作本地源可以参考:ubuntu制作本地源

dpkg安装deb包

Ubuntu软件包格式为deb,安装方法如下:

sudo dpkg -i package.deb


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/8162016.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-14
下一篇 2023-04-14

发表评论

登录后才能评论

评论列表(0条)

保存