From owner-freebsd-pkg@FreeBSD.ORG Tue Feb 25 02:23:06 2014 Return-Path: Delivered-To: freebsd-pkg@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0FBB2947 for ; Tue, 25 Feb 2014 02:23:06 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E1F2112D6 for ; Tue, 25 Feb 2014 02:23:05 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id s1P2N4Oc036250 for ; Tue, 25 Feb 2014 02:23:04 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s1P2N4f5036249 for freebsd-pkg@freebsd.org; Tue, 25 Feb 2014 02:23:04 GMT (envelope-from bdrewery) Received: (qmail 27716 invoked from network); 24 Feb 2014 20:23:02 -0600 Received: from unknown (HELO ?10.10.0.24?) (freebsd@shatow.net@10.10.0.24) by sweb.xzibition.com with ESMTPA; 24 Feb 2014 20:23:02 -0600 Message-ID: <530BFE7A.6010302@FreeBSD.org> Date: Mon, 24 Feb 2014 20:22:50 -0600 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Kai Gallasch , freebsd-pkg@freebsd.org Subject: Re: pkg snapshot and pkg rollback functionality References: <95F734F1-21C5-4DAC-ADC2-AF730B115237@free.de> In-Reply-To: <95F734F1-21C5-4DAC-ADC2-AF730B115237@free.de> X-Enigmail-Version: 1.6 OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bHw0o7xBhD0q3O7geHETsbp3L34j29ODS" X-BeenThere: freebsd-pkg@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Binary package management and package tools discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 02:23:06 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --bHw0o7xBhD0q3O7geHETsbp3L34j29ODS Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 1/31/2014 4:52 AM, Kai Gallasch wrote: > Hi. >=20 > I am using pkg in combination with my own poudriere repos to install an= d maintain a lot of FreeBSD servers and jails. >=20 > When upgrading FreeBSD installations I often run into the following pro= blem: >=20 > After I did a "pkg upgrade" I find out the hard way, that upgraded appl= ications are broken (software bug, config changed, incompatible dependenc= ies, etc.) and I need to go back to the state, before the pkg upgrade. > I normally get around this bis doing a "zfs snapshot" and a rollback af= ter I broke something with pkg upgrade.. >=20 > What is your preferred method of rolling back a troublesome pkg upgrade= ? >=20 > Wouldn't it be nice to have a "pkg snapshot" and "pkg rollback" functio= nality in pkg itself? >=20 > The upgrade cycle would then be: >=20 > a) pkg snapshot --create --comment "before upgrade to php 5.3.38" > b) pkg upgrade > c) bang!! php trouble.. > d) pkg snapshot --rollback --last >=20 > This could be implemented in a way to lock all packages in the local pa= ckage cache of the upgraded system, that are connected to a certain exist= ing pkg snapshot. >=20 > -- example -- >=20 > # pkg clean > The following package files will be deleted from the cache directory > /var/cache/pkg: >=20 > Package: Origin: Reason: > All/bash-4.2.45.txz shells/bash Superseded by bash-= 4.2.45_1 > All/pkg-1.2.1.txz ports-mgmt/pkg Superseded by pkg-1= =2E2.5 > All/openssl-1.0.1_8.txz security/openssl Superseded by opens= sl-1.0.1_9 > All/sqlite3-3.8.0.2.txz databases/sqlite3 Superseded by sqlit= e3-3.8.2 > All/p5-Socket6-0.25.txz net/p5-Socket6 Superseded by p5-So= cket6-0.25_1 >=20 > The following package files are locked and cannot be deleted from the c= ache > directory, because they belong to an existing snapshot. Please delete s= napshot first! >=20 > All/python27-2.7.6.txz lang/python27 needed by snapshot = $snapshot_uuid > All/p5-DateTime-1.04.txz devel/p5-DateTime needed by snapshot = $snapshot_uuid >=20 > -- example -- >=20 > Other functions: >=20 > - pkg snapshot --list > - pkg snapshot --delete --$snapshot_uuid >=20 >=20 > I think such a snapshot/rollback option for pkg would be very beneficia= l, because it would give you the option to "roll back" your pkg to every = former frozen state in an orderly manner. Even after you find out a week = later that doing an upgrade was not such a splendig idea. >=20 > What do you think? >=20 > K. >=20 >=20 > -- > GPG-Key: A593 E38B E968 4DBE 14D6 2115 7065 4D7C 4FB1 F588 > Key available from hkps://hkps.pool.sks-keyservers.net >=20 I like the concept. You can do this with ZFS plugin currently. https://github.com/freebsd/pkg-plugins/blob/master/zfssnap/README.md Also, poudriere 3.1 (not yet released) has a feature that will allow you to rollback to your previous set. It will keep N builds around for you. So if an upgrade goes bad you can change your repo to point to one of the older ones and run pkg upgrade -f to rollback. I was just thinking the other day of having pkg keep backups of upgraded packages. That would allow you to downgrade to a previous working set as well. --=20 Regards, Bryan Drewery --bHw0o7xBhD0q3O7geHETsbp3L34j29ODS Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJTC/56AAoJEDXXcbtuRpfPkNAIANwC7xsOimi8N1lhAc9Jjr0N s+VDBH6F3Q7SuT1oE13i1x4f0bTDiMUQQ7CHyFYprGDASnvlHA4ZTGe50uHjI/Ky GdIZ6FIlnEWI5KiiWx81QnWcj9BGAuTvmgbJUxI8k8WlYTPIcdqvSPN3cY7P/s/r ehD+bgzBfFb0qJUi1VDNDgbuQjm861ID+UwrABcrERGDq9mb2Qx0FNlR1a8+JtHT IjMhWp/HrBQtJdDYeZEn8sWveysWEKBMsSBfvrSaa2rGVl4FSpCOmXOlEldMh28N qLQmKdaw25DUxlWQhlgz6UGRSR4qVLQtKim5WILjFEgB8dtR0jwCvbIt6YJAys0= =MlVh -----END PGP SIGNATURE----- --bHw0o7xBhD0q3O7geHETsbp3L34j29ODS--