如果 apt 拒绝某个版本,我该如何将软件包降级到该版本?

如果 apt 拒绝某个版本,我该如何将软件包降级到该版本?

今天早上我进行了升级openssllibssl因为有一些安全更新可用:

# apt list --upgradable
Listing... Done
libssl-dev/xenial-updates,xenial-security 1.0.2g-1ubuntu4.13 amd64 [upgradable from: 1.0.2g-1ubuntu4.12]
libssl-doc/xenial-updates,xenial-updates,xenial-security,xenial-security 1.0.2g-1ubuntu4.13 all [upgradable from: 1.0.2g-1ubuntu4.12]
libssl1.0.0/xenial-updates,xenial-security 1.0.2g-1ubuntu4.13 amd64 [upgradable from: 1.0.2g-1ubuntu4.12]
openssl/xenial-updates,xenial-security 1.0.2g-1ubuntu4.13 amd64 [upgradable from: 1.0.2g-1ubuntu4.12]
# apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  libssl-dev libssl-doc libssl1.0.0 openssl
4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 3,996 kB of archives.
After this operation, 1,024 B of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://mirrors.linode.com/ubuntu xenial-updates/main amd64 libssl-doc all 1.0.2g-1ubuntu4.13 [1,079 kB]
Get:2 http://mirrors.linode.com/ubuntu xenial-updates/main amd64 libssl-dev amd64 1.0.2g-1ubuntu4.13 [1,342 kB]
Get:3 http://mirrors.linode.com/ubuntu xenial-updates/main amd64 libssl1.0.0 amd64 1.0.2g-1ubuntu4.13 [1,083 kB]
Get:4 http://mirrors.linode.com/ubuntu xenial-updates/main amd64 openssl amd64 1.0.2g-1ubuntu4.13 [492 kB]
Fetched 3,996 kB in 0s (61.3 MB/s)
Preconfiguring packages ...
(Reading database ... 66394 files and directories currently installed.)
Preparing to unpack .../libssl-doc_1.0.2g-1ubuntu4.13_all.deb ...
Unpacking libssl-doc (1.0.2g-1ubuntu4.13) over (1.0.2g-1ubuntu4.12) ...
Preparing to unpack .../libssl-dev_1.0.2g-1ubuntu4.13_amd64.deb ...
Unpacking libssl-dev:amd64 (1.0.2g-1ubuntu4.13) over (1.0.2g-1ubuntu4.12) ...
Preparing to unpack .../libssl1.0.0_1.0.2g-1ubuntu4.13_amd64.deb ...
Unpacking libssl1.0.0:amd64 (1.0.2g-1ubuntu4.13) over (1.0.2g-1ubuntu4.12) ...
Preparing to unpack .../openssl_1.0.2g-1ubuntu4.13_amd64.deb ...
Unpacking openssl (1.0.2g-1ubuntu4.13) over (1.0.2g-1ubuntu4.12) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Setting up libssl-doc (1.0.2g-1ubuntu4.13) ...
Setting up libssl1.0.0:amd64 (1.0.2g-1ubuntu4.13) ...
Setting up libssl-dev:amd64 (1.0.2g-1ubuntu4.13) ...
Setting up openssl (1.0.2g-1ubuntu4.13) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
# dpkg -l | grep libssl
ii  libssl-dev:amd64                   1.0.2g-1ubuntu4.13                         amd64        Secure Sockets Layer toolkit - development files
ii  libssl-doc                         1.0.2g-1ubuntu4.13                         all          Secure Sockets Layer toolkit - development documentation
ii  libssl1.0.0:amd64                  1.0.2g-1ubuntu4.13                         amd64        Secure Sockets Layer toolkit - shared libraries
# dpkg -l | grep openssl
ii  libgnutls-openssl27:amd64          3.4.10-4ubuntu1.4                          amd64        GNU TLS library - OpenSSL wrapper
ii  openssl                            1.0.2g-1ubuntu4.13                         amd64        Secure Sockets Layer toolkit - cryptographic utility

我们遇到了一些与 CSP(内容安全策略)/CORS 相关的问题,我想知道是否是最近的升级导致了这些问题(因为其他方面都没有改变)。我想从版本降级1.0.2g-1ubuntu4.131.0.2g-1ubuntu4.12,但apt被拒绝:

# apt install openssl=1.0.2g-1ubuntu4.12
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Version '1.0.2g-1ubuntu4.12' for 'openssl' was not found

# apt-cache policy openssl
openssl:
  Installed: 1.0.2g-1ubuntu4.13
  Candidate: 1.0.2g-1ubuntu4.13
  Version table:
 *** 1.0.2g-1ubuntu4.13 500
        500 http://mirrors.linode.com/ubuntu xenial-updates/main amd64 Packages
        500 http://mirrors.linode.com/ubuntu xenial-security/main amd64 Packages
        100 /var/lib/dpkg/status
     1.0.2g-1ubuntu4 500
        500 http://mirrors.linode.com/ubuntu xenial/main amd64 Packages

相关内容