For the first piece, etckeeper might be a good candidate:
etckeeper is a collection of tools to let /etc be stored in a git, mercurial, bazaar or darcs repository. This lets you use git to review or revert changes that were made to /etc. Or even push the repository elsewhere for backups or cherry-picking configuration changes.
It hooks into package managers like apt to automatically commit changes made to
/etc during package upgrades. It tracks file metadata that git does not normally support, but that is important for
/etc, such as the permissions of
It's quite modular and configurable, while also being simple to use if you understand the basics of working with version control.
I've never used it myself,1 so I cannot say how well it meets your overall goal. As its description points out it hooks into package managers it might well be there is a way to cover tracking package changes as well. Worth noting, however: etckeeper is available via several distributions' repositories, e.g. for Debian and Ubuntu.
Further pointers worth checking:
1 I've just read about it in some blogs a while ago, which is how I know about it