在過去的幾天裡,每次我嘗試安裝新應用程式時,我都會得到
ubuntu unable to install:
cannot perform the following task:
...沒有列出應用程式名稱或任務。我試過
sudo apt update
sudo apt upgrade
sudo apt autoremove
之後沒有更好的結果。作為一個非常菜鳥,我不知道下一步該嘗試什麼。任何想法?
在此先感謝您的幫忙!
經過幾次交流後,建議我加入以下資訊:
貓 /etc/apt/sources.list
# deb cdrom:[Ubuntu 16.04.2 LTS _Xenial Xerus_ - Release amd64 (20170215.2)]/ xenial main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu bionic main restricted
# deb-src http://fr.archive.ubuntu.com/ubuntu/ xenial main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu bionic-updates main restricted
# deb-src http://fr.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu bionic universe
# deb-src http://fr.archive.ubuntu.com/ubuntu/ xenial universe
deb http://archive.ubuntu.com/ubuntu bionic-updates universe
# deb-src http://fr.archive.ubuntu.com/ubuntu/ xenial-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://archive.ubuntu.com/ubuntu bionic multiverse
# deb-src http://fr.archive.ubuntu.com/ubuntu/ xenial multiverse
deb http://archive.ubuntu.com/ubuntu bionic-updates multiverse
# deb-src http://fr.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb-src http://fr.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
deb http://archive.canonical.com/ubuntu bionic partner
deb-src http://archive.canonical.com/ubuntu bionic partner
deb http://archive.ubuntu.com/ubuntu bionic-security main restricted
# deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
deb http://archive.ubuntu.com/ubuntu bionic-security universe
# deb-src http://security.ubuntu.com/ubuntu xenial-security universe
deb http://archive.ubuntu.com/ubuntu bionic-security multiverse
# deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse
deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main
# deb-src https://dl.winehq.org/wine-builds/ubuntu/ bionic main
ls /etc/apt/sources.list.d -1
megasync.list
megasync.list.distUpgrade
megasync.list.save
slack.list
slack.list.save
teamviewer.list
答案1
您需要設定 apt 代理設定: https://help.ubuntu.com/community/Ap...e_a_http-proxy
注意使用指令
代碼:
sudo -H gedit
而不是 gksudo,因為 gksudo 不再存在。
編輯:由於連結不存在,請嘗試此操作
apt載入/etc/apt/apt.conf.d下的所有設定檔。我們可以在那裡專門為我們的代理創建一個配置,使其與所有其他配置分開。
建立一個名為 proxy.conf 的新設定檔。
sudo touch /etc/apt/apt.conf.d/proxy.conf
在文字編輯器中開啟 proxy.conf 檔案。
sudo vi /etc/apt/apt.conf.d/proxy.conf
新增以下行來設定您的 HTTP 代理。
Acquire::http::Proxy "http://user:[email protected]:port/";
新增以下行來設定您的 HTTPS 代理程式。
Acquire::https::Proxy "http://user:[email protected]:port/";
儲存變更並退出文字編輯器。
您的代理設定將在下次執行 Apt 時套用。