DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD Ports and Packages

FreeBSD Ports and Packages Installation and upgrading of ports and packages on FreeBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 8th September 2009
Mantazz Mantazz is offline
Shell Scout
 
Join Date: Oct 2008
Posts: 90
Default Thoughts on "make deinstall clean"

I am wondering if the result of this command is what was intended. I was building a port on my laptop as an upgrade from a previous version of the same port. I initially gave the command "make install clean" and realized that of course I already had an earlier version of the same. So I brought the command back up and changed it to "make deinstall clean", forgetting to remove the "clean" part.

The result was that the port was deinstalled and the work directory cleaned out. Ooops.

Clearly, make did what I told it to do, I cannot fault it for not outsmarting my bad choice of operators. My question is whether "deinstall" and "clean" are ever a useful combination? From my vantage point, if I am running "deinstall" it is most likely because I am upgrading a package that I just built with make. Why would I want to "deinstall clean"?
Reply With Quote
  #2   (View Single Post)  
Old 8th September 2009
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,975
Default

deinstall = remove binary package from /usr/local, /etc, /var, and other locations where content was installed.

clean = delete build directory structure (object files and other content used during the build from source).
Reply With Quote
  #3   (View Single Post)  
Old 8th September 2009
DutchDaemon's Avatar
DutchDaemon DutchDaemon is offline
Real Name: Ben
Spam Refugee
 
Join Date: Jul 2008
Location: Rotterdam, The Netherlands
Posts: 336
Default

Without using tools like portmaster or portupgrade it's usually best to run 'make deinstall reinstall clean' in the port directory. The 'clean' part only deletes the work subdirectory in the port directory.
Reply With Quote
  #4   (View Single Post)  
Old 8th September 2009
Naikon Naikon is offline
New User
 
Join Date: Sep 2009
Location: Rep of Ireland
Posts: 6
Default

Portupgrade or Portmaster along with pkg_cutleaves are
great packages for maintaining ports in FreeBSD.
Reply With Quote
  #5   (View Single Post)  
Old 8th September 2009
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

With new ports I often run a `make fetch` for ahead stuff that will be huge, and normally run a `make build` followed by a `make install clean distclean`. Reason being if make runs while I'm away, I'll be able to check my shells history to figure out readily what popped a cork, the build or the install. With stuff that needs an update, I usually run a deinstall, a reinstall, and a clean distclean.

distclean means to clean out the distfiles (downloaded source, etc). Right now my laptop has over 2GB of distfiles leftover from recent upgrades. Normally I retain distfiles for only a few things: stuff that is occasionally hard to come by (flash, codecs), or things I may need to recompile later, and can't necessarily depend on the ability to fetch the code first if I end up fscked over (e.g. zsh)
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
  #6   (View Single Post)  
Old 9th September 2009
jb_daefo jb_daefo is offline
Spam Deminer
 
Join Date: May 2008
Posts: 303
Default

I have no usual way on updating, but use about 5 ways in general...
Code:
portmaster -d category/port category/port
make checksum && make build && pkg_delete -f /var/db/pkg... && make install && yell
[some alias which does a big more or equivalent in sequence, checking
for changed dependencies from the last build]
and a few more. The shell script I run most often, I am suprised easily by
changes in dependencies.
__________________
FreeBSD 13-STABLE
Reply With Quote
  #7   (View Single Post)  
Old 9th September 2009
phoenix's Avatar
phoenix phoenix is offline
Risen from the ashes
 
Join Date: May 2008
Posts: 696
Default

One thing to watch out for is that the "deinstall" target uses the information in the current port Makefile ... it doesn't use the information in /var/db/pkg to remove the port. If you have version X.0 of the port installed, update the ports tree, which includes version Y.3, and you run "make deinstall" in there ... you may end up with files left behind and a lot of errors flashing by on the screen.

It's much safer to use pkg_delete -xi appname to uninstall apps. That always uses the information in /var/db/pkg/<port-version>/ to remove the app. This reflects what's already on the disk.

"make deinstall" is really only useful for testing a port (make install; make deinstall).
__________________
Freddie

Help for FreeBSD: Handbook, FAQ, man pages, mailing lists.
Reply With Quote
  #8   (View Single Post)  
Old 9th September 2009
BSDKaffee's Avatar
BSDKaffee BSDKaffee is offline
Real Name: Jason Hale
Coffee Addict
 
Join Date: May 2008
Location: Wintersville, Ohio
Posts: 212
Default

Quote:
Originally Posted by phoenix View Post
One thing to watch out for is that the "deinstall" target uses the information in the current port Makefile ... it doesn't use the information in /var/db/pkg to remove the port. If you have version X.0 of the port installed, update the ports tree, which includes version Y.3, and you run "make deinstall" in there ... you may end up with files left behind and a lot of errors flashing by on the screen.

It's much safer to use pkg_delete -xi appname to uninstall apps. That always uses the information in /var/db/pkg/<port-version>/ to remove the app. This reflects what's already on the disk.

"make deinstall" is really only useful for testing a port (make install; make deinstall).
The deinstall target actually uses "pkg_delete -f" to deinstall the package, so it won't matter if the Makefile or pkg-plist was updated. You really shouldn't end up with files left behind or errors if the package was installed correctly.

I do agree it would be safer to use "pkg_delete -i" to get confirmation first, though.
Reply With Quote
  #9   (View Single Post)  
Old 14th September 2009
phoenix's Avatar
phoenix phoenix is offline
Risen from the ashes
 
Join Date: May 2008
Posts: 696
Default

Hrm, you're right, /usr/ports/Mk/bsd.port.mk does use pkg_delete. Wonder when that got added ... (searches cvsweb)

Seems it's been there for several years. Guess it's time to update my tips file.

Thanks for the pointer!!
__________________
Freddie

Help for FreeBSD: Handbook, FAQ, man pages, mailing lists.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Opera Port - conflicting pkgs in "make install" IronForge OpenBSD Packages and Ports 5 29th October 2009 05:10 AM
Fixed "xinit" after _7 _8, "how" here in case anyones' "X" breaks... using "nvidia" jb_daefo Guides 0 5th October 2009 09:31 PM
"Thanks" and "Edit Tags". diw Feedback and Suggestions 2 29th March 2009 12:06 AM
TIP:a nice way to make your pf more "stealth" marc OpenBSD Security 2 30th January 2009 09:39 PM
New Kernel: "make depend" doesn't work nihonto NetBSD General 9 23rd January 2009 09:02 PM


All times are GMT. The time now is 08:00 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick