OpenBSD如何快速卸载所有的packages

OpenBSD的安装、升级、更新等日常问题。

版主: chenjun天地乾坤

回复
头像
leo
帖子: 2465
注册时间: 2010-01-21 3:27

OpenBSD如何快速卸载所有的packages

帖子 leo » 2011-03-24 5:06

google了一把,居然在OpenBSD 3.6 到 3.7的升级指南里发现了这个,原文链接:
http://www.openbsd.org/faq/upgrade37.html
不敢独享,愿和我一样喜欢折腾的朋友可以用得上。

代码: 全选

pkg_delete -q /var/db/pkg/*
在虚拟机上测试了一下,顷刻之间我花了半个小时安装的packages全部被宰掉了。
这是测试过程:

代码: 全选

# pkg_info
bzip2-1.0.6         block-sorting file compressor, unencumbered
curl-7.21.2         get files from FTP, Gopher, HTTP or HTTPS servers
gettext-0.18.1p0    GNU gettext
jpeg-8b             IJG's JPEG compression utilities
libgcrypt-1.4.6     crypto library based on code used in GnuPG
libgpg-error-1.10   error codes for GnuPG related software
libiconv-1.13p2     character set conversion library
libidn-1.19         internationalized string handling
libltdl-1.5.26p0    GNU libtool system independent dlopen wrapper
libmcrypt-2.5.8p1   interface to access block/stream encryption algorithms
libxml-2.7.8p1      XML parsing library
libxslt-1.1.26p1    XSLT C Library for GNOME
mhash-0.9.9.9       strong hash library
mod_gzip-1.3.26.1ap5 transparently compress Apache output
mysql-client-5.1.54p0 multithreaded SQL database (client)
mysql-server-5.1.54p5 multithreaded SQL database (server)
p5-DBD-mysql-4.014p1 MySQL drivers for the Perl DBI
p5-DBI-1.609p1      unified perl interface for database access
p5-Net-Daemon-0.43p0 extension for portable daemons
p5-PlRPC-0.2018p1   module for writing rpc servers and clients
php5-bz2-5.2.17     bzip2 compression extensions for php5
php5-core-5.2.17    server-side HTML-embedded scripting language
php5-curl-5.2.17    curl URL library extensions for php5
php5-gd-5.2.17      image manipulation extensions for php5
php5-mbstring-5.2.17 multibyte characters extensions for php5
php5-mcrypt-5.2.17  mcrypt encryption/decryption extensions for php5
php5-mhash-5.2.17   mhash extensions for php5
php5-mysql-5.2.17   mysql database access extensions for php5
php5-mysqli-5.2.17  mysql database access extensions for php5
php5-soap-5.2.17    SOAP functions for php5
php5-xsl-5.2.17     XSL functions for php5
phpMyAdmin-3.3.9.2  tool to handle the administration of MySQL over the web
png-1.2.44          library for manipulating PNG images
python-2.6.6p0      interpreted object-oriented programming language
sqlite3-3.7.5       embedded SQL implementation
t1lib-5.1.0p2       Type 1 rasterizer library for UNIX/X11
# pkg_delete -q /var/db/pkg/*
php5-mhash-5.2.17: ok
mhash-0.9.9.9: ok
php5-xsl-5.2.17: ok
php5-curl-5.2.17: ok
mysql-server-5.1.54p5: ok
curl-7.21.2: ok
php5-bz2-5.2.17: ok
phpMyAdmin-3.3.9.2: ok
php5-mysqli-5.2.17: ok
php5-mysql-5.2.17: ok
php5-mcrypt-5.2.17: ok
libxslt-1.1.26p1: ok
mod_gzip-1.3.26.1ap5: ok
php5-soap-5.2.17: ok
libgcrypt-1.4.6: ok
p5-DBD-mysql-4.014p1: ok
libidn-1.19: ok
php5-gd-5.2.17: ok
jpeg-8b: ok
libltdl-1.5.26p0: ok
python-2.6.6p0: ok
php5-mbstring-5.2.17: ok
mysql-client-5.1.54p0: ok
bzip2-1.0.6: ok
php5-core-5.2.17: ok
libmcrypt-2.5.8p1: ok
png-1.2.44: ok
p5-DBI-1.609p1: ok
libxml-2.7.8p1: ok
libgpg-error-1.10: ok
t1lib-5.1.0p2: ok
sqlite3-3.7.5: ok
p5-PlRPC-0.2018p1: ok
gettext-0.18.1p0: ok
p5-Net-Daemon-0.43p0: ok
libiconv-1.13p2: ok
Read shared items: ok
--- -libxml-2.7.8p1 -------------------
You should also remove /var/db/xmlcatalog
--- -mod_gzip-1.3.26.1ap5 -------------------
To completely deinstall the mod_gzip package you
need to perform these steps as root:
 
        edit /var/www/conf/httpd.conf
        remove the line LoadModule gzip_module
 
Do not do this if you plan on re-installing the mod_gzip
package at some future time.
--- -mysql-server-5.1.54p5 -------------------
You should also remove /etc/my.cnf (which was modified)
You should also run rm -rf /var/run/mysql
You should also run /usr/sbin/userdel _mysql
You should also run /usr/sbin/groupdel _mysql
--- -php5-bz2-5.2.17 -------------------
You can disable this module by removing the
/var/www/conf/php5/bz2.ini symbolic link by
issuing the following command:
 
rm -f /var/www/conf/php5/bz2.ini
--- -php5-core-5.2.17 -------------------
You should also remove /var/www/conf/php.ini (which was modified)
You should also run rm -fr /var/www/conf/php5/
To completely deinstall the package you need to
remove the symbolic link from /var/www/conf/modules
by performing the following step as root:
 
 rm -rf /var/www/conf/modules/php5.conf
--- -php5-curl-5.2.17 -------------------
You can disable this module by removing the
/var/www/conf/php5/curl.ini symbolic link by
issuing the following command:
 
rm -f /var/www/conf/php5/curl.ini
--- -php5-gd-5.2.17 -------------------
You can disable this module by removing the
/var/www/conf/php5/gd.ini symbolic link by
issuing the following command:
 
rm -f /var/www/conf/php5/gd.ini
--- -php5-mbstring-5.2.17 -------------------
You can disable this module by removing the
/var/www/conf/php5/mbstring.ini symbolic link by
issuing the following command:
 
rm -f /var/www/conf/php5/mbstring.ini
--- -php5-mcrypt-5.2.17 -------------------
You can disable this module by removing the
/var/www/conf/php5/mcrypt.ini symbolic link by
issuing the following command:
 
rm -f /var/www/conf/php5/mcrypt.ini
--- -php5-mhash-5.2.17 -------------------
You can disable this module by removing the
/var/www/conf/php5/mhash.ini symbolic link by
issuing the following command:
 
rm -f /var/www/conf/php5/mhash.ini
--- -php5-mysql-5.2.17 -------------------
You can disable this module by removing the
/var/www/conf/php5/mysql.ini symbolic link by
issuing the following command:
 
rm -f /var/www/conf/php5/mysql.ini
--- -php5-mysqli-5.2.17 -------------------
You can disable this module by removing the
/var/www/conf/php5/mysqli.ini symbolic link by
issuing the following command:
 
rm -f /var/www/conf/php5/mysqli.ini
--- -php5-soap-5.2.17 -------------------
You can disable this module by removing the
/var/www/conf/php5/soap.ini symbolic link by
issuing the following command:
 
rm -f /var/www/conf/php5/soap.ini
--- -php5-xsl-5.2.17 -------------------
You can disable this module by removing the
/var/www/conf/php5/xsl.ini symbolic link by
issuing the following command:
 
rm -f /var/www/conf/php5/xsl.ini
--- -python-2.6.6p0 -------------------
Don't forget to remove /usr/local/bin/python,
/usr/local/bin/python-config or/and
/usr/local/bin/pydoc if they were symlinks to
/usr/local/bin/python2.6, /usr/local/bin/python2.6-config
or to /usr/local/bin/pydoc2.6.
#
# pkg_info
#

wkx9dragon
锌 Zn
帖子: 493
注册时间: 2010-02-02 18:00

帖子 wkx9dragon » 2011-03-24 9:27

我原来都是用这个 pkg_info | awk '{print$1}' | xargs -I {} pkg_delete {}, 还是你这个快。

回复

在线用户

正浏览此版面之用户: Semrush [Bot] 和 3 访客