3

I discoverd aplay could not play a sound immediately after another aplay command. I reported the issue. It seems to be working in other systems.

So I started from scratch and after each apt-get install, I tested if aplay still works, until i reached the package which caused the issue:

sudo apt-get install gstreamer1.0

off course apt-get installs other dependencies. so I did:

sudo apt-get remove gstreamer1.0
sudo apt-get autoremove

and rebooted.

However, it still does not work, I understand during the package installation several packages where installed or updated. How can i safely revert the installation (new packages & updates) to the point in time before the install?

  • Have you tried sudo apt-get purge <package name>? – Steve Robillard Dec 16 '15 at 19:51
  • @SteveRobillard thanks for helping, yes i tried sudo apt-get purge not working – Pedro Pereira Dec 16 '15 at 20:33
  • What happens if you use aptitude install <package> and aptitude purge <package> ? AFAIK it always removes the automatically installed packages then. – Diederik de Haas Dec 16 '15 at 22:14
3

To completely remove a package use:

sudo apt-get purge <package name>

This will remove the configuration as well. Though you may still have additional dependencies that were installed. To remove these do:

sudo apt-get autoremove

You could also start fresh again and make a backup after every package installation. Though this will involve a significant amount of time, disk space and patience.

You may also want to look at etckeeper. Etckeeper is a package which basically allows you to keep your /etc directory in version control. It supports several VCS, but I would suggest using git.

If not already installed you can install git by doing:

sudo apt-get install git.

Then setup the global email and username for the root user by doing:

sudo git config --global user.name "Your First and last name"
sudo git config --global user.email youremail@example.com

then install etckeeper:

sudo apt-get install etckeeper

IIRC etckeeper will notice that git is installed and automatically use it, and make an initail commit of your /etc directory.

If not you can manually edit the /etc/etckeeper/etckeeper.conf file and change it from this:

# The VCS to use.
# VCS="hg"
# VCS="git"
VCS="bzr"
# VCS="darcs"

to this:

# The VCS to use.
# VCS="hg"
VCS="git"
# VCS="bzr"
# VCS="darcs"

Then in your /etc/ directory run:

sudo etckeeper init

to initialize the repository, and then:

sudo etckeeper commit "Initial commit."

to make your initial commit.

A couple of additional config file changes you may want to consider are:

AVOID_COMMIT_BEFORE_INSTALL=1
AVOID_DAILY_AUTOCOMMITS=1

see the additional resources below for more details on these settings.

Additional information can be found here and here

With etckeeper rolling back a change to the configuration is as simple as a git revert. This also makes testing changes easier because you can create a branch to test your changes. If they fail you delete the branch and checkout the master branch, if you decide to keep them you can merge the changes into the master branch.

This will not solve all of the problems when rolling back (as some config is installed elsewhere on the filesystem, and won't fix your current issue), but does keep a record of what was done and when (for all the config data kept in your /etc/ directory.

  • unfortunately /etc is the easiest way, my issue is all the dependencies affected like shared libraries updates, or new references. I'll try again backing up the /etc folder but i don't think is a "configuration issue" – Pedro Pereira Dec 16 '15 at 20:35
  • Purge and autoremove should have removed the additional dependencies assuming they were not needed by anything else. etckeeper will list all packages installed not just the main package. so you could manually remove the dependencies. – Steve Robillard Dec 16 '15 at 20:37
  • i've started from scratch, installed etckeeper, touched a file inside etc, started the gstream1.0 install, removed with purge, i went to etckeeper no changes from gstreamer install, only my file is reported in git status. The problem is still here. – Pedro Pereira Dec 16 '15 at 22:11
  • what does sudo git log show was installed. you may have to go backa few commits – Steve Robillard Dec 16 '15 at 22:13
0

The best way to do the equivalent to a restore point is to already do routine saves of your SD card image to disk.

Remember, these cards can always fail at any time without notice.

So, be sure to use

Win32DiskImager

Download here: https://sourceforge.net/projects/win32diskimager/

Make routine backups of your SD card to .IMG files on a hard drive.

No matter what goes wrong you can always restore the entire system back to a known, good state.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.