Ubuntu – If I build a package from source how can I uninstall or remove completely


I used source code to build one package such as below:

./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libexecdir=/usr/lib --with-package-name="Myplugin" --with-package-origin="http://www.ubuntu.org/" --enable-gtk-doc --disable-static
make install

But unfortunately, i discovered that its the latest version, and has lot of bugs, so i need to remove it/uninstall it. But how can i do so? I tried make clean; make uninstall but still i see it exist:

# pkg-config --list-all | grep Myplugin
$ ls /usr/lib/myplugin/libXYZ.so

How do you remove this now?

Best Answer

  • Usually you can just use:

    make uninstall


    sudo make uninstall

    if the app was installed as root.

    But this will work only if the developer of the package has taken care of making a good uninstall rule.

    You can also try to get a look at the steps used to install the software by running:

    make -n install

    And then try to reverse those steps manually.

    In the future to avoid that kind of problems try to use checkinstall instead of make install whenever possible (AFAIK always unless you want to keep both the compiled and a packaged version at the same time). It will create and install a deb file that you can then uninstall using your favorite package manager.

    make clean usually cleans the building directories, it doesn't uninstall the package. It's used when you want to be sure that the whole thing is compiled, not just the changed files.

  • Related Question