When setting up your new LPA3588 embedded computer with Ubuntu 20.04, you may encounter some challenges when using apt for package installations. This article outlines the common problems and provides effective solutions for resolving them.
I recently purchased a LPA3588 embedded computer, which came with Ubuntu 20.04 pre-installed. As someone with prior experience using Ubuntu on x86 architecture, I initially thought the setup would be straightforward. However, things didn’t go as smoothly as expected.
Step 1: Updating the Source List
I started by changing the /etc/apt/sources.list file using a mirror from huaweicloud.com to speed up the package installation process. This step was uneventful, but there’s a crucial point to note: don’t use the mirror I chose (I will explain why later).
Step 2: Installing Build-Essential
I then tried installing build-essential, which is a common package for setting up a development environment. Here’s the command and the error I received:
$ sudo apt install build-essential
The output read:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
build-essential : Depends: g++ (>= 4:7.2) but it is not going to be installed
Depends: dpkg-dev (>= 1.17.11) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
This error means that g++ and dpkg-dev versions were too low or not installed, causing conflicts. I attempted to manually install these packages, but the issue persisted. Even after installing g++ and dpkg-dev, I encountered additional dependency issues, which were also unresolved.
Step 3: The Solution – Reinstalling GCC and dpkg-dev
After some research, I found that removing and reinstalling gcc and dpkg-dev might resolve the problem. But when I uninstalled gcc, I found that it could no longer be reinstalled. This led me to uninstall dpkg-dev, but that also resulted in a failure to reinstall.
Step 4: Installing CMake
At this point, I decided to try installing another package—cmake. Here’s what happened:
$ sudo apt-get install cmake
The installation proceeded successfully, but it installed an older version from Ubuntu 18.04 repositories. I realized that I needed to update my sources to the Ubuntu 20.04 repositories.
Step 5: Switching to Ubuntu 20.04 Repositories
To fix this, I replaced the /etc/apt/sources.list with the proper Ubuntu 20.04 mirror. Here’s how I updated the source list:
# Default sources for Ubuntu 20.04 (focal)
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-backports main restricted universe multiverse
deb http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse
After updating the sources, I ran the following command:
$ sudo apt update && sudo apt upgrade
Step 6: Installing Build-Essential Again
After successfully updating the repositories, I tried installing build-essential again:
$ sudo apt-get install build-essential
This time, the installation completed successfully, with the appropriate versions of g++, dpkg-dev, and other required packages being installed. The error I had encountered earlier was now resolved.
H2: Key Takeaways and Final Thoughts
Installing packages like build-essential on the LPA3588 running Ubuntu 20.04 can be tricky due to incorrect repository sources or missing dependencies. Here’s a quick recap of what worked for me:
1.Check your sources list: Ensure you’re using the correct Ubuntu 20.04 repositories for your system’s architecture.
2.Fix dependency issues: If apt reports broken packages or unmet dependencies, try updating your repositories and reinstalling the problematic packages.
3.Install necessary packages: If you encounter errors with one package, attempt installing others like cmake or upgrading all packages to ensure compatibility.
By following these steps, you should be able to get your development environment running smoothly on the LPA3588. If you encounter any further issues, checking forums and documentation for LPA3588-specific problems may provide additional solutions.