When I try to update my system with sudo apt-get update, I receive the following:
Hit:1 focal-security InRelease
Hit:2 focal InRelease
Get:3 linux InRelease [4808 B]
Hit:4 focal-updates InRelease
Hit:5 focal-backports InRelease
Err:3 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: linux InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F716E939977FC428
E: The repository ' 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:51How can I fix this and update my system?
EDIT
Now, I am getting:
root@PYAMMANO-68J9Z:/# echo "deb linux main" | sudo tee -a /etc/apt/sources.list
deb linux main
root@PYAMMANO-68J9Z:/# curl -fsSL | 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) 2 2 Answers
There are three errors in your system.
First, one of your repositories is not signed and requires a GPG key.
Secondly, your
sources.listhas duplicate sources.Third, your system has a corrupted package.
Adding the proper signatures.
Run the following command in a terminal:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F716E939977FC428Update:
sudo apt update
Fixing the duplicate entries.
Install the
Y-PPA-MANAGER:sudo add-apt-repository ppa:webupd8team/y-ppa-manager sudo apt upgrade sudo apt install y-ppa-managerOpen the
Y-PPA-MANAGER:sudo y-ppa-managerNavigate to Advanced → Scan and remove duplicate PPAs.
Let it complete and run:
sudo apt update
To fix the corrupted package:
First, update the repositories:
sudo apt updateNow, run:
sudo apt download runit-systemd && sudo dpkg -i --force-all ./*.debRun force install:
sudo apt -f installThis 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-toolsAlternatively, 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 1 Following the instructions on Okta.com (formatting, my own):
2.Trust the repository signing key:
curl -fsSL | 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.