Skip to content

Instantly share code, notes, and snippets.

@drandreaskrueger
Last active November 13, 2023 04:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drandreaskrueger/705e1f243e8c1fe1d619ac93275c0c7e to your computer and use it in GitHub Desktop.
Save drandreaskrueger/705e1f243e8c1fe1d619ac93275c0c7e to your computer and use it in GitHub Desktop.
installs freemind on Debian stretch(testing) - almost works, some issues, have asked in freemind sourceforge forum - https://sourceforge.net/p/freemind/discussion/22102/thread/8ee5e81f/
# distro can be one of experimental, unstable, testing or ubuntu.
DISTRO=testing
echo
echo install freemind
echo script by Andreas Krueger 2017, version v01
echo
echo must be run as root:
echo
echo adding repo to /etc/apt/sources.list.d/freemind.list
cat <<EOF >> freemind.list
deb http://eric.lavar.de/comp/linux/debian/ $DISTRO/
deb-src http://eric.lavar.de/comp/linux/debian/ $DISTRO/
EOF
sudo mv freemind.list /etc/apt/sources.list.d/
echo adding PGP key:
wget -O - http://eric.lavar.de/comp/linux/debian/deb_zorglub_s_bawue_de.pubkey | sudo apt-key add -
echo
echo updating:
sudo apt-get update
echo installing:
sudo apt-get install libbatik-java libjcalendar-java freemind
sudo apt-get install freemind-plugins-svg/experimental freemind-plugins-time/experimental freemind-plugins-help/experimental libjgoodies-forms-java/testing
echo
echo done.
echo if there were no errors, then freemind got installed. Type \'freemind\' to try. You might want to add a menu entry pointing to this file:
which freemind
echo
@t-hofmann
Copy link

t-hofmann commented Mar 10, 2017

In order to add a menu entry I created the following files (used/tested on Linux Mint 18/18.1).
The install-script (install.sh) expects a subfolder "freemind" containing the extracted freemind-files, e. g. freemind/freemind.sh
also an icon-file "freemind.ico" is expected to be in that folder, which is something that at least was missing from the distributed files at the time I created this solution.

Feel free to adapt.

install.sh:

#!/usr/bin/env sh
cp -a freemind /opt/.
cp freemind.desktop /usr/share/applications/.

freemind.desktop:

[Desktop Entry]
Name=FreeMind
Comment=FreeMind Mindmapping Software
GenericName=freemind-1.0.1
Exec=/opt/freemind/freemind.sh
Icon=/opt/freemind/freemind.ico
Type=Application
Terminal=false
StartupNotify=true
Categories=Multimedia;Utility;

HTH,
Thomas

@t-hofmann
Copy link

t-hofmann commented Mar 10, 2017

please add some mechanism to check the validity of the encryption key. And add the repository only after successfull check of the key.
bash-solution:

# KEY_ID and FINGERPRINT taken from http://eric.lavar.de/comp/linux/debian/
KEY_ID='869D2871'
FINGERPRINT='98FB 95CD 6C40 4DF7 E758 601D 27CD 3F36 869D 2871'

function _installed_fingerprint() {
	key_id=$1
	apt-key fingerprint $key_id \
	| /bin/grep fingerprint \
	| sed 's/.* = //' \
	| sed 's/  / /' # fixing the double-space-character if apt-key output
}

function _isKeyValid() {
	expected=$FINGERPRINT
	installed=$(_installed_fingerprint $KEY_ID)
	
	if [ "$expected" == "$installed" ];
	then
		echo 1
	else 
		echo 0
	fi
}

# add some test after installing the key, like:
if [ $(_isKeyValid) -eq 1 ]; then
	echo "add repository"
	add_repository
else 
	echo "ERROR: could not add repository"
	echo "       comparison of keys's fingerprints failed"
	installed_fingerprint=$(_installed_fingerprint $KEY_ID);
	echo "installed: $installed_fingerprint"
	echo "expected:  $FINGERPRINT"
	exit 1
fi

Note: recently I added a docker repository with this function, the commandline-program "add-apt-repository" seems more robust, than catting into a file.

function add_repository() {
	sudo add-apt-repository \
		"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
		$UBUNTU_PARENT \
		stable"
}

@drandreaskrueger
Copy link
Author

Thanks a lot, sorry that I had overlooked this for so long.

@drandreaskrueger
Copy link
Author

sudo apt-get update

still results in

...
Hit:18 https://netcologne.dl.sourceforge.net/project/ubuntuzilla/mozilla/apt all InRelease                                         
Ign:16 http://eric.lavar.de/comp/linux/debian experimental/ Release.gpg
Fetched 198 B in 0s (248 B/s)   
Reading package lists... Done
W: GPG error: http://eric.lavar.de/comp/linux/debian experimental/ Release: The following signatures were invalid: 98FB95CD6C404DF7E758601D27CD3F36869D2871
W: The repository 'http://eric.lavar.de/comp/linux/debian experimental/ Release' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.

@drandreaskrueger
Copy link
Author

I have tried out your "please add some mechanism to check ..." script. I get this:

Warning: apt-key output should not be parsed (stdout is not a terminal)
ERROR: could not add repository
       comparison of keys's fingerprints failed
Warning: apt-key output should not be parsed (stdout is not a terminal)
installed: 
expected:  98FB 95CD 6C40 4DF7 E758 601D 27CD 3F36 869D 2871

@drandreaskrueger
Copy link
Author

I have also tried with

cat /etc/apt/sources.list.d/freemind.list 
deb http://eric.lavar.de/comp/linux/debian/ stretch/
deb-src http://eric.lavar.de/comp/linux/debian/ stretch/

but

sudo apt update
...
Err:13 http://eric.lavar.de/comp/linux/debian stretch/ Release                                                                                                                           
  404  Not Found
...
Reading package lists... Done 
E: The repository 'http://eric.lavar.de/comp/linux/debian stretch/ Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

@drandreaskrueger
Copy link
Author

drandreaskrueger commented Oct 11, 2017

@victort
Copy link

victort commented Dec 6, 2017

I think there's something wrong with Eric Lavarde's key. expired or something maybe? or his repo isn't signed with it (anymore)?

The following signatures were invalid: 98FB95CD6C404DF7E758601D27CD3F36869D2871

sort of calls this out.

US$0.02++

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment