bryan
bryan

Reputation: 2243

How do I reset a port in MacPorts?

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.

Upvotes: 5

Views: 1890

Answers (2)

Jeremy L
Jeremy L

Reputation: 7797

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.

Upvotes: 4

Alexander
Alexander

Reputation: 3057

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.

Upvotes: 1

Related Questions