Can't remover incorrect package
I got my model of Raspberry Pi wrong :-( I tried to install the arm7 version - teamviewer-iot-agent-armv7_2.8.18_armhf.deb but my Pi has a an armv61 processor. Not surpisingly, I got an illegal instruction error.
Now I want to uninstall this package so I can install the armv5 one, which looks like is should work. I have tried dpkt with -r and -P options but I get the same error (The --force option has been depreciated - I tried that too):
pi@raspberrypi:~/teamviewer $ sudo dpkg -r teamviewer-iot-agent-armv7
(Reading database ... 55352 files and directories currently installed.)
Removing teamviewer-iot-agent-armv7 (2.8.18) ...
dpkg: error processing package teamviewer-iot-agent-armv7 (--remove):
installed teamviewer-iot-agent-armv7 package pre-removal script subprocess returned error exit status 1
...
Any suggestions please?
Best Answers
-
Sorry @mircea_c , I tried this yesterday and replied, but my reply was not saved. Never mind.
I think the command you suggested is equivilent to dpkt -P which I mentioned in my inital post. The command got the same error as I had earlier. It did not remove the package.pi@raspberrypi:~ $ sudo apt-get --purge remove teamviewer-iot-agent-armv7
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
teamviewer-iot-agent-armv7*
0 upgraded, 0 newly installed, 1 to remove and 13 not upgraded.
After this operation, 30.6 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 55352 files and directories currently installed.)
Removing teamviewer-iot-agent-armv7 (2.8.18) ...
dpkg: error processing package teamviewer-iot-agent-armv7 (--remove):
installed teamviewer-iot-agent-armv7 package pre-removal script subprocess returned error exit status 1
Synchronizing state of teamviewer-iot-agent.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable teamviewer-iot-agent
[/]Job for teamviewer-iot-agent.service failed because the control process exited with error code.
See "systemctl status teamviewer-iot-agent.service" and "journalctl -xe" for details.
Errors were encountered while processing:
teamviewer-iot-agent-armv7
E: Sub-process /usr/bin/dpkg returned an error code (1)
pi@raspberrypi:~ $
pi@raspberrypi:~ $ sudo teamviewer-iot-agent start
pi@raspberrypi:~ $ sudo teamviewer-iot-agent start
Synchronizing state of teamviewer-iot-agent.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable teamviewer-iot-agent
Job for teamviewer-iot-agent.service failed because the control process exited with error code.
See "systemctl status teamviewer-iot-agent.service" and "journalctl -xe" for details.
pi@raspberrypi:~ $5 -
Hello @SteveCos
Please try to do to the following steps:
Open and insert in the second line of the file ”teamviewer-iot-agent.prerm” this: “exit 0”
The file ”teamviewer-iot-agent.prerm” is stored in “/var/lib/dpgk/info/”
So, the full path is “/var/lib/dpgk/info/teamviewer-iot-agent.prerm”
After, run “sudo apt remove teamviewer-iot-agent”
Regards,
Mircea
Tech Support IoT
5
Answers
-
Sorry @mircea_c , I tried this yesterday and replied, but my reply was not saved. Never mind.
I think the command you suggested is equivilent to dpkt -P which I mentioned in my inital post. The command got the same error as I had earlier. It did not remove the package.pi@raspberrypi:~ $ sudo apt-get --purge remove teamviewer-iot-agent-armv7
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
teamviewer-iot-agent-armv7*
0 upgraded, 0 newly installed, 1 to remove and 13 not upgraded.
After this operation, 30.6 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 55352 files and directories currently installed.)
Removing teamviewer-iot-agent-armv7 (2.8.18) ...
dpkg: error processing package teamviewer-iot-agent-armv7 (--remove):
installed teamviewer-iot-agent-armv7 package pre-removal script subprocess returned error exit status 1
Synchronizing state of teamviewer-iot-agent.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable teamviewer-iot-agent
[/]Job for teamviewer-iot-agent.service failed because the control process exited with error code.
See "systemctl status teamviewer-iot-agent.service" and "journalctl -xe" for details.
Errors were encountered while processing:
teamviewer-iot-agent-armv7
E: Sub-process /usr/bin/dpkg returned an error code (1)
pi@raspberrypi:~ $
pi@raspberrypi:~ $ sudo teamviewer-iot-agent start
pi@raspberrypi:~ $ sudo teamviewer-iot-agent start
Synchronizing state of teamviewer-iot-agent.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable teamviewer-iot-agent
Job for teamviewer-iot-agent.service failed because the control process exited with error code.
See "systemctl status teamviewer-iot-agent.service" and "journalctl -xe" for details.
pi@raspberrypi:~ $5 -
Hello @SteveCos
Please try to do to the following steps:
Open and insert in the second line of the file ”teamviewer-iot-agent.prerm” this: “exit 0”
The file ”teamviewer-iot-agent.prerm” is stored in “/var/lib/dpgk/info/”
So, the full path is “/var/lib/dpgk/info/teamviewer-iot-agent.prerm”
After, run “sudo apt remove teamviewer-iot-agent”
Regards,
Mircea
Tech Support IoT
5 -
I like the style ... script won't run without generating an error, so tell not to try, just exit cleanly. Works for me! :-)
The filenames you suggested were not quite right, but the idea was good, and I worked out the names.
Thanks! Stevepi@ZIPgateway:~/teamviewer $ sudo nano /var/lib/dpkg/info/teamviewer-iot-agent-armv7.prerm
pi@ZIPgateway:~/teamviewer $ sudo apt-get remove teamviewer-iot-agent-armv7
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
teamviewer-iot-agent-armv7
0 upgraded, 0 newly installed, 1 to remove and 13 not upgraded.
1 not fully installed or removed.
After this operation, 30.6 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 55352 files and directories currently installed.)
Removing teamviewer-iot-agent-armv7 (2.8.18) ...
Processing triggers for man-db (2.8.5-2) ...
pi@ZIPgateway:~/teamviewer $
pi@ZIPgateway:~/teamviewer $ sudo dpkg -i teamviewer-iot-agent-armv5_2.8.18_armhf.deb
(Reading database ... 55312 files and directories currently installed.)
Preparing to unpack teamviewer-iot-agent-armv5_2.8.18_armhf.deb ...
Unpacking teamviewer-iot-agent-armv5 (2.8.18) ...
Setting up teamviewer-iot-agent-armv5 (2.8.18) ...
Synchronizing state of teamviewer-iot-agent.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable teamviewer-iot-agent
Processing triggers for systemd (241-7~deb10u3+rpi1) ...
Processing triggers for man-db (2.8.5-2) ...
pi@ZIPgateway:~/teamviewer $
pi@ZIPgateway:~/teamviewer $ sudo teamviewer-iot-agent assign -t 8620366-dIsj17fgj762V0qWq5SR -g $'Gateway ZIP'
Waiting for teamviewer-iot-agent to come online ...
Connection time expired.
Check the network and try to setup again.
See the log file => teamviewer-iot-agent log
pi@ZIPgateway:~/teamviewer $
pi@ZIPgateway:~/teamviewer $ sudo teamviewer-iot-agent log
pi@ZIPgateway:~/teamviewer $ sudo teamviewer-iot-agent assign -t 8620366-dIsj17fgj762V0qWq5SR -g $'Gateway ZIP'
Assignment is in progress ...
Device is assigned to Steve Cosgrove and located in the Gateway ZIP group.
Device will be accessible and managed by this account.
Assignment can be removed using 'unmanage' command.
pi@ZIPgateway:~/teamviewer $0