######################################################
apt install build-essential zlib1g-dev libssl-dev
mkdir /var/lib/sshd
chmod -R 700 /var/lib/sshd/
chown -R root:sys /var/lib/sshd/
useradd -r -U -d /var/lib/sshd/ -c "sshd privsep" -s /bin/false sshd
wget -c https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.0p1.tar.gz
tar -xzf openssh-8.0p1.tar.gz
cd openssh-8.0p1/
apt install libpam0g-dev libselinux1-dev
./configure --with-md5-passwords --with-pam --with-selinux --with-privsep-path=/var/lib/sshd/ --sysconfdir=/etc/ssh
make
make install
######################################################
In some cases u will get broken packages when doing the install then you can do the below steps:
root@logserver:~# apt install build-essential zlib1g-dev libssl-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version (12.4ubuntu1).
zlib1g-dev is already the newest version (1:1.2.11.dfsg-0ubuntu2).
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:
libssl-dev : Depends: libssl1.1 (= 1.1.1-1ubuntu2.1~18.04.4) but 1.1.1a-1 is to be installed
E: Unable to correct problems, you have held broken packages.
FIX:
sudo dpkg --list | grep zlib
sudo aptitude install libssl-dev zlib1g-dev=1:1.2.11.dfsg-0ubuntu2
root@appserver:~# sudo dpkg --list | grep zlib
ii zlib1g:amd64 1:1.2.11.dfsg-0ubuntu2 amd64 compression library - runtime
ii zlib1g-dev:amd64 1:1.2.11.dfsg-0ubuntu2 amd64 compression library - development
root@appserver:~#
root@appserver:~#
root@appserver:~#
root@appserver:~# sudo aptitude install libssl-dev zlib1g-dev=1:1.2.11.dfsg-0ubuntu2
zlib1g-dev is already installed at the requested version (1:1.2.11.dfsg-0ubuntu2)
zlib1g-dev is already installed at the requested version (1:1.2.11.dfsg-0ubuntu2)
The following NEW packages will be installed:
libssl-dev{b}
0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,566 kB of archives. After unpacking 7,846 kB will be used.
The following packages have unmet dependencies:
libssl-dev : Depends: libssl1.1 (= 1.1.1-1ubuntu2.1~18.04.4) but 1.1.1b-1 is installed
The following actions will resolve these dependencies:
Keep the following packages at their current version:
1) libssl-dev [Not Installed]
Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:
Downgrade the following packages:
1) libssl1.1 [1.1.1b-1 (now) -> 1.1.1-1ubuntu2.1~18.04.4 (bionic-updates)]
Accept this solution? [Y/n/q/?] y
The following packages will be DOWNGRADED:
libssl1.1
The following NEW packages will be installed:
libssl-dev
0 packages upgraded, 1 newly installed, 1 downgraded, 0 to remove and 0 not upgraded.
Need to get 2,866 kB of archives. After unpacking 7,710 kB will be used.
Do you want to continue? [Y/n/?] y
Get: 1 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libssl1.1 amd64 1.1.1-1ubuntu2.1~18.04.4 [1,300 kB]
Get: 2 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libssl-dev amd64 1.1.1-1ubuntu2.1~18.04.4 [1,566 kB]
Fetched 2,866 kB in 0s (24.1 MB/s)
Preconfiguring packages ...
dpkg: warning: downgrading libssl1.1:amd64 from 1.1.1b-1 to 1.1.1-1ubuntu2.1~18.04.4
(Reading database ... 197960 files and directories currently installed.)
Preparing to unpack .../libssl1.1_1.1.1-1ubuntu2.1~18.04.4_amd64.deb ...
Unpacking libssl1.1:amd64 (1.1.1-1ubuntu2.1~18.04.4) over (1.1.1b-1) ...
Preparing to unpack .../libssl-dev_1.1.1-1ubuntu2.1~18.04.4_amd64.deb ...
Unpacking libssl-dev:amd64 (1.1.1-1ubuntu2.1~18.04.4) ...
Processing triggers for libc-bin (2.28-8) ...
Setting up libssl1.1:amd64 (1.1.1-1ubuntu2.1~18.04.4) ...
Setting up libssl-dev:amd64 (1.1.1-1ubuntu2.1~18.04.4) ...
Processing triggers for libc-bin (2.28-8) ...
https://unix.stackexchange.com/questions/389156/how-to-fix-held-broken-packages
apt install build-essential zlib1g-dev libssl-dev
mkdir /var/lib/sshd
chmod -R 700 /var/lib/sshd/
chown -R root:sys /var/lib/sshd/
useradd -r -U -d /var/lib/sshd/ -c "sshd privsep" -s /bin/false sshd
wget -c https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.0p1.tar.gz
tar -xzf openssh-8.0p1.tar.gz
cd openssh-8.0p1/
apt install libpam0g-dev libselinux1-dev
./configure --with-md5-passwords --with-pam --with-selinux --with-privsep-path=/var/lib/sshd/ --sysconfdir=/etc/ssh
make
make install
######################################################
In some cases u will get broken packages when doing the install then you can do the below steps:
root@logserver:~# apt install build-essential zlib1g-dev libssl-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version (12.4ubuntu1).
zlib1g-dev is already the newest version (1:1.2.11.dfsg-0ubuntu2).
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:
libssl-dev : Depends: libssl1.1 (= 1.1.1-1ubuntu2.1~18.04.4) but 1.1.1a-1 is to be installed
E: Unable to correct problems, you have held broken packages.
FIX:
sudo dpkg --list | grep zlib
sudo aptitude install libssl-dev zlib1g-dev=1:1.2.11.dfsg-0ubuntu2
root@appserver:~# sudo dpkg --list | grep zlib
ii zlib1g:amd64 1:1.2.11.dfsg-0ubuntu2 amd64 compression library - runtime
ii zlib1g-dev:amd64 1:1.2.11.dfsg-0ubuntu2 amd64 compression library - development
root@appserver:~#
root@appserver:~#
root@appserver:~#
root@appserver:~# sudo aptitude install libssl-dev zlib1g-dev=1:1.2.11.dfsg-0ubuntu2
zlib1g-dev is already installed at the requested version (1:1.2.11.dfsg-0ubuntu2)
zlib1g-dev is already installed at the requested version (1:1.2.11.dfsg-0ubuntu2)
The following NEW packages will be installed:
libssl-dev{b}
0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,566 kB of archives. After unpacking 7,846 kB will be used.
The following packages have unmet dependencies:
libssl-dev : Depends: libssl1.1 (= 1.1.1-1ubuntu2.1~18.04.4) but 1.1.1b-1 is installed
The following actions will resolve these dependencies:
Keep the following packages at their current version:
1) libssl-dev [Not Installed]
Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:
Downgrade the following packages:
1) libssl1.1 [1.1.1b-1 (now) -> 1.1.1-1ubuntu2.1~18.04.4 (bionic-updates)]
Accept this solution? [Y/n/q/?] y
The following packages will be DOWNGRADED:
libssl1.1
The following NEW packages will be installed:
libssl-dev
0 packages upgraded, 1 newly installed, 1 downgraded, 0 to remove and 0 not upgraded.
Need to get 2,866 kB of archives. After unpacking 7,710 kB will be used.
Do you want to continue? [Y/n/?] y
Get: 1 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libssl1.1 amd64 1.1.1-1ubuntu2.1~18.04.4 [1,300 kB]
Get: 2 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libssl-dev amd64 1.1.1-1ubuntu2.1~18.04.4 [1,566 kB]
Fetched 2,866 kB in 0s (24.1 MB/s)
Preconfiguring packages ...
dpkg: warning: downgrading libssl1.1:amd64 from 1.1.1b-1 to 1.1.1-1ubuntu2.1~18.04.4
(Reading database ... 197960 files and directories currently installed.)
Preparing to unpack .../libssl1.1_1.1.1-1ubuntu2.1~18.04.4_amd64.deb ...
Unpacking libssl1.1:amd64 (1.1.1-1ubuntu2.1~18.04.4) over (1.1.1b-1) ...
Preparing to unpack .../libssl-dev_1.1.1-1ubuntu2.1~18.04.4_amd64.deb ...
Unpacking libssl-dev:amd64 (1.1.1-1ubuntu2.1~18.04.4) ...
Processing triggers for libc-bin (2.28-8) ...
Setting up libssl1.1:amd64 (1.1.1-1ubuntu2.1~18.04.4) ...
Setting up libssl-dev:amd64 (1.1.1-1ubuntu2.1~18.04.4) ...
Processing triggers for libc-bin (2.28-8) ...
https://unix.stackexchange.com/questions/389156/how-to-fix-held-broken-packages
Comments