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 可以使用了