Fix ‘add-apt-repository command not found’ lỗi trên Ubuntu and Debian

Hướng dẫn nhanh này chỉ cho các bạn cách khắc phục nhanh lỗi “add-apt-repository command not found” trên nền tảng Debian, Ubuntu và các bản phân phối Linux dựa trên Debian khác.

command not found
Fix ‘add-apt-repository command not found’ lỗi trên Ubuntu and Debian

Nếu bạn muốn thêm một kho lưu trữ PPA mới, bạn sẽ phải sử dụng lệnh add-apt-repository theo cách sau:

sudo add-apt-repository ppa:some/ppa

Trong Debian, hệ điều hành cơ bản trên Ubuntu, bạn sẽ thấy lỗi mà lệnh add-apt-repository bị thiếu.

sudo: add-apt-repository: command not found

Hãy cùng xem cách khắc phục lỗi khó chịu này bên dưới nhé:

Sửa lỗi add-apt-repository: command not found

Lỗi rất đơn giản. Gói add-apt-repository không được cài đặt trên hệ thống của bạn.

Nhưng nếu bạn cố gắng sử dụng sudo apt-get install add-apt-repository, nó sẽ được thực hiện.

Nó có thể vì lệnh add-apt-repository là một phần của gói phần mềm thuộc tính chung và bạn cần cài đặt gói này để cài đặt add-apt-repository.

Vì vậy, mở Terminal và sử dụng lệnh này:

sudo apt-get install software-properties-common

khi gõ lệnh bên trên nó sẽ giống như thế này:

Reading package lists... DoneBuilding dependency tree       Reading state information... DoneThe following NEW packages will be installed:  software-properties-common0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.Need to get 9,912 B of archives.After this operation, 197 kB of additional disk space will be used.Get:1 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 software-properties-common all 0.96.24.32.5 [9,912 B]Fetched 9,912 B in 2s (5,685 B/s)                      Selecting previously unselected package software-properties-common.(Reading database ... 265950 files and directories currently installed.)Preparing to unpack .../software-properties-common_0.96.24.32.5_all.deb ...Unpacking software-properties-common (0.96.24.32.5) ...Processing triggers for man-db (2.8.3-2) ...Processing triggers for dbus (1.12.2-1ubuntu1) ...Setting up software-properties-common (0.96.24.32.5) ...

Sau khi bạn cài đặt phần mềm thuộc tính chung, bạn nên cập nhật hệ thống bằng lệnh này:

sudo apt-get update

Bây giờ bạn có thể thoải mái sử dụng các lệnh add-apt-repository hoặc apt-add-repository để thêm PPA.

Mình hy vọng mẹo nhanh này đã giúp bạn khắc phục lỗi kho lưu trữ add-apt-apt: command not found trên Ubuntu và các bản phân phối Linux dựa trên Debian khác.

Nếu bạn vẫn gặp phải vấn đề với PPA, hãy cho tôi biết trong phần bình luận. Đề xuất bổ sung, câu hỏi hoặc một lời cảm ơn nhanh chóng luôn được chào đón.

Source: itsfoss

Chiasefree

I am passionate about blogging and sharing good tips to readers, I like random web programming. Never back down.

Đăng nhận xét (0)
Mới hơn Cũ hơn