Làm cách nào để sử dụng Firefox từ kho 18.04 trong Ubuntu 20.04?

Jan 02 2021

Firefox trong Ubuntu 18.04 có một bản vá đặc biệt để kích hoạt menu chung , bản vá này đã bị loại bỏ trong các phiên bản tiếp theo. Tôi muốn cài đặt phiên bản đó trong 20.04. Một cách để làm điều này là lấy tệp .deb và chạy sudo apt-mark hold firefox. Nhưng sau đó, tôi sẽ phải áp dụng bản cập nhật theo cách thủ công khi phiên bản mới được phát hành.

Có cách nào để cấu hình aptđể chỉ có firefox được cài đặt (và cập nhật) từ kho 18.04, trong khi tất cả các phần mềm khác sẽ được cài đặt từ kho 20.04?

(Mặc dù bản vá menu toàn cầu đã bị loại bỏ khi Unity ngừng hoạt động, menu toàn cầu vẫn còn rất nhiều do tính năng menu toàn cầu của KDE Plasma).

Trả lời

7 nobody Jan 02 2021 at 19:06

Trong /etc/apt/sources.list.d/nguồn bionic add, vì vậy nó sẽ dễ dàng hơn để xoá bỏ nó. Để thực hiện việc này, hãy tạo tệp /etc/apt/sources.list.d/bionic.listvới nội dung sau.

deb http://archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse

tạo nên /etc/apt/preferences.d/bionic.pref

#preference for firefox from bionic
    
Explanation: Allow installing firefox from bionic
Package: firefox
Pin: release a=bionic-updates
Pin-Priority: 1101

Explanation: Avoid other packages from the bionic repo.
Package: *
Pin: release a=bionic
Pin-Priority: 1

Tiếp tục với

sudo apt update

mô phỏng đầu tiên, bởi vì tôi không không nếu một số ppa được bao gồm trong hệ thống của bạn.

apt -s full-upgrade
NOTE: This is only a simulation!
      apt needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be DOWNGRADED:
  firefox
0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 0 not upgraded.
Inst firefox [84.0+build3-0ubuntu0.20.04.1] (84.0+build3-0ubuntu0.18.04.1 Ubuntu:18.04/bionic [amd64])
Conf firefox (84.0+build3-0ubuntu0.18.04.1 Ubuntu:18.04/bionic [amd64])

Sau đó chạy sudo apt full-upgradeđể cài đặt firefox từ Ubuntu 18.04.