Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deb安装时创建桌面文件夹失败 #20

Open
cihe13375 opened this issue Mar 5, 2024 · 8 comments
Open

deb安装时创建桌面文件夹失败 #20

cihe13375 opened this issue Mar 5, 2024 · 8 comments

Comments

@cihe13375
Copy link

cihe13375 commented Mar 5, 2024

sudo dpkg -i ./SuperMemo18.05-lazy-winetricks.v1.4.0.1.deb会出现这样的问题(用username代表用户名):

正在选中未选择的软件包 supermemo18.05-wine32:i386。
(正在读取数据库 ... 系统当前共安装有 450877 个文件和目录。)
准备解压 .../SuperMemo18.05-lazy-winetricks.v1.4.0.1.deb  ...
正在解压 supermemo18.05-wine32:i386 (1.4.0.1-lazy-winetricks) ...
正在设置 supermemo18.05-wine32:i386 (1.4.0.1-lazy-winetricks) ...
/home/username username username username/桌面/SuperMemo卡组与资料库/
ln: target 'username/桌面/SuperMemo卡组与资料库/SuperMemo_C盘卡组': No such file or directory
ln: target 'username/桌面/SuperMemo卡组与资料库/SuperMemo_D盘卡组': No such file or directory
ln: target 'username/桌面/SuperMemo卡组与资料库/SuperMemo_E盘卡组': No such file or directory
ln: target 'username/桌面/SuperMemo卡组与资料库/SuperMemo_C盘资料库': No such file or directory
dpkg: 处理软件包 supermemo18.05-wine32:i386 (--install)时出错:
 已安装 supermemo18.05-wine32:i386 软件包 post-installation 脚本 子进程返回错误状态 1
正在处理用于 mailcap (3.70+nmu1ubuntu1) 的触发器 ...
正在处理用于 desktop-file-utils (0.26-1ubuntu3) 的触发器 ...
在处理时有错误发生:
 supermemo18.05-wine32:i386

原因在于postin-action.sh中用户名是这样获取的:

sname=`eval echo $(who | grep "(:0)" | awk '{print $1}')`

在我的机器上,who的输出是这样的(实际上,每多开一个命令行窗口就会出现一个pts/*

username tty1         2024-03-05 01:59 (:0)
username pts/0        2024-03-05 01:59 (:0)
username pts/1        2024-03-05 13:37 (:0)
username pts/2        2024-03-05 13:45 (:0)

结果就是sname变成username username ...这样重复的结构。
一个解决方法是用head -n 1提取第一项:

sname=`eval echo $(who | grep "(:0)" | awk '{print $1}' | head -n 1)`

(k)ubuntu 22.04.

@Zacharia2
Copy link
Owner

改成whoami命令大概就可以了吧

@cihe13375
Copy link
Author

改成whoami命令大概就可以了吧

sudo dpkg的时候whoami好像会变成root 可以试一下

@Zacharia2
Copy link
Owner

我原本的意思是,获取当前登录的账户,就是你的账户名字,而不是root

@Zacharia2
Copy link
Owner

这样就可以直接定位到你的桌面

@Zacharia2
Copy link
Owner

logname大概可以了吧

@cihe13375
Copy link
Author

cihe13375 commented Apr 19, 2024

logname大概可以了吧

maybe
btw 我现在没有在用这个 我就unsubscribe这个thread了()

@Zacharia2
Copy link
Owner

嗯嗯,我自从创建这个软件包之后就没有用过Linux了。啥都是Windows优先了。

@Zacharia2
Copy link
Owner

https://www.cnblogs.com/bodhitree/p/6018369.html

用特定用户执行

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants