简体   繁体   中英

How to do a clean reinstall with macports?

如何完全清理重新安装端口,同时彻底清除重新安装所有的依赖?

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM