[ 已解决 ]openSUSE 13.1 无法安装 Mathematica9.0.1

在官网下载 的 mathematica9.0.1_for_linux.sh 在终端里 ./xxx.sh 运行之 结果提示 DOCTYPE no such file …

以前在 ubuntu1310 下安装过 也是这个问题 貌似是 sh 文件编码的问题吗?

本人 linux 小白 最近刚刚转到 opensuse 以前就接触过 ubuntu 2 个星期。。。。

运行的时候有没有 root?

尝试 sudo bash ./xxx.sh

我在网上搜索到一个specfile。 不确保suse下能用。不过我检测了一下里面的几个buildrequirement都是openSUSE的官方源里有的包。 可以试着build一下rpm,再用rpm装:

# Don't generate any debuginfo packages
%global debug_package %{nil}
 
# Post install checking of installed files is determined by three variables:
#
# __arch_install_post
# __os_install_post
# __spec_install_post
#
# each of which can be examined with rpm --eval %var. The last one
# is the catenation of the first two.
#
# At the least we want to disable rpath checking with
#
# define __arch_install_post /usr/lib/rpm/check-buildroot
#
# which keeps the check for occurences of $RPM_BUILD_ROOT in scripts -
# useful to do this sometimes, but very time consuming
#
#define __arch_install_post %{nil}
%define __arch_install_post /usr/lib/rpm/check-buildroot
%define __os_install_post %{nil}
 
# Disable automatic dependency and provides information
%define __find_provides %{nil}
%define __find_requires %{nil}
%define _use_internal_dependency_generator 0
Autoprov: 0
Autoreq: 0
 
 
Name:           Mathematica
Version:        9.0.1
Release:        1%{?dist}
Summary:        A platform for scientific, engineering, and mathematical computation
 
Group:          Applications/Engineering
License:        Proprietary
URL:            http://wwww.wolfram.com
Source0:        %{name}_%{version}_LINUX.sh
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
BuildRequires:  prelink
BuildRequires:  hicolor-icon-theme
BuildRequires:  desktop-file-utils
 
%description
Mathematica is a computational software program used in scientific,
engineering, and mathematical fields and other areas of technical
computing.
 
%prep
%setup -T -c %{name}-%{version}
 
cp %SOURCE0 .
chmod +x %{name}_%{version}_LINUX.sh
 
%build
# Nothing to do
 
%install
rm -rf $RPM_BUILD_ROOT
 
%define destdir /opt/%{name}/%{version}
 
./%{name}_%{version}_LINUX.sh -- \
        -auto -createdir=y -selinux=y -verbose \
        -targetdir=$RPM_BUILD_ROOT%{destdir} \
        -execdir=$RPM_BUILD_ROOT%{destdir}/bin
 
# Unfortunately the installer script creates absolute symlinks which
# break once files are moved out of the build root. So, we have to
# manually recreate them here as relative links
before=($(echo $RPM_BUILD_ROOT%{destdir}/bin/*))
 
rm -rf $RPM_BUILD_ROOT%{destdir}/bin/*
 
for i in `ls $RPM_BUILD_ROOT%{destdir}/Executables` ; do
    ln -s %{destdir}/Executables/${i} $RPM_BUILD_ROOT%{destdir}/bin/${i}
done
 
ln -s %{destdir}/SystemFiles/Kernel/Binaries/Linux-x86-64/MathematicaScript $RPM_BUILD_ROOT%{destdir}/bin/MathematicaScript
 
after=($(echo $RPM_BUILD_ROOT%{destdir}/bin/*))
 
if  "${before*]}" != "${after*]}" ] ; then
   echo "$RPM_BUILD_ROOT%{destdir}/bin doesn't contain all required symlinks after relinking"
   exit 1
fi
 
# Fix up prelink error
# prelink: # /home/jgu/rpmbuild/BUILDROOT/Mathematica-8.0.1-1.el6.x86_64/opt/Mathematica/8.0.1/SystemFiles/Libraries/Linux/libPHANToMIO.so.4:
# Could not find one of the dependencies)
# See eg. http://www.redhat.com/archives/rpm-list/2008-May/msg00011.html
prelink -u $RPM_BUILD_ROOT%{destdir}/SystemFiles/Libraries/Linux/libPHANToMIO.so.4
 
# Fix up hardcoded references to the buildroot in installed files -
# this silences the check-buildroot script that is ran by rpmbuild
# after %%install
for i in $RPM_BUILD_ROOT%{destdir}/SystemFiles/Installation/*.desktop ; do
    sed -i -e "s|$RPM_BUILD_ROOT||g" $i
done
 
# Install menu and mimetype information
install -d $RPM_BUILD_ROOT%{_datadir}/applications
install -d $RPM_BUILD_ROOT%{_datadir}/mime/packages
 
pushd $RPM_BUILD_ROOT%{destdir}/SystemFiles/Installation
 
# The wolfram-mathematica8.desktop file has strange leading and
# trailing white space, so fix this, and also add a trailing semicolon
# to the MimeType entry to prevent desktop-file-validate from failing
# Note: wolfram-mathematica.desktop (without the 8) doesn't have the
# correct path for Exec etc
sed -i -e 's/^ \t]*//;s/ \t]*$//' wolfram-mathematica9.desktop
sed -i -e '/MimeType/ s/$/;/' wolfram-mathematica9.desktop
 
# We don't want to create a separate sub-menu just for Mathematica, so
# we'll add it to the Programming sub-menu
cat >> wolfram-mathematica9.desktop <<EOF
Categories=Development;
EOF
 
cp -a wolfram-mathematica9.desktop $RPM_BUILD_ROOT%{_datadir}/applications/wolfram-mathematica9.desktop
desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/wolfram-mathematica9.desktop
 
cp -a *.xml $RPM_BUILD_ROOT%{_datadir}/mime/packages/
popd
  
# Install icons
install -d $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/{32x32,64x64,128x128}/{apps,mimetypes}
pushd $RPM_BUILD_ROOT%{destdir}/SystemFiles/FrontEnd/SystemResources/X
for i in "32" "64" "128"; do
    cp -a Mathematica-${i}.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${i}x${i}/apps/wolfram-mathematica.png
    cp -a MathematicaPlayer-${i}.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${i}x${i}/apps/wolfram-mathematicaplayer.png
    cp -a vnd.wolfram.cdf-${i}.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${i}x${i}/mimetypes/application-vnd.wolfram.cdf.png
  
    cp -a MathematicaDoc-${i}.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${i}x${i}/mimetypes/application-mathematica.png
    cp -a MathematicaPlayerDoc-${i}.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${i}x${i}/mimetypes/application-mathematicaplayer.png
    cp -a vnd.wolfram.cdfDoc-${i}.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${i}x${i}/mimetypes/application-vnd.wolfram.cdf.png
  
    cp -a MathematicaDoc-${i}.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${i}x${i}/mimetypes/gnome-mime-application-mathematica.png
    cp -a MathematicaPlayerDoc-${i}.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${i}x${i}/mimetypes/gnome-mime-application-mathematicaplayer.png
    cp -a vnd.wolfram.cdfDoc-${i}.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${i}x${i}/mimetypes/gnome-mime-application-vnd.wolfram.cdf.png
done
popd
 
# Install man pages
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
pushd $RPM_BUILD_ROOT%{destdir}/SystemFiles/SystemDocumentation/Unix
cp -a *.1 $RPM_BUILD_ROOT%{_mandir}/man1
popd
 
# Create mathpass file specifying license server
cat > $RPM_BUILD_ROOT%{destdir}/Configuration/Licensing/mathpass << EOF
!my.license.server.host.name
EOF
 
# Create file to add binaries to PATH
install -d $RPM_BUILD_ROOT%{_sysconfdir}/profile.d
cat > $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/mathematica.sh << EOF
export PATH=\$PATH:%{destdir}/bin
EOF
 
# Create directories for Mathematica system wide package installation
# (corresponding to $BaseDirectory etc)
install -d $RPM_BUILD_ROOT%{_datadir}/Mathematica/{Applications,Autoload}
 
%clean
rm -rf $RPM_BUILD_ROOT
 
%post
# Update icon cache with new icons
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
 
# Update mime database - needed because we install xml mime definitions
/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || :
 
# Update desktop database - needed because .desktop file has a Mimeinfo entry
/usr/bin/update-desktop-database &> /dev/null || :
 
%postun
# Update icon cache to reflect removed icons
if  $1 -eq 0 ] ; then
    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi
 
# Update mime database - needed because we install xml mime definitions
/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || :
 
# Update desktop database - needed because .desktop file has a Mimeinfo entry
/usr/bin/update-desktop-database &> /dev/null || :
 
%posttrans
# Update icon cache to reflect removed icons
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
 
%files
%defattr(-,root,root,-)
%{destdir}
%{_datadir}/Mathematica/Autoload
%{_datadir}/Mathematica/Applications
%{_sysconfdir}/profile.d/*
%{_datadir}/applications/*
%{_datadir}/icons/hicolor/128x128/apps/*
%{_datadir}/icons/hicolor/128x128/mimetypes/*
%{_datadir}/icons/hicolor/32x32/apps/*
/usr/bin/update-desktop-database &> /dev/null || :
 
%posttrans
# Update icon cache to reflect removed icons
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
 
%files
%defattr(-,root,root,-)
%{destdir}
%{_datadir}/Mathematica/Autoload
%{_datadir}/Mathematica/Applications
%{_sysconfdir}/profile.d/*
%{_datadir}/applications/*
%{_datadir}/icons/hicolor/128x128/apps/*
%{_datadir}/icons/hicolor/128x128/mimetypes/*
%{_datadir}/icons/hicolor/32x32/apps/*
%{_datadir}/icons/hicolor/32x32/mimetypes/*
%{_datadir}/icons/hicolor/64x64/apps/*
%{_datadir}/icons/hicolor/64x64/mimetypes/*
%{_datadir}/mime/packages/*
%{_mandir}/man1/*
 
%changelog
* Thu Feb 21 2013 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 9.0.1-1
- Update to 9.0.1
- Add /usr/share/Mathematica/{Applications,Autoload} directories to package
- Other cleanups
 
* Fri Feb 15 2013 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 9.0.0-1
- Update to 9.0.0
 
* Fri Apr 27 2012 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 8.0.4-3
- Fix up .desktop file to add an entry under Programming menu
 
* Fri Apr 27 2012 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 8.0.4-2
- Properly install icons, desktop entries, mimetypes and manpages
- Re-enable the check-buildroot script in __arch_install_post, but
  still disable rpath checking
- No longer set __spec_install_post to nil
 
* Fri Apr 27 2012 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 8.0.4-1
- Update to 8.0.4

感谢:http://stuckinadoloop.wordpress.com/

1赞

不行哦。。。

leo@linux-0c2z:~/Desktop> sudo bash ./Mathematica_9.0.1_LINUX.sh
root's password:
./Mathematica_9.0.1_LINUX.sh: line 8: !DOCTYPE: No such file or directory
./Mathematica_9.0.1_LINUX.sh: line 9: syntax error near unexpected token `newline'
./Mathematica_9.0.1_LINUX.sh: line 9: `   "http://www.w3.org/TR/html4/strict.dtd">'

谢谢帅哥 不过这对我这小白来说 有难度啊

学习 Linux 的第一件事情就是学习用包管理器。 openSUSE: rpm+zypper, fedora:rpm+yum, mageia: rpm+urpmi, Debian: deb+apt, ubuntu: deb+apt

构建 rpm 参考:http://v.youku.com/v_show/id_XNTE5NzA2NDI0.html

现在已经有了一个 specfile,应该不会太难吧。

对于我等小白来讲 难得是对于这些名词完全不知所云。。。谢谢你的视频,我去尝试一下!!~~

对于我等小白来讲 难得是对于这些名词完全不知所云。。。谢谢你的视频,我去尝试一下!!~~
就是一种计算机八股文 :joy:

你在官网上下载的是 Free Trail 版本吗?我试试

是的,trial 版本破解了就一样了 - -

官网给的安装说明 仅仅是 ./ 安装

给他们客户支持发邮件也不回,果真没钱处处受鄙视 - -

楼主是要符号计算么?

可以尝试,Maxima

能用开源免费的还是用开源免费的吧 :)

组里都在用,没办法不用。。。。觉得 emacs+auctex 写 tex 太爽了 , 就转投 linux 的怀抱了。。。此朵傲娇要好好调教
:smirk:

我之前装过最新版,很顺利,然后搞了个激活工具激活了,不知道你的是不是最新版

我是在官网上下载的 trial,版本号 9.0.1,按理说 trial 也应该可以装

下载的时候倒是会经常自动断开,而且下载的文件会莫名其妙变成一个 3.5k 的 html,断开之后要重新去官网找下载链接,就会又接着以前的进度继续,这样断过好几次,会不会是这个原因

是以前在 ubuntu 下用 uget+aria2 下的,ubuntu1310 和 opensuse13.1 都出现 DCOTYPE no such file 错误,详见楼上 code。。。。 :nauseated_face:

组??

兄弟你可是科研院校的??

原来楼主用的 auctex。 那你安装 LaTeX 就 zypper in emacs-auctex 就行了。

我一般说 Kile 是因为 Kile 是 Linux 里最流行的 TeX IDE。 我个人用 Kile,这个坛子里的很多人也用 Kile。

要注册账户才能下载试用版。 否则我就试着给你打一个 rpm 了。 不过我肯定只打试用版的 rpm。

我在 math.uri.edu/~alex/Mathematica/ 找到了一个 sh 文件的下载。 但是一个 sh 文件竟然高达 1.8G? 无法理解。 怀疑是病毒。

这个地方似乎是说一个W3C的DOCTYPE不存在。

调用的DOCTYPE是:http://www.w3.org/TR/html4/strict.dtd

我检查了这个DTD确实存在于W3C的服务器。 会不会你的校园网里无法访问W3C网站导致无法访问这个DTD?

谢谢兄弟,我倒是能够上去那个网站也能在线打开那个dtd文件,不妨等我用先兄弟给的文件安装一下
:sunglasses: