Skip to content

Commit

Permalink
vscode-deb-setup.sh (#1):v1.3 released; document how to hotfix Tails bug
Browse files Browse the repository at this point in the history
HOTFIX: Error "KeyError: "The cache has no package named 'code'""

sudo gedit /usr/local/sbin/tails-additional-software
change
    if not apt_cache[package_name].is_installed:
for this
    if (package_name not in apt_cache) or apt_cache[package_name].is_installed:
  • Loading branch information
fititnt committed Oct 23, 2020
1 parent be7331e commit ae2f0af
Showing 1 changed file with 26 additions and 19 deletions.
45 changes: 26 additions & 19 deletions docs/vscode-deb-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,26 @@
#
# USAGE: cat vscode-deb-setup.sh
#
# DESCRIPTION: TailsOS (tested v4.12) already comes with git cli command. This
# doc explain one way to configure a new account. And suggest
# extra optionated packages (git-gui, gitk)
# DESCRIPTION: Install VSCode from .deb file on Tails.
#
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# BUGS: 1. As for Tails v4.12, this script have some bugs. Consider
# using the alternative vscode-portable-setup.sh
# NOTES: ---
# AUTHOR: Emerson Rocha <rocha[at]ieee.org>
# COMPANY: Etica.AI
# LICENSE: Public Domain
# VERSION: 1.2
# VERSION: 1.3
# CREATED: 2020-10-17 12:27 UTC
# REVISION: 2020-10-17 10:57 UTC v1.1 re-started. The vscode-portable-setup.sh v1.0
# was deleted by mistake (around ~30min of
# work lost). TailsOS don't have a trash
# feature and even VSCode warned
# 2020-10-17 12:41 UTC v1.2 (fork from vscode-portable-setup.sh v1.1)
# 2020-10-23 15:11 UTC v1.3 Explain Hotfix for apt_hook_pre() on
# /usr/local/sbin/tails-additional-software
# to be able to install debs.
#===============================================================================
echo "Usage:"
echo " cat vscode-deb-setup.sh"
Expand All @@ -39,21 +41,26 @@ mkdir /home/amnesia/Persistent/downloads
#### 2. Download and install VSCode deb _________________________________________
# @see https://code.visualstudio.com/docs/editor/portable

# Choose ONE of the following steps

### 2.1 /home/amnesia/Persistent/downloads/vscode.deb (Persistent installer) .....
wget https://go.microsoft.com/fwlink/?LinkID=760868 -O /home/amnesia/Persistent/downloads/vscode.deb
# sudo apt update
sudo apt install /home/amnesia/Persistent/downloads/vscode.deb


### 2.2 /tmp/vscode.deb (Download on RAM) .........................................
### 2 /home/amnesia/Persistent/downloads/vscode.deb (Persistent installer) .....
wget https://go.microsoft.com/fwlink/?LinkID=760868 -O /tmp/vscode.deb
# sudo apt update
sudo apt update
sudo apt install /tmp/vscode.deb

# Delete the /tmp file to allow system free memory
rm -f /tmp/vscode.deb

#### README: example not working __________________________________________________
# @see https://github.com/fititnt/TailsOS-for-non-whistleblowers/issues/1#issuecomment-710931772
#### HOTFIX: Error "KeyError: "The cache has no package named 'code'""
# @see https://github.com/fititnt/TailsOS-for-non-whistleblowers/issues/12#issuecomment-715442018
# This error happens on at least on Tails v4.11 / v4.12. You should ONLY do it
# if step 2 'sudo apt install /tmp/vscode.deb' fails with error message
# KeyError: "The cache has no package named 'code'""
#
# sudo gedit /usr/local/sbin/tails-additional-software
# Change this
## if action.endswith(".deb"):
## # Filter packages that will only be upgraded
## if not apt_cache[package_name].is_installed:
## installed_packages.append(package_name)
# for this
## if action.endswith(".deb"):
## # Filter packages that will only be upgraded
## if (package_name not in apt_cache) or apt_cache[package_name].is_installed:
## installed_packages.append(package_name)

0 comments on commit ae2f0af

Please sign in to comment.