centos linux apt_get,centos下安装apt-get

本文介绍了如何在CentOS系统中安装和配置apt-get工具,包括下载安装包、修改源文件、导入GPG密钥、更新软件包列表以及修复破碎安装的过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

apt-get主要用于自动从互联网的软件仓库中搜索、安装、升级,卸载软件或操作系统

下载安装包

wget http://packages.sw.be/apt/apt-0.5.15lorg3.94a-4.el5.rf.i386.rpm

执行rpm -ivh wget http://packages.sw.be/apt/apt-0.5.15lorg3.94a-4.el5.rf.i386.rpm

修改下源文件 cp/etc/apt/sources.list.d/os.list/etc/apt/sources.list

vi /etc/apt/sources.list

# Name: Operating system and updates

### Red Hat Enterprise Linux

#repomd http://mirror.centos.org centos/$(VERSION)/os/$(ARCH)

#repomd http://mirror.centos.org centos/$(VERSION)/updates/$(ARCH)

#repomd http://mirror.centos.org centos/$(VERSION)/extras/$(ARCH)

#repomd http://mirror.centos.org centos/$(VERSION)/fasttrack/$(ARCH)

#repomd http://mrepo rhel$(VERSION)s-$(ARCH)/RPMS.os

#repomd http://mrepo rhel$(VERSION)s-$(ARCH)/RPMS.updates

#rpm http://mrepo rhel$(VERSION)s-$(ARCH) os updates

### Fedora Core Linux

#repomd http://ayo.freshrpms.net fedora/linux/$(VERSION)/$(ARCH)/core

#repomd http://ayo.freshrpms.net fedora/linux/$(VERSION)/$(ARCH)/updates

#rpm http://ayo.freshrpms.net fedora/linux/$(VERSION)/$(ARCH) core updates

### Red Hat Linux

#repomd http://ayo.freshrpms.net redhat/$(VERSION)/$(ARCH)/os

#repomd http://ayo.freshrpms.net redhat/$(VERSION)/$(ARCH)/updates

#rpm http://ayo.freshrpms.net redhat/$(VERSION)/$(ARCH) os updates

选择一个就可以了  如果更新包太慢的话 可以换个 不用国外的mirror.centos.org

然后在安装下GPG keys

rpm –import /etc/pki/rpm-gpg/RPM-GPG-KEY-*

apt-get update   更新软件包列表

apt-get upgrade更新任何已安装的软件包

177 upgraded, 0 newly installed, 0 removed and 5 not upgraded.

Need to get 189MB of archives.

After unpacking 13.0MB of additional disk space will be used.

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

会列出所有包,告诉你需要更新的,安装的,移除的,不需要更新的 占用空间的大小

是否继续?

然后在执行下

apt-get –fix-broken install  修复破碎的安装

Reading Package Lists… Done

Building Dependency Tree… Done

0 upgraded, 0 newly installed, 0 removed and 182 not upgraded.

一切ok  可以使用了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值