Hello all,
This blog-post will detail how to get the apt package manager running on the Linux OS of the PLCnext. Thus opening up more possibilities for installing packages.
This post assumes you have some experience using Linux
!!!!! DISCLAIMER THIS POST IS NOT ENDORSED OR SUPPORTED BY PHOENIX CONTACT, USE AT YOUR OWN RISK!!!!!
Used materials:
- AXC F 2152 with internet connection
- PuTTY Release 0.76
- WinSCP version 5.19.1
- Notepad ++
Before we can start to install apt root rights are required. To be able to log in as root use these steps:
- Connect to the the PLC using ssh (putty or other programs)
- Log in as admin, password is printed on the PLC housing unless changed by the user.
- Enter this command: sudo passwd root
- Follow the steps shown on the screen
- You now have the possibility to change to the root user
Next we use WinSCP to get the script on the plc:
- Download the script here: https://github.com/pxcbe/apt-installer
- If there are any changes you want to make to the file (directory where the .deb files will be saved) do it now using a text editor like notepad++ or similar.
- Transfer the .sh file to your desired directory on the PLC
Log into the PLC again using ssh and switch to the root user then use the following commands in the directory of the script :
chmod 755 apt-installer.sh
sed -i 's/\r$//' apt-installer.sh
After these commands were done successfully use this command to run the script:
bash apt-installer.sh
Now all the files will be downloaded and installed, keep an eye out for any errors that might occur, normally there should be 2 in the beginning of the script but no need to worry about those. After this is done you’re ready to use apt(-get) to install some packages.
And that’s all there is to it, below you can find some help if you run into some problems common problems i found.
if however apt(-get) update is giving you trouble use either of these commands as a workaround:
apt-get update --allow-unauthenticated
apt-get update --allow-insecure-repositories
If packages give errors on dependencies or configurations use:
rm /var/lib/dpkg/info/*Name_off_package_in_error*
dpkg --configure -D 777 Name_off_package_in_error
apt -f install
After using this run this to make sure the package has been installed correctly:
apt install Name_off_package_in_error
Then check if the original package has been installed and works.
Leave a Reply
You must be logged in to post a comment.