Score:0

Errors when running `apt update`. W: NO PUB_KEY and W:Target package is configured multiple times

za flag

When I try to update my system with sudo apt-get update, I receive the following:

Hit:1 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:2 http://archive.ubuntu.com/ubuntu focal InRelease
Get:3 http://pkg.scaleft.com/deb linux InRelease [4808 B]
Hit:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:5 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Err:3 http://pkg.scaleft.com/deb linux InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F716E939977FC428
Reading package lists... Done
W: GPG error: http://pkg.scaleft.com/deb linux InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F716E939977FC428
E: The repository 'http://pkg.scaleft.com/deb linux InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:51
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:51
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:51
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:51
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:51

How can I fix this and update my system?

EDIT

Now, I am getting:

root@PYAMMANO-68J9Z:/# echo "deb http://pkg.scaleft.com/deb linux main" | sudo tee -a /etc/apt/sources.list
deb http://pkg.scaleft.com/deb linux main
root@PYAMMANO-68J9Z:/# curl -fsSL https://dist.scaleft.com/pki/scaleft_deb_key.asc | gpg --dearmor | sudo tee /usr/share/keyrings/scaleft-archive-keyring.gpg > /dev/null
root@PYAMMANO-68J9Z:/# apt -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 95 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up scaleft-server-tools (1.56.1) ...
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
dpkg: error processing package scaleft-server-tools (--configure):
 installed scaleft-server-tools package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 scaleft-server-tools
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:51
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:51
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:51
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:51
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:51
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:52
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:52
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:52
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:52
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:52
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list.d/scaleft.list:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list.d/scaleft.list:1
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list.d/scaleft.list:1
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list.d/scaleft.list:1
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list.d/scaleft.list:1
E: Sub-process /usr/bin/dpkg returned an error code (1)
vanadium avatar
cn flag
Please elaborate on your question in the body of the question and apply formatting code for any code you include. Currently, the question cannot be read.
in flag
Based on the message, you will want to fix your `/etc/apt/sources.list` to remove duplicate lines. This can be done by putting a `#` at the start of a line with a duplicate, or removing it altogether. Once done, you will be able to update and upgrade correctly.
Score:1
my flag

There are three errors in your system.

  • First, one of your repositories is not signed and requires a GPG key.

  • Secondly, your sources.list has duplicate sources.

  • Third, your system has a corrupted package.

Adding the proper signatures.

  1. Run the following command in a terminal:

    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F716E939977FC428
    
  2. Update:

    sudo apt update
    

Fixing the duplicate entries.

  1. Install the Y-PPA-MANAGER:

    sudo add-apt-repository ppa:webupd8team/y-ppa-manager
    sudo apt upgrade
    sudo apt install y-ppa-manager
    
  2. Open the Y-PPA-MANAGER:

    sudo y-ppa-manager
    

    Y PPA MANAGER

  3. Navigate to Advanced → Scan and remove duplicate PPAs.

    Advanced options.

  4. Let it complete and run:

    sudo apt update 
    

To fix the corrupted package:

  1. First, update the repositories:

    sudo apt update
    
  2. Now, run:

    sudo apt download runit-systemd && sudo dpkg -i --force-all ./*.deb
    
  3. Run force install:

    sudo apt -f install
    

    This will also install the package you wanted to install i.e scaleft-server-tools.

If you want you can purge reinstall the package. By running:

sudo dpkg -P scaleft-server-tools --force-all && sudo apt install scaleft-server-tools

Alternatively, you can manually edit the post-installation files for the package scaleft-server-tools and replace the systemctl command with the service command and run sudo apt -f install. Reboot to confirm all the changes.

That's it!
Good Luck!

EDIT

For problem #3 i.e Corrupted package.

In the documentation, I found that for Ubuntu 20.04 Focal or above, you need to explicitly allow certificate authorities (CAs) to use the ssh-rsa algorithm to sign certificates.

To do this, you need to add the following line to your OpenSSH daemon file (which is either /etc/ssh/sshd_config or a drop-in file under /etc/ssh/sshd_config.d/):

CASignatureAlgorithms +ssh-rsa
Score:0
br flag
Jad

Following the instructions on Okta.com (formatting, my own):

2.Trust the repository signing key:

curl -fsSL https://dist.scaleft.com/pki/scaleft_deb_key.asc | gpg --dearmor | sudo tee /usr/share/keyrings/scaleft-archive-keyring.gpg > /dev/null

after you've installed the certificate, you might need to apt -f install to fix any installation you've tried to do already, but then hopefully everything else will install happily.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.