How to do a clean reinstall with macports?

隐身守侯 提交于 2019-12-09 06:07:26

问题


How can one do a complete clean reinstall of a port and at the same time a complete clean reinstall of all its dependenceis?


回答1:


From the MacPorts wiki (migration):

https://trac.macports.org/wiki/Migration

After having saved a list of installed ports using:

port -qv installed > myports.txt

and having removed them with:

sudo port -f uninstall installed

Download and execute the restore_ports script. (If you installed MacPorts from source and used a custom prefix, then you'll need to use the -p option when you run restore_ports.tcl; see ./restore_ports.tcl -h.)

curl -O https://svn.macports.org/repository/macports/contrib/restore_ports/restore_ports.tcl
chmod +x restore_ports.tcl
sudo ./restore_ports.tcl myports.txt



回答2:


Save your currently installed ports

sudo port list installed | sed 's/ .*//' | sort | uniq > ports.lst

Then uninstall everything, leaving the structure in place

sudo port clean installed
sudo port -f uninstall installed

Then reinstall everything, with the new dependencies:

for package in $(<ports.lst); do sudo port install $package; done


来源:https://stackoverflow.com/questions/22238561/how-to-do-a-clean-reinstall-with-macports

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!