Repairing Broken Repository Dependencies for Ubuntu Servers
-----------------------------------
Affected Roles: Administrator, Owner
Related Digital Watchdog VMS Apps: DW Spectrum® IPVMS
Last Edit: June 11, 2021
-----------------------------------
Restoring the Repository
By default, DW Blackjack® Servers have OS updates disabled to prevent unexpected operating issues that may occur from auto-updates. As so, DW Blackjack® Servers using Ubuntu also have repository access disabled by default. This can create issues when trying to install third-party software and tools for Linux.
This article will outline how to restore the Ubuntu public repositories on a DW Blackjack® Server using Ubuntu OS.
**DISCLAIMER: Please be aware that DW Blackjack® Servers have OS updates and repository access disabled by default. Altering a DW Blackjack® Server’s OS configuration from default settings are performed at the owner’s risk.
Supported/Affected Devices:
- DW Blackjack® Tower Server Series (Linux)
- DW Blackjack® Rack Server Series (Linux)
- DW Blackjack® E-Rack Series (Linux)
- DW Blackjack® P-Rack Series (Linux)
- DW Blackjack® Cube Series (Linux)
- DW Blackjack® Bolt Series
Adding Repository Access
To add repository access for an Ubuntu Server:
- Open the Terminal program on the Linux computer. You can do this by using the Search function in the system Unity menu.
Alternatively, you can simultaneously press the Ctrl+Alt+T keys on the keyboard to launch the Terminal program.
- The Terminal window will display.
To add the ‘universe’ repository, use the command:
sudo add-apt-repository “deb http://us.archive.ubuntu.com/ubuntu/ xenial universe multiverse”
- You will be prompted to enter the superuser password. Use the root admin password (will not display):
Dw5pectrum
**NOTE: For older DW Blackjack units purchased prior to June 18, 2021, the previously utilized default Linux OS login was “admin/admin”.
- Follow adding the repository by adding the ‘main’ repository as well:
sudo add-apt-repository “deb http://us.archive.ubuntu.com/ubuntu/ xenial main universe multiverse”
- Next, to download updates, use the command:
sudo add-apt-repository “deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe multiverse”
Follow with command:
sudo apt-get update
- Allow the system to finish fetching the data packages.
You may enter the command again to double-check that the available updated data packages have been obtained by the computer.
sudo apt-get update
Troubleshooting Unmet Dependencies
Enable Repository Access
If an error occurs while attempting to add the repository, there is a chance that the atp-get command may be encountering issues when retrieving third-party dependencies. For example, such an error may display as:
The following packages have unmet dependencies:
E: Unable to correct problems, you have held broken packages.
To resolve this, make sure that the restricted and universe repositories are enabled. To do so:
- Simultaneously press the Alt+F2 () keys on the keyboard.
Next, use the command:
software-properties-gtk
- The Software Sources window will display.
Select the Ubuntu Software tab and locate the Downloadable from the Internet section.
Enable the following repositories:
- main
- universe
- restricted
- multiverse
- If the above steps does not resolve your dependency problem, try using the command sudo apt-get –f install in the computer’s Terminal program to attempt to fix the broken dependencies.
Clear Corrupted Package Database
A possible cause of unmet dependencies could be caused by packages that were not installed properly or due to a corrupted package database.
To resolve this:
- Open the Terminal program on the Linux computer. You can do this by using the Search function in the system Unity menu.
Alternatively, you can simultaneously press the Ctrl+Alt+T keys on the keyboard to launch the Terminal program.
- The Terminal window will display.
To clear the local repository of retrieved package files (.deb), use the command:
sudo apt-get clean
- To clear the local repository of retrieved package files (.deb) that are no longer available or supported, use the command:
sudo apt-get autoclean
Fix Broken Dependencies
If a package was installed manually but has unmet dependencies, you can try to fix the missing portions or remove problematic packages. To do so:
- Open the Terminal program on the Linux computer. You can do this by using the Search function in the system Unity menu.
Alternatively, you can simultaneously press the Ctrl+Alt+T keys on the keyboard to launch the Terminal program.
- The Terminal window will display.
Next, use the command:
sudo apt-get –f install
- Lastly, use the commands:
sudo dpkg –-configure -a
Then use:
sudo apt-get –f install
- If the resulting output displays as below, this solution has not resolved the issue. Proceed to the next recommended solution.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded
Delete Packages
Sometimes packages will be retained by the system if there are dependency conflicts that the apt command cannot resolve. In these cases it may be better to remove the package(s), then reinstall any needed packages again.
To delete held packages:
- Open the Terminal program on the Linux computer. You can do this by using the Search function in the system Unity menu.
Alternatively, you can simultaneously press the Ctrl+Alt+T keys on the keyboard to launch the Terminal program.
- The Terminal window will display.
Next, use the command:
sudo apt-get –u dist-upgrade
- If the resulting output shows that there are held packages, it may be best to remove them. To attempt to repair the conflicts:
sudo apt-get –o Debug::pkgProblemresolver=yes dist-upgrade
- If the conflicts cannot be resolved, the resulting output will display something like:
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded
Delete the packages one-at-a-time, running the sudo apt-get –u dist-upgrade command after removing each package, until there are no more held packages.
sudo apt-get –u dist-upgrade
- Reinstall any needed packages.
You may use the command below before installing to become informed of the consequences of installing a package.
sudo apt-get remove --dry-run <package name>
**NOTE: Instead of “<package name>” in the command above, enter the filename of the package that is being considered for installation.