Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to do a clean reinstall with macports?

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

like image 575
Jack Twain Avatar asked Mar 06 '14 23:03

Jack Twain


People also ask

How do I uninstall MacPorts?

Uninstall All Ports If you want to uninstall MacPorts and the port command is functioning, first uninstall all the installed ports by running this command in the Terminal: All that will be left in your installation prefix now will be files that were not registered to any port.

Does upgrading ports in MacPorts remove the older versions?

By default, upgrading ports in MacPorts does not remove the older versions. This is a safety measure to ensure you can go back to a working and tested version in case an update goes wrong. To save disk space, you should periodically uninstall any old versions you no longer need. Use to get a list of inactive ports you likely no longer need.

How to remove all ports in macportsfoster?

The 'macportsfoster' script will output a list of all ports not required by anything in the requested-list, ordered such that 'port deactivate $ (macportsfoster)' will remove all of them in one shot. I think the other answers, and the --follow-dependents flag, do not do what you want.

How do I install MacPorts?

If you are using macOS, you should install MacPorts using the macOS package installer unless you do not wish to install it to /opt/local/, the default MacPorts location, or if you wish to install a pre-release version of MacPorts base.


1 Answers

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
like image 74
Marc Avatar answered Oct 12 '22 12:10

Marc