Recently I install a custom ROM named eelo https://e.foundation/. It comes with pre-installed Telegram app. After much research I was able to uninstall if from the system with the command adb shell pm uninstall --user 0 org.telegram.messenger. But when I tried to install the new apk with adb install telegram.apk I got the following error

adb: failed to install telegram.apk: Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package org.telegram.messenger signatures do not match the previously installed version; ignoring!]

I also tried uninstalling with this adb uninstall org.telegram.messenger but it gave out Failure [DELETE_FAILED_INTERNAL_ERROR]. With further research I found out that I can install the new .apk with different if I comment the section in /data/system/packages.xml referring to telegram. But after making the change when I reboot it get back to the unedited version.

Currently using Android Nougat 7.1.

Can anyone tell me the reason as to why this happens and how I can stop it from happening? And how would I be able to install a different version of the app?

2 Answers 2


Ultimately found an answer to the query and how to solve it.

  1. The first is how to delete a system application completely? These are the following steps

    $ adb root - To start adbd with root privileges.

    $ adb shell - To interact with the phone system directly.

    $ pm uninstall --user 0 <package>.apk - To uninstall the package from the root user is any package you want to remove from the system.

    These few steps may remove the whole package but in my case it was different as it left behind few files from the previous built app. So these were the steps that I followed :

    $ adb shell mount -o rw,remount /system - This would remount the system as read-write. Originally /system is a read-only folder so you can't edit directly.

    $ adb shell rm -r /system/<package>.apk - This would remove the apk and there won't be anything left from the previous built.

  2. Why I couldn't edit the /data/system/packages.xml file?

    The answer to this is that though I can edit it with vim but it kept reverting back to the previous unedited form. This was happening because it was updating the information from /system/app files. Thus, editing it went in vain.

Refer to the following links that actually helped me out




Try using an apk Cloner if you want to reach to your goal fast. using https://appcloner.app/ you can change the package id of your new telegram version and install it manually

  • That isn't really the answer to my problem or the issue I'm facing. Diversion to a problem can't be considered as a solution. Your suggestion gonna work to a limit but still the files of the previously installed telegram app would be there and I won't be able to appreciate that.
    – Tintin
    Commented Jun 12, 2019 at 13:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .