How to uninstall a package of which two versions are installed?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite












I currently have a package (opencv) installed twice on my Ubuntu 16.04 system. I only realized this was the case when a Python script ran with Spyder gave me this error:



OSError: libopencv_highgui.so.3.3: cannot open shared object file: No such file or directory


My usr/local/lib folder now looks like this:



libopencv_aruco.so libopencv_imgproc.so.3.3
libopencv_aruco.so.3.3 libopencv_imgproc.so.3.3.1
libopencv_aruco.so.3.3.1 libopencv_imgproc.so.3.4
libopencv_aruco.so.3.4 libopencv_imgproc.so.3.4.0
libopencv_aruco.so.3.4.1 libopencv_imgproc.so.3.4.1
[...]


The packages were initially installed following OpenCV's official installation guide, relying on cmake, make and on sudo make install commands.



The only build folder on my computer is now that of version 3.4.1. Running sudo make uninstall would remove it, but I actually need to remove 3.3.1 instead.



Is there a way to uninstall the earlier version?
Would it be the same as deleting all .3.3 and .3.3.1 files?



Alternatively, is there a way to tell Python to ignore the first installation and only use 3.4.1?










share|improve this question























  • How exactly did you install the two versions?
    – ceccoemi
    Apr 17 at 20:04










  • @check-emee, I added a couple of lines explaining how
    – raggot
    Apr 18 at 7:29










  • Have you tried to reinstall opencv-3.3.1 and then run in the build folder sudo make uninstall?
    – ceccoemi
    Apr 18 at 13:32










  • @check-emee, I have not. It's an option I though of, but the installation I had done followed a particular cmake configuration which I do not have anymore (long story short: I tried many things, and never got OpenCV to be visible by another package, and this is why I then tried a later version). So even if I cloned a new repository with an older version of OpenCV and rebuilt the program, I'd really don't know if that would work. I also don't know if uninstalling that package would break the new installation. What would happen if I just deleted all the .3.3 files?
    – raggot
    Apr 18 at 13:45











  • Yes, maybe the best option is to manually delete all the .3.3 files. Try to find them with mlocate or find and then delete them. A suggestion: have you considered to use a Python virtual environment? I think that is the best and easiest way to deal with different versions of packages.
    – ceccoemi
    Apr 18 at 13:55














up vote
0
down vote

favorite












I currently have a package (opencv) installed twice on my Ubuntu 16.04 system. I only realized this was the case when a Python script ran with Spyder gave me this error:



OSError: libopencv_highgui.so.3.3: cannot open shared object file: No such file or directory


My usr/local/lib folder now looks like this:



libopencv_aruco.so libopencv_imgproc.so.3.3
libopencv_aruco.so.3.3 libopencv_imgproc.so.3.3.1
libopencv_aruco.so.3.3.1 libopencv_imgproc.so.3.4
libopencv_aruco.so.3.4 libopencv_imgproc.so.3.4.0
libopencv_aruco.so.3.4.1 libopencv_imgproc.so.3.4.1
[...]


The packages were initially installed following OpenCV's official installation guide, relying on cmake, make and on sudo make install commands.



The only build folder on my computer is now that of version 3.4.1. Running sudo make uninstall would remove it, but I actually need to remove 3.3.1 instead.



Is there a way to uninstall the earlier version?
Would it be the same as deleting all .3.3 and .3.3.1 files?



Alternatively, is there a way to tell Python to ignore the first installation and only use 3.4.1?










share|improve this question























  • How exactly did you install the two versions?
    – ceccoemi
    Apr 17 at 20:04










  • @check-emee, I added a couple of lines explaining how
    – raggot
    Apr 18 at 7:29










  • Have you tried to reinstall opencv-3.3.1 and then run in the build folder sudo make uninstall?
    – ceccoemi
    Apr 18 at 13:32










  • @check-emee, I have not. It's an option I though of, but the installation I had done followed a particular cmake configuration which I do not have anymore (long story short: I tried many things, and never got OpenCV to be visible by another package, and this is why I then tried a later version). So even if I cloned a new repository with an older version of OpenCV and rebuilt the program, I'd really don't know if that would work. I also don't know if uninstalling that package would break the new installation. What would happen if I just deleted all the .3.3 files?
    – raggot
    Apr 18 at 13:45











  • Yes, maybe the best option is to manually delete all the .3.3 files. Try to find them with mlocate or find and then delete them. A suggestion: have you considered to use a Python virtual environment? I think that is the best and easiest way to deal with different versions of packages.
    – ceccoemi
    Apr 18 at 13:55












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I currently have a package (opencv) installed twice on my Ubuntu 16.04 system. I only realized this was the case when a Python script ran with Spyder gave me this error:



OSError: libopencv_highgui.so.3.3: cannot open shared object file: No such file or directory


My usr/local/lib folder now looks like this:



libopencv_aruco.so libopencv_imgproc.so.3.3
libopencv_aruco.so.3.3 libopencv_imgproc.so.3.3.1
libopencv_aruco.so.3.3.1 libopencv_imgproc.so.3.4
libopencv_aruco.so.3.4 libopencv_imgproc.so.3.4.0
libopencv_aruco.so.3.4.1 libopencv_imgproc.so.3.4.1
[...]


The packages were initially installed following OpenCV's official installation guide, relying on cmake, make and on sudo make install commands.



The only build folder on my computer is now that of version 3.4.1. Running sudo make uninstall would remove it, but I actually need to remove 3.3.1 instead.



Is there a way to uninstall the earlier version?
Would it be the same as deleting all .3.3 and .3.3.1 files?



Alternatively, is there a way to tell Python to ignore the first installation and only use 3.4.1?










share|improve this question















I currently have a package (opencv) installed twice on my Ubuntu 16.04 system. I only realized this was the case when a Python script ran with Spyder gave me this error:



OSError: libopencv_highgui.so.3.3: cannot open shared object file: No such file or directory


My usr/local/lib folder now looks like this:



libopencv_aruco.so libopencv_imgproc.so.3.3
libopencv_aruco.so.3.3 libopencv_imgproc.so.3.3.1
libopencv_aruco.so.3.3.1 libopencv_imgproc.so.3.4
libopencv_aruco.so.3.4 libopencv_imgproc.so.3.4.0
libopencv_aruco.so.3.4.1 libopencv_imgproc.so.3.4.1
[...]


The packages were initially installed following OpenCV's official installation guide, relying on cmake, make and on sudo make install commands.



The only build folder on my computer is now that of version 3.4.1. Running sudo make uninstall would remove it, but I actually need to remove 3.3.1 instead.



Is there a way to uninstall the earlier version?
Would it be the same as deleting all .3.3 and .3.3.1 files?



Alternatively, is there a way to tell Python to ignore the first installation and only use 3.4.1?







apt package-management python uninstall






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 18 at 7:28

























asked Apr 17 at 19:03









raggot

1418




1418











  • How exactly did you install the two versions?
    – ceccoemi
    Apr 17 at 20:04










  • @check-emee, I added a couple of lines explaining how
    – raggot
    Apr 18 at 7:29










  • Have you tried to reinstall opencv-3.3.1 and then run in the build folder sudo make uninstall?
    – ceccoemi
    Apr 18 at 13:32










  • @check-emee, I have not. It's an option I though of, but the installation I had done followed a particular cmake configuration which I do not have anymore (long story short: I tried many things, and never got OpenCV to be visible by another package, and this is why I then tried a later version). So even if I cloned a new repository with an older version of OpenCV and rebuilt the program, I'd really don't know if that would work. I also don't know if uninstalling that package would break the new installation. What would happen if I just deleted all the .3.3 files?
    – raggot
    Apr 18 at 13:45











  • Yes, maybe the best option is to manually delete all the .3.3 files. Try to find them with mlocate or find and then delete them. A suggestion: have you considered to use a Python virtual environment? I think that is the best and easiest way to deal with different versions of packages.
    – ceccoemi
    Apr 18 at 13:55
















  • How exactly did you install the two versions?
    – ceccoemi
    Apr 17 at 20:04










  • @check-emee, I added a couple of lines explaining how
    – raggot
    Apr 18 at 7:29










  • Have you tried to reinstall opencv-3.3.1 and then run in the build folder sudo make uninstall?
    – ceccoemi
    Apr 18 at 13:32










  • @check-emee, I have not. It's an option I though of, but the installation I had done followed a particular cmake configuration which I do not have anymore (long story short: I tried many things, and never got OpenCV to be visible by another package, and this is why I then tried a later version). So even if I cloned a new repository with an older version of OpenCV and rebuilt the program, I'd really don't know if that would work. I also don't know if uninstalling that package would break the new installation. What would happen if I just deleted all the .3.3 files?
    – raggot
    Apr 18 at 13:45











  • Yes, maybe the best option is to manually delete all the .3.3 files. Try to find them with mlocate or find and then delete them. A suggestion: have you considered to use a Python virtual environment? I think that is the best and easiest way to deal with different versions of packages.
    – ceccoemi
    Apr 18 at 13:55















How exactly did you install the two versions?
– ceccoemi
Apr 17 at 20:04




How exactly did you install the two versions?
– ceccoemi
Apr 17 at 20:04












@check-emee, I added a couple of lines explaining how
– raggot
Apr 18 at 7:29




@check-emee, I added a couple of lines explaining how
– raggot
Apr 18 at 7:29












Have you tried to reinstall opencv-3.3.1 and then run in the build folder sudo make uninstall?
– ceccoemi
Apr 18 at 13:32




Have you tried to reinstall opencv-3.3.1 and then run in the build folder sudo make uninstall?
– ceccoemi
Apr 18 at 13:32












@check-emee, I have not. It's an option I though of, but the installation I had done followed a particular cmake configuration which I do not have anymore (long story short: I tried many things, and never got OpenCV to be visible by another package, and this is why I then tried a later version). So even if I cloned a new repository with an older version of OpenCV and rebuilt the program, I'd really don't know if that would work. I also don't know if uninstalling that package would break the new installation. What would happen if I just deleted all the .3.3 files?
– raggot
Apr 18 at 13:45





@check-emee, I have not. It's an option I though of, but the installation I had done followed a particular cmake configuration which I do not have anymore (long story short: I tried many things, and never got OpenCV to be visible by another package, and this is why I then tried a later version). So even if I cloned a new repository with an older version of OpenCV and rebuilt the program, I'd really don't know if that would work. I also don't know if uninstalling that package would break the new installation. What would happen if I just deleted all the .3.3 files?
– raggot
Apr 18 at 13:45













Yes, maybe the best option is to manually delete all the .3.3 files. Try to find them with mlocate or find and then delete them. A suggestion: have you considered to use a Python virtual environment? I think that is the best and easiest way to deal with different versions of packages.
– ceccoemi
Apr 18 at 13:55




Yes, maybe the best option is to manually delete all the .3.3 files. Try to find them with mlocate or find and then delete them. A suggestion: have you considered to use a Python virtual environment? I think that is the best and easiest way to deal with different versions of packages.
– ceccoemi
Apr 18 at 13:55










1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










I think that the best way is to completely delete both version 3.4 and 3.3 and reinstall the 3.4 version.



To remove them try with



sudo rm -rf /usr/local/lib/libopencv_*
sudo rm -rf /usr/local/bin/opencv_*
sudo rm -rf /usr/local/include/opencv*
sudo rm -rf /usr/local/lib/pkgconfig/opencv.pc


To check if there are still some opencv components try a search with



sudo updatedb
locate opencv


If you don't have the updatedb/locate command I suggest you to install it with sudo apt install mlocate.



Then try to reinstall OpenCV 3.4






share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "89"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1025905%2fhow-to-uninstall-a-package-of-which-two-versions-are-installed%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote



    accepted










    I think that the best way is to completely delete both version 3.4 and 3.3 and reinstall the 3.4 version.



    To remove them try with



    sudo rm -rf /usr/local/lib/libopencv_*
    sudo rm -rf /usr/local/bin/opencv_*
    sudo rm -rf /usr/local/include/opencv*
    sudo rm -rf /usr/local/lib/pkgconfig/opencv.pc


    To check if there are still some opencv components try a search with



    sudo updatedb
    locate opencv


    If you don't have the updatedb/locate command I suggest you to install it with sudo apt install mlocate.



    Then try to reinstall OpenCV 3.4






    share|improve this answer
























      up vote
      1
      down vote



      accepted










      I think that the best way is to completely delete both version 3.4 and 3.3 and reinstall the 3.4 version.



      To remove them try with



      sudo rm -rf /usr/local/lib/libopencv_*
      sudo rm -rf /usr/local/bin/opencv_*
      sudo rm -rf /usr/local/include/opencv*
      sudo rm -rf /usr/local/lib/pkgconfig/opencv.pc


      To check if there are still some opencv components try a search with



      sudo updatedb
      locate opencv


      If you don't have the updatedb/locate command I suggest you to install it with sudo apt install mlocate.



      Then try to reinstall OpenCV 3.4






      share|improve this answer






















        up vote
        1
        down vote



        accepted







        up vote
        1
        down vote



        accepted






        I think that the best way is to completely delete both version 3.4 and 3.3 and reinstall the 3.4 version.



        To remove them try with



        sudo rm -rf /usr/local/lib/libopencv_*
        sudo rm -rf /usr/local/bin/opencv_*
        sudo rm -rf /usr/local/include/opencv*
        sudo rm -rf /usr/local/lib/pkgconfig/opencv.pc


        To check if there are still some opencv components try a search with



        sudo updatedb
        locate opencv


        If you don't have the updatedb/locate command I suggest you to install it with sudo apt install mlocate.



        Then try to reinstall OpenCV 3.4






        share|improve this answer












        I think that the best way is to completely delete both version 3.4 and 3.3 and reinstall the 3.4 version.



        To remove them try with



        sudo rm -rf /usr/local/lib/libopencv_*
        sudo rm -rf /usr/local/bin/opencv_*
        sudo rm -rf /usr/local/include/opencv*
        sudo rm -rf /usr/local/lib/pkgconfig/opencv.pc


        To check if there are still some opencv components try a search with



        sudo updatedb
        locate opencv


        If you don't have the updatedb/locate command I suggest you to install it with sudo apt install mlocate.



        Then try to reinstall OpenCV 3.4







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Apr 18 at 17:01









        ceccoemi

        1968




        1968



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1025905%2fhow-to-uninstall-a-package-of-which-two-versions-are-installed%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            pylint3 and pip3 broken

            Missing snmpget and snmpwalk

            How to enroll fingerprints to Ubuntu 17.10 with VFS491