From nobody Wed Sep 20 15:08:31 2023 X-Original-To: questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RrMP74nn8z4tmyb for ; Wed, 20 Sep 2023 15:08:43 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RrMP747Y2z4FMZ for ; Wed, 20 Sep 2023 15:08:43 +0000 (UTC) (envelope-from matthew@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695222523; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h+wIvebHXNhsqJYia4HaoosDEykSBzI+0YbNI9Qhvbs=; b=h5irlfAh16YFdJAF0DN6lzhRPc+/buEbDjo+hHPshjTD7jQYgJ+OJsAp2dE33qYF5V/Ypa RxIueB9VBcqMP9Ntcv/8cgIutEkL5UCy4+3+Xu0DgPirg41Ws3cFr8Oz5CY+FnDCsy7wAI hfP0oM2xKsCSMzOE5G/qP+W0IkvMc1XkeGlWmE9CsHIiOOl5bv2TeLeu1ouibA6InGpqeB xuI1VovtnA7R8FW6V1iZ87Y/izy7PIwKDBy3d+A1dw3SUZKQTtzfmZE/iwahTxmPhRDoTq gC1oKHVHYarstYb8dxmKXwIrBjpjPdYdxmI94rTOITQImnEeSrwDXE1mA4staQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1695222523; a=rsa-sha256; cv=none; b=xS3Kjy+YKEVQ7gjwjVf93YHNMF4a2ROeLTv+ulCMJSjt2Gti7F2SUR13Z6L2t/Yzk+Lh6q +fWAg7uldGtyp7waHUdyiEVvTX6cKa7qooMTR/AejNX5pjGAoXORlObTTQHToBTsrdv3py DuaFnLeTpbYwUFUG0izp06J9lEVTUorNUrfXBTHG1VArx+TdlIFJqkjmI7L1wAVs+M+/Y7 8iSF8YrgZ+HC0gTMU6ChQ0YI98vhMKPLy6t3/mzTZCZ45L7YdurDuQlXQ1i7RE3IyV0zZI cz4h5a5586358Uo1m/7EqB2DDsrSeAVu+A5SqCIP7MwCitfgKjOxszxqsm9a5w== ARC-Authentication-Results: i=1; smtp.infracaninophile.co.uk; dmarc=none (p=none dis=none) header.from=FreeBSD.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695222523; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h+wIvebHXNhsqJYia4HaoosDEykSBzI+0YbNI9Qhvbs=; b=wWJpXVh5kizvxubUGuwDQsJMeRf+PQpEYoWZ3Ov613WXDWIrgP722EJs+UyXi2Trquh8NP 5Q8HTl4xMoASZyI2aUjNS8Uzhl5pLIxmVA6m5Mn5sdmKW8Lg6bwqagkqD/bONvJ3xqDHJE kls88QBX3xb9Sie/7UucvdPaRDkbakG0DhLZsFLAtbLBks7aMT7tP6J4jqMaYqJOWzIzFw KfvQUBcVmetyiNiMMXVjMfaRa0IuYXKB84ogYMtDMynq5T3drx4c8FUBcIT38JlFa/Ta2c 6EbjdgBO8rZTJwyQlU9sy5frzH5Rd4PTks56ynd/pB5jj/BGk66+p9Lq1ZJHMg== Received: from smtp.infracaninophile.co.uk (smtp.infracaninophile.co.uk [81.2.117.100]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: matthew/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4RrMP7298jzyTB for ; Wed, 20 Sep 2023 15:08:43 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from [IPV6:2001:8b0:151:1:f4e8:b364:ab48:5518] (unknown [IPv6:2001:8b0:151:1:f4e8:b364:ab48:5518]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) (Authenticated sender: m.seaman@infracaninophile.co.uk) by smtp.infracaninophile.co.uk (Postfix) with ESMTPSA id CB5301021D for ; Wed, 20 Sep 2023 16:08:40 +0100 (BST) Authentication-Results: smtp.infracaninophile.co.uk; dmarc=none (p=none dis=none) header.from=FreeBSD.org Message-ID: <7e47a2ad-97cc-4e6a-b290-32315cb67deb@FreeBSD.org> Date: Wed, 20 Sep 2023 16:08:31 +0100 List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: switch from i386 to AMD64 without a total rebuild? To: questions@freebsd.org References: Content-Language: en-GB From: Matthew Seaman In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 20/09/2023 15:25, paul beard wrote: > I don't think I understand pkg leaf. And to be fair, I am reluctant to > remove stuff if I don't know what it's doing/why it was installed. > Ideally build dependencies that are not needed at runtime are cleaned up > but I bet there is some cruft, given the very different totals given > below. pkg leaf | wc -l 184 pkg info | wc -l 531 Disk space is not an > issue, a 64Gb disk image is more than adequate here. The idea of `pkg leaf` is to produce a list of all the packages installed on your system which no other packages depend on. This implies they are software packages you installed specifically, rather than packages pulled in because something else needed them to run. So, you should be able to tell pkg(8) to install just those leaf packages, and pkg will work out what else it needs to install to make the leaf packages work, and the end result should be a minimal working set of packages to enable your desired software load out. Now, using "leaf" packages like this is only one way of guessing if a package is directly required. pkg(8) actually records equivalent information itself using the 'automatic' flag. So, if you `pkg install foo` and pkg works out it needs to install: foo-1.2.3 bar-0.0.1 Then `bar-0.0.1` would be marked as 'automatic' -- this flag will be preserved if bar gets upgraded or reinstalled at a later date. You can see the non-automatic packages you have installed by: pkg query -e '%a == 0' '%n-%v' and this list can be used as an alternative to the output from `pkg leaf` ('%a == 1' will show the automatic packages) Should you at some future point decide to remove `foo-1.2.3` you can tidy up any automatically installed packages by: pkg autoremove -y which in this example would remove `bar-0.0.1` so long as no other package depended on it. You can toggle the automatic status of packages using pkg-set(8), and you can force a package to be marked automatic at install time by `pkg install -A foo` --- this is very handy for temporary installations. If you install packages by compiling from ports: eg. cd /usr/ports/devel/foo make install then any build, run or test dependencies also installed as a result of that command will be marked as automatic. If such a dependency is only required for build or test, but not run then you can delete it immediately by `pkg autoremove` Cheers, Matthew