ºìÁªLinuxÃÅ»§
Linux°ïÖú
µ±Ç°Î»ÖÃ: ºìÁªLinuxÃÅ»§ > Debian

Debian LinuxÍêÕûÒƳýÌ×¼þ/ÖØа²×°Ì×¼þ/Ëø¶¨Ì×¼þ°æ±¾(apt)

·¢²¼Ê±¼ä:2008-10-03 00:08:02À´Ô´:ºìÁª×÷Õß:urowoen
ºÜ¶àÈ˳£»á·¢Éú°Ñij¸öÌ×¼þ¸ãÀÃÁË,»òÕßÉ趨µµÖ®À಻СÐÄ¿³µôÁË,ÔÙÀ´Ïëµ½µÄµ±È»ÊÇÒƳýÔÙÖØа²×°»òÖ±½Ó(apt-get install --reinstall package),µ«ÊÇÔõôװ,É趨µµ¾ÍÊǻز»À´,¸ãÀõÄ×ÊÁÏÒ²»¹ÊÇÁô×Å.

Õâ²¢²»ÊÇDebianµÄ´í,Ö÷ÒªÊÇÅÂÄãÔÚÒƳýʱ,²»Ð¡Ðľͽ«ÖØÒª×ÊÁϸúמͿ³µôÁË(ex: MySQL²»Ð¡ÐÄÒƳý¾Í°ÑDB¿³µô,Õâ¾ÍºÜÞÏÞÎÁË.)

´ËƪÎÄÕÂÒ²ÓÐ˵Ã÷·¢Éú×´¿ö:ÈçºÎÔÚDebian EtchϵͳÏÂÍêÈ«ÒƳýÌ×¼þÓëʵÌåĿ¼£¿

Ì×¼þÖØа²×°
¾ÍÉÏÊöÄÇƪÎÄÕµÄÀý×Ó,²»Ð¡ÐĽ«ApacheµÄÉ趨µµ¸Çµô/¿³µô,ËùÒÔ´òËãÖØа²×°Apache.

Ì×¼þÒƳýÖØа²×°,ºÍapt-get install --reinstall apache2²¢Ã»Óдí,Ö»²»¹ýÎÊÌâÊÇ, apache2µÄpackageÀïÃ沢ûÓÐÉ趨µµ. Orz.

Óɴ˿ɼûPackageÌ×¼þÄÚÈÝ:

dpkg -L apache2 | grep conf
dpkg -L apache2.2-common | grep conf # DebianÉ趨µµ¶¼·ÅÔÚpackage_name-commonÖÐ
»òÕßÉÏÊöÎÄÕÂ×÷ÕßµÄ×ö·¨ÊÇless /var/lib/dpkg/info/apache2.listÒ²ÊÇ¿ÉÒÔ.
ËùÒÔÒªÖØÐÂÈ¡µÃÉ趨µµ,Ó¦¸ÃÖ±½Ó
apt-get install --reinstall apache2.2-common
¼´¿É. (ÇëÐ޸ijÉ×Ô¼ºÏµÍ³µÄapache2°æ±¾)
Ì×¼þÍêÕûÒƳý
ÏÖÔÚÓöµ½µÄÁíÒ»¸ö×´¿öÊÇ, MySQL±»¸ãÀÃÁË,ËùÒÔÒª½«È«²¿ÒƳý(º¬×ÊÁ϶¼ÒªÒƳý),ÔÙÖØа²×°.

ÍêÕûÒƳýµÄ²½Öè:

apt-get remove --purge mysql-server mysql-server-5.0 mysql-common mysql-client mysql-client-5.0
ÕâÒ»ÐоͻὫDB/É趨µµ¶¼ÍêÕûÒƳý(--purge»á½«ËùÓÐÒƳý),²»¹ý´ó¶àÈ˵ÄÎÊÌâÊÇ, --purgeºóÃæÄÇÒ»´®ÊÇ´ÓÄÄÀ´µÄ?

¿ÉÓÃÏÂÊö²é·¨:

dpkg -l | grep mysql # dpkg -l»áÁгö´Ëϵͳ°²×°µÄËùÓÐpackage
ls /var/lib/dpkg/info/*mysql*
ÒƳýÖ®ºó,ÖØа²×°Ö±½Óapt-get install¾Í¿ÉÒÔ?~ :)

×¢:ÈôÖ»ÊÇDatabase fileÀÃÁË,Ö»Òªapt-get remove --purge mysql-server-5.0,ÔÙÖØа²×°mysql-server-5.0¼´¿É.

Ì×¼þËø¶¨°æ±¾

¼ÙÉèÏÖÔÚÒªËø¶¨gaim°æ±¾,²»ÏëÒªgaim±»Éý¼¶»ò½µ¼¶£¬ÓÐÏÂÊöÁ½ÖÖ×ö·¨:

echo "gaim hold" | dpkg --set-selections #½«gaimËø¶¨°æ±¾
dpkg --get-selections "gaim" #¼ì²é:³öÏÖgaim hold #״̬ÊÇhold,¾Í²»Äܱ»Éý¼¶ÁË.
vim /etc/apt/preferences #ÄÚÈÝÈçÏÂ,°Ñ°æ±¾±àºÅдËÀ.

Package: gaim
Pin: version 0.58*

Ì×¼þ½â³ýËø¶¨
echo "gaim install" | dpkg --set-selections

dpkg --get-selections "gaim" #¼ì²é:³öÏÖgaim install #״̬±»ÖØÖÃΪinstall,¾Í¿ÉÒÔ¼ÌÐøÉý¼¶ÁË

״̬µµ°¸Î»ÖÃ

hold / installÕâЩ״̬±êÖ¾¶¼Ð´ÔÚ/var/lib/dpkg/statusÀï,Ò²¿ÉÒÔÊÖ¶¯È¥Ð޸ıähold / installµÈ״̬.
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 0 ÌõÆÀÂÛ