Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I reset a port in MacPorts?

Tags:

Suppose I want to reset a port to its initial state, including its configuration files. This can be achieved by:

sudo port uninstall portname
sudo port install portname

(Deactivating and then reactivating the port does not reset the configuration files.)

Is there any way to do this without uninstalling and reinstalling the port, avoiding the overhead of having to rebuild the package?

Edit: Thanks for the replies, Alexander and Nerdling. Archive mode worked for me.

like image 441
bryan Avatar asked Mar 10 '09 02:03

bryan


People also ask

How do you use ports on a Mac?

MacPorts uses autoconf and makefiles for installation. These commands will build and install MacPorts to /opt/local . You can add --prefix to ./configure to relocate MacPorts to another directory if needed. Now MacPorts will look for portfiles in the working copy and use Git instead of rsync to update your ports tree.

Where are ports installed?

A port, or subcutaneous implantable catheter, is placed entirely under the skin. There is a small reservoir, a plastic or metal cylinder usually placed just below the collar bone, connected to a catheter that enters the jugular vein in the neck. These may stay in for months to years, or permanently.


2 Answers

What you want to do is activate archive mode.

vi ${prefix}/etc/macports/macports.conf

Typically, your prefix is /opt/local.

Inside that file, look for portarchivemode and enable it. Now, whenever you install a package, the files will be archived as whatever portarchivetype is set to.

Supported types: tgz (default), tar, tbz, tbz2, tlz, xar, zip, cpgz, cpio

If you uninstall a port, it will open the archive rather than rebuilding everything.

like image 109
Jeremy L Avatar answered Sep 30 '22 16:09

Jeremy L


I had the exact same question a few weeks ago. I searched through the Macports documentation without any luck. As far as I know, it doesn't have a command to do that.

like image 28
Alexander Avatar answered Sep 30 '22 17:09

Alexander