Makers Blog

Installing apt(-get) package manager on PLCnext

Robin Detobel 22 September 2021 min. read
1,617 views 1 comments

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


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:

  1. Connect to the the PLC using ssh (putty or other programs)
  2. Log in as admin, password is printed on the PLC housing unless changed by the user.
  3. Enter this command: sudo passwd root
  4. Follow the steps shown on the screen
  5. You now have the possibility to change to the root user

Next we use WinSCP to get the script on the plc:

  1. Download the script here:
  2. 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.
  3. 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
sed -i 's/\r$//'

After these commands were done successfully use this command to run the script:


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.


The Makers Blog shows applications and user stories of community members that are not tested or reviewed by Phoenix Contact. Use them at your own risk.


Please login/register to comment


Leave a Reply

Nao.Y. 08.04.2024

Hello, The script downloaded from the GitHub site has errors, and I found many of the filenames and some of the URLs on the Debian site have been changed. I confirmed the corrected one at hand worked well. Should I send it to someone managing the repository? Bast Regards, Naosugi Yumoto

Login / Register to reply
Never miss a new article
Sign up for the newsletter
Never miss news about PLCnext Technology
Get interesting content via newsletter four times a year
Receive exclusive information before all other users