Я пытался выполнить команду sudo apt-get update
Это показало мне следующую ошибку.
E: Failed to stat /var/lib/apt/lists/partial/packages.microsoft.com_repos_vscode_dists_stable_InRelease - pkgAcqTransactionItem::TransactionState-stat (2: No such file or directory)
E: Failed to stat /var/lib/apt/lists/partial/packages.microsoft.com_repos_vscode_dists_stable_main_binary-amd64_Packages - pkgAcqTransactionItem::TransactionState-stat (2: No such file or directory)
W: Duplicate sources.list entry http://packages.microsoft.com/repos/vscode stable Release
Как решить эту ошибку?
Содержание /etc/apt/sources.list
# deb cdrom:[Ubuntu 16.04.2 LTS _Xenial Xerus_ - Release amd64 (20170215.2)]/ x$
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://in.archive.ubuntu.com/ubuntu/ xenial main restricted
# deb-src http://in.archive.ubuntu.com/ubuntu/ xenial main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://in.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
# deb-src http://in.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://in.archive.ubuntu.com/ubuntu/ xenial universe
# deb-src http://in.archive.ubuntu.com/ubuntu/ xenial universe
deb http://in.archive.ubuntu.com/ubuntu/ xenial-updates universe
# deb-src http://in.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://in.archive.ubuntu.com/ubuntu/ xenial multiverse
# deb-src http://in.archive.ubuntu.com/ubuntu/ xenial multiverse
deb http://in.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
# deb-src http://in.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 http://in.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src http://in.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 xenial partner
# deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://security.ubuntu.com/ubuntu xenial-security main restricted
# deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
deb http://security.ubuntu.com/ubuntu xenial-security universe
# deb-src http://security.ubuntu.com/ubuntu xenial-security universe
deb http://security.ubuntu.com/ubuntu xenial-security multiverse
# deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse
deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main
# deb-src [arch=amd64] https://packages.microsoft.com/repos/vscode stable main
Шаг 1: Нажмите ctrl высокий звук t для открытия terminal
Step 2:Run Шаг 3 команды
sudo apt clean
: Обновите список пакета
sudo apt update
Шаг 4: Удалите все файлы от /var/lib/apt/lists/partial
(если существует)
sudo rm /var/lib/apt/lists/partial/*
Шаг 5: Удалите строки от /etc/apt/sources.list
deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main
# deb-src [arch=amd64] https://packages.microsoft.com/repos/vscode stable main
Шаг 6: Загрузка vscode
пакет из этой ссылки https://go.microsoft.com/fwlink/? Шаг 7 LinkID=760868
: cd
к каталогу загрузки, в котором файл загружается (вероятно Downloads
) и выполняет команду
sudo dpkg -i *.deb
Согласно ответам от эта ссылка , для решения этой проблемы:
sudo rm /var/lib/apt/lists/partial/*
) sudo apt purge vscode
) sudo apt update
cd ~/Downloads
. sudo dpkg -i code_1.41.1-1576681836_amd64.deb
(имя файла может изменить accorfing на номер версии). Для удаления дублирующегося предупреждения:
1-работает sudo gedit /etc/apt/sources.list
2-, комментирует строка, которая имеет http://packages.microsoft.com/repos/vscode stable Release
3-, сохраняют и выходят
Я перепробовал много предложений, но следующее решение помогло мне.
sudo rm -rf /etc/apt/sources.list.d/vscode.list*
sudo apt-get update
Надеюсь, это может быть полезно для других с похожей проблемой.