16

I just walked into the trap of calling

sudo apt-get install autoremove

I did it because I was unable to install sudo apt-get install libopencv-dev because of unmet dependencies. Now my ros-indigo installation is broke, opencv is still not installed and I also cannot reinstall it.

When trying to install it I get only

E: Unable to correct problems, you have held broken packages.

I fear that I'm really close to killing my entire package-dependency system. Can someone help me please?

Can I somehow use the file /var/log/apt to reverse the step of deleting ros?

mcExchange
  • 3,398

2 Answers2

19

I don't Know if there is any simpler way but if you look at /var/log/apt/history.log you can see what was removed. Just reinstall each package that was removed.

Using this may save your time

echo '#!/bin/bash' > restore
echo sudo apt-get install `grep Remove /var/log/apt/history.log | tail -1 | sed -e 's|Remove: ||g' -e 's|([^)]*)||g' -e 's|:[^ ]* ||g' -e 's|,||g'` >> restore
chmod +x restore 
./restore
storm
  • 5,013
0

If you are using ROS and the other answer does not fix the problem completely, you can go to your workspace and do:

rosdep install --from-paths src --ignore-src -r -y
Nesi
  • 1