Linux

Slackware包管理工具slapt-get

 

用过Debian/Ubuntu的apt-get、 Fedora的yum 、openSUSE的zypper、Arch的pacman、Mandriva的urpmi等,Slackware也有一套类似的管理工具slapt-get。slapt-get是模拟Debian的apt-get,配置文件是 /etc/slapt-get/slapt-getrc

如果还没安装可以到这里下载:http://www.slacky.eu/asche/pkgs/index.php?sear=slapt-get

如果装了gnomeslackbuild就已经是装上slapt-get

原始slapt-getrc写法:

# Working directory for local storage/cache.
WORKINGDIR=/var/slapt-get

# Exclude package names and expressions.
# To exclude pre and beta packages, add this to the exclude:
#   [0-9_.-]{1}pre[0-9-.-]{1}
EXCLUDE=^aaa_elflibs,^devs,^glibc-.*,^kernel-.*,^udev,.*-[0-9]+dl$,x86_64

# Base url to directory with a PACKAGES.TXT.
# This can point to any release, ie: 9.0, 10.0, current, etc.
SOURCE=ftp://ftp.slackware.com/pub/slackware/slackware-13.37/:OFFICIAL

# Sources for the testing, extra, and pasture areas - if you use them.
# SOURCE=ftp://ftp.slackware.com/pub/slackware/slackware-13.0/extra/:PREFERRED
# SOURCE=ftp://ftp.slackware.com/pub/slackware/slackware-13.0/testing/
# SOURCE=ftp://ftp.slackware.com/pub/slackware/slackware-13.0/pasture/

# Source for slapt-get.
SOURCE=http://software.jaos.org/slackpacks/13.37/:OFFICIAL

# Packages on a CD/DVD. (挂载本地光盘)
# SOURCE=file:///mnt/cdrom/:OFFICIAL
SOURCE=file:///media/SlackDVD/:OFFICIAL

# Home made packages.
# SOURCE=file:///var/www/packages/:CUSTOM
~                                                                              
~    

补充其它及GNOME SlackBuild镜像

# Slackware mirrors.
# This is the primary mirror for Slackware. Uncomment the SOURCEs for the
# 'extra/', 'testing/' or 'pasture/' areas if you use packages from them.
SOURCE=http://ftp.osuosl.org/pub/slackware/slackware-13.1/:OFFICIAL
#SOURCE=http://ftp.osuosl.org/pub/slackware/slackware-13.1/extra/:OFFICIAL
#SOURCE=http://ftp.osuosl.org/pub/slackware/slackware-13.1/testing/:OFFICIAL
#SOURCE=http://ftp.osuosl.org/pub/slackware/slackware-13.1/pasture/:OFFICIAL
# Below is a list of (some of the) other Slackware mirrors which can be used
# instead of osuosl. Any Slackware mirror can be used, but those listed here
# have all been manually checked as working. Add copies for the additional
# extra/testing/pasture areas (like above) if you use them.
#SOURCE=http://www.slackware.at/data/slackware-13.1/:OFFICIAL
#SOURCE=ftp://ftp.slackware.at/slackware-13.1/:OFFICIAL
#SOURCE=http://www.slackware.org.uk/slackware/slackware-13.1/:OFFICIAL
#SOURCE=ftp://ftp.slackware.org.uk/slackware/slackware-13.1/:OFFICIAL
#SOURCE=http://slackware.oregonstate.edu/slackware-13.1/:OFFICIAL
#SOURCE=ftp://slackware.oregonstate.edu/pub/slackware/slackware-13.1/:OFFICIAL
#SOURCE=http://mirror.switch.ch/ftp/mirror/slackware/slackware-13.1/:OFFICIAL
#SOURCE=ftp://mirror.switch.ch/mirror/slackware/slackware-13.1/:OFFICIAL
#SOURCE=http://ftp.heanet.ie/mirrors/ftp.slackware.com/pub/slackware/slackware-13.1/:OFFICIAL
#SOURCE=ftp://ftp.heanet.ie/mirrors/ftp.slackware.com/pub/slackware/slackware-13.1/:OFFICIAL
#SOURCE=http://slackware.mirrors.tds.net/pub/slackware/slackware-13.1/:OFFICIAL
#SOURCE=ftp://slackware.mirrors.tds.net/pub/slackware/slackware-13.1/:OFFICIAL
# Additional mirrors for Slackware can be found at:
# http://slackware.com/getslack/
# http://alphageek.dyndns.org/linux/slackware-mirrors.shtml

# GNOME SlackBuild mirrors.
# This is the primary mirror for GSB. Uncomment the SOURCEs for the
# 'extra/', 'testing/' or 'pasture/' areas if you use packages from them.
SOURCE=http://mirrors.gnomeslackbuild.org/gsb/gsb-2.30_slackware-13.1/:PREFERRED
#SOURCE=http://mirrors.gnomeslackbuild.org/gsb/gsb-2.30_slackware-13.1/extra:PREFERRED
#SOURCE=http://mirrors.gnomeslackbuild.org/gsb/gsb-2.30_slackware-13.1/testing:PREFERRED
#SOURCE=http://mirrors.gnomeslackbuild.org/gsb/gsb-2.30_slackware-13.1/pasture:PREFERRED
# Below is a list of (some of the) other GSB mirrors which can be used instead
# of the one above. Any GSB mirror can be used, but those listed here have
# all been manually checked as working. Add copies for the additional
# extra/testing/pasture areas (like above) if you use them.
#SOURCE=http://www.slackware.org.uk/gsb/gsb-2.30_slackware-13.1/:PREFERRED
#SOURCE=ftp://ftp.slackware.org.uk/gsb/gsb-2.30_slackware-13.1/:PREFERRED
#SOURCE=http://darkstar.ist.utl.pt/slackware/addon/gnomeslackbuild/gsb-2.30_slackware-13.1/:PREFERRED
#SOURCE=ftp://darkstar.ist.utl.pt/pub/slackware/addon/gnomeslackbuild/gsb-2.30_slackware-13.1/:PREFERRED
#SOURCE=http://mirror.switch.ch/ftp/mirror/gsb/gsb-2.30_slackware-13.1/:PREFERRED
#SOURCE=ftp://mirror.switch.ch/mirror/gsb/gsb-2.30_slackware-13.1/:PREFERRED
#SOURCE=http://mirrors.dotsrc.org/gsb/gsb-2.30_slackware-13.1/:PREFERRED
#SOURCE=ftp://mirrors.dotsrc.org/gsb/gsb-2.30_slackware-13.1/:PREFERRED
#SOURCE=http://ftp.slackware.pl/pub/gnomeslackbuild/gsb/gsb-2.30_slackware-13.1/:PREFERRED
#SOURCE=ftp://ftp.slackware.pl/pub/gnomeslackbuild/gsb/gsb-2.30_slackware-13.1/:PREFERRED
#SOURCE=http://slackware.rol.ru/gsb/gsb/gsb-2.30_slackware-13.1/:PREFERRED
#SOURCE=http://get.gnomeslackbuild.org/gsb/gsb-2.30_slackware-13.1/:PREFERRED

国内163 sohu的镜像

网易:  http://mirrors.163.com/.help/slackware.html

内容:
WORKINGDIR=/var/slapt-get
EXCLUDE=^aaa_elflibs,^devs,^glibc-.*,^kernel-.*,^udev,.*-[0-9]+dl$,x86_64
SOURCE=http://mirrors.163.com/slackware/slackware-current/:OFFICIAL
SOURCE=http://mirrors.163.com/slackware/slackware-current/extra/:PREFERRED
SOURCE=http://mirrors.163.com/slackware/slackware-current/testing/
SOURCE=http://mirrors.163.com/slackware/slackware-current/pasture/

搜狐:http://mirrors.sohu.com/help/slackware.html

安装方法:

先备份原文件,然后下载提供的slapt-getrc替换
bash-4.1# cp slapt-getrc slapt-getrc.backup
bash-4.1# ls
slapt-getrc  slapt-getrc.backup

slapt-get用法举例:

bash-4.1# slapt-get --show lftp
软件包名称: lftp
软件包镜像: file:///media/SlackDVD/
Package Priority: Official
软件包位置: ./slackware/n
软件包版本: 4.2.2-i486-1
软件包大小: 592 K
软件包安装后大小: 2510 K
软件包需要: 
软件包冲突: 
软件包建议安装: 
软件包 MD5 校验值:  07e4e9d5a63b0b7f7dff8751ffb6c5a0
软件包描述:
 lftp (command line file transfer program)

 lftp is a program that allows sophisticated ftp and http connections
 to other hosts.  lftp can handle many file access methods including
 ftp, ftps, http, https, hftp, fish and file.  Every operation in lftp
 is reliable, that is any non-fatal error is ignored and the operation
 is retried.  lftp has shell-like command syntax.  lftp has a built in
 mirror feature which can download or upload a whole directory tree.
 To learn about many more features of lftp, see 'man lftp'.

Package ChangeLog:
  Upgraded.

软件包已安装: 是
bash-4.1# slapt-get -i lftp
读取软件包列表...完成
lftp 已经是最新的.
0 upgraded, 0 reinstalled, 0 newly installed, 0 to remove, 0 not upgraded.

完成

附:

Slackware的包管理机制说明:

包管理机制是Slackware区别于其他Linux 发行版的重要的甚至是本质的区别。Slackware的包管理机制简单、灵活、高效、安全,用户透明性大,可定制程度高。因为Slackware的标准包管理工具皆为Shell脚本,这样,你可用简单而又方便的对其进行修改、移植。但是也存在一些不足之处,比如没有灵活的网络安装模式等。本文对Slackware的包管理进行全面详细的介绍。 

slapt-get 参数:[选项(可多选)] [目的]

目的:
--update|-u - 从镜像上检索软件包数据
--upgrade - 升级已安装软件包
--dist-upgrade - 升级至更新的 release 版本
--install|-i [软件包名称(可多选)] - 安装软件包
--install-set [磁盘集合(可多选)] - 安装选定的磁盘集合
--remove [软件包名称(可多选)] - 删除软件包
--show [软件包名称] - 显示软件包描述
--search [表达式] - 查找可用的软件包
--list - 列出软件包
--available - 列出可用软件包
--installed - 列出已安装软件包
--clean - 清空缓存的软件包
--autoclean - 只清除过时和无法获取的软件包
--add-keys - retrieve GPG keys for sources
--version - 显示版本和版权信息

选项:
--download-only|-d - 执行安装/升级时只下载软件包
--simulate|-s - 显示将要被安装/升级的软件包
--no-prompt|-y - 安装/升级时不询问
--prompt|-p - 安装/升级时总是询问
--reinstall - 重新安装软件包
--ignore-excludes - 安装/升级已设置为排除的软件包
--no-md5 - 不执行 MD5 校验
--no-dep - 跳过依赖检查
--ignore-dep - 忽略依赖失败
--print-uris - 只显示 URIs ,不下载
--show-stats|-S - 显示下载状况
--config|-c [] - 指定其他的 slapt-getrc 文件位置
--remove-obsolete - 删除老旧的软
--retry [] - 指定下载重试的次数
--no-upgrade - 安装软件包, 不要尝试升级

(0)

本文由 Linux视野 作者:fantlam 发表,转载请注明来源!

热评文章

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注