Remove components post-installation

edogawaconan

New Member

Reaction score: 1
Messages: 12

A long time ago I installed freebsd with all distribution sets.

Now I want to remove some of the sets (notably catman, info and proflibs). Is it possible?

(or I missed something, somewhere?)
 

brd@

Administrator
Staff member
Administrator
Moderator
Developer

Reaction score: 89
Messages: 293

Yeah, you could find the tarballs that contain these sets and use something like:
Code:
tar -t <tarball>
So you know what files are included in it and make sure you want to remove them. Then you could probably do something like this to remove them:
Code:
tar -t <tarball> | xargs rm
 
OP
edogawaconan

edogawaconan

New Member

Reaction score: 1
Messages: 12

doesn't seem to cleanly remove the component (namely freebsd-update upgrade still recognizes these components: world/dict world/info) which I want to remove.
 

tnpimatt

New Member

Reaction score: 4
Messages: 10

For the sake of other search engine visitors, the reason it may not have worked cleanly for edogawaconan is likely because the file paths in the component tarballs are relative. If he wasn't in / when he ran the command, it wouldn't have deleted the files. Here's an example command that will remove the doc sources from a FreeBSD machine:

Code:
cd /
export FREEBSD_VERSION=`/bin/freebsd-version | /usr/bin/cut -f1-2 -d'-'`
export COMPONENT_URL="ftp://ftp.freebsd.org/pub/FreeBSD/releases/`uname -m`/$FREEBSD_VERSION"
fetch -o - $COMPONENT_URL/doc.txz | tar -tzf - | xargs rm
If you're removing the lib32 distribution, you might also have to remove some flags like so:

Code:
tar -tzf lib32.txz | xargs chflags noschg
tar -tzf lib32.txz | xargs rm
 

ShelLuser

Son of Beastie

Reaction score: 1,797
Messages: 3,600

For the sake of other search engine visitors, the reason it may not have worked cleanly for edogawaconan is likely because the file paths in the component tarballs are relative.
First, you're responding to an almost 10 year old thread, just saying ;)

I'm not sure which post you're referring to, but if you meant the last post about freebsd-update then the cause is a completely different one: /etc/freebsd-update.conf also needs to be told about any removed components. See freebsd-update.conf(5) for that.
 

tnpimatt

New Member

Reaction score: 4
Messages: 10

> First, you're responding to an almost 10 year old thread, just saying

Please be nice. I already pointed out my awareness.

>> the reason it may not have worked cleanly
>the cause is a completely different one

Apparently you missed the paragraph where I described who my post was aimed to benefit.

There is no uninstaller for FreeBSD components such as doc, games, src, ports, and lib32. By default, freebsd-update.conf has Components src world kernel. Within world are optional installs (doc, games, lib32) and freebsd-update does filesystem checks to determine whether it should update them. Without touching freebsd-update.conf at all, uninstalling the no-longer-desired components as I described does exactly what the OP and other search visitors likely want: removes the components and prevents freebsd-update from updating them.

FreeBSD users who have FreeBSD installed for them (think: cloud provider) or don't wish to re-install to get rid of components may well search for how to remove those components and land on this thread. My post was for them.
 

kjpetrie

Active Member

Reaction score: 6
Messages: 135

tnpimatt pointed me in the right direction but (fortunately) his code didn't work for me, possibly because my root user doesn't use Bash and also because rm only removes directories if the recursive option is used. If he had used that option I think I would have lost my whole system as the first error I got was
Code:
rm: ./: is a directory
!

Definitely carry out the steps manually to ensure you only remove the parts you want to remove.
Code:
rm -r
is irreversible.
 
Top